Skip to content

vllm.model_executor.layers.quantization.online.fp8

Classes:

Fp8PerBlockOnlineLinearMethod

Bases: OnlineLinearBase

Online blockwise FP8 linear quantization. Loads fp16/bf16 weights and quantizes them per-block during loading.

Fp8PerBlockOnlineMoEMethod

Bases: _Fp8OnlineMoEBase

Online blockwise FP8 MoE quantization. Loads fp16/bf16 weights and quantizes them per-block during loading.

Fp8PerTensorOnlineLinearMethod

Bases: OnlineLinearBase

Online tensorwise FP8 linear quantization. Loads fp16/bf16 weights and quantizes them per-tensor during loading.

Fp8PerTensorOnlineMoEMethod

Bases: _Fp8OnlineMoEBase

Online tensorwise FP8 MoE quantization. Loads fp16/bf16 weights and quantizes them per-tensor during loading.

Fp8PtpcOnlineLinearMethod

Bases: OnlineLinearBase

Online PTPC FP8 linear quantization.

Per-output-channel weight scale + dynamic per-token activation scale. The layout matches the llmcompressor's FP8_DYNAMIC recipe, so accuracy is comparable but no pre-quantized checkpoint is required.

activation: null requests weight-only (W8A16) instead: the weights are the same and the activations keep the model dtype.

Fp8PtpcOnlineMoEMethod

Bases: _Fp8OnlineMoEBase

Online PTPC FP8 MoE quantization.

Quantizes each expert's weights per output channel during loading. Activations are quantized dynamically per token at runtime.

OnlineLinearBase

Bases: OnlineRequantizationMixin, LinearMethodBase

Shared base for online FP8 linear methods. Loads fp16/bf16 checkpoint weights onto meta device and materializes them just-in-time.

_Fp8OnlineMoEBase

Bases: OnlineMoEMethodBase

Shared base for online FP8 MoE methods. Loads fp16/bf16 checkpoint weights onto meta device and materializes them just-in-time.

_is_tp_sharded(layer, *, reduces_output_dim=True)

Whether the weight is sharded along a dim its amax reduces over.

Row parallel shards the input dim, column parallel the output dim. Per-output-channel scales only reduce the input dim, so they are already unsharded-equivalent on column-parallel layers.