vllm.model_executor.layers.quantization.fp8
¶
Classes:
-
Fp8Config–Config class for FP8.
-
Fp8KVCacheMethod–Supports loading kv-cache scaling factors from FP8 checkpoints.
-
Fp8LinearMethod–Linear method for FP8.
-
Fp8MoEMethod–MoE method for FP8.
Fp8Config
¶
Bases: QuantizationConfig
Config class for FP8.
Methods:
-
get_cache_scale_mapper–Map compressed-tensors KV-cache scale names to vLLM names.
get_cache_scale_mapper()
staticmethod
¶
Map compressed-tensors KV-cache scale names to vLLM names.
Fp8KVCacheMethod
¶
Fp8LinearMethod
¶
Bases: LinearMethodBase
Linear method for FP8. Supports loading FP8 checkpoints with static weight scale and dynamic/static activation scale.
Limitations: 1. Only support float8_e4m3fn data type due to the limitation of torch._scaled_mm (https://github.com/pytorch/pytorch/blob/2e48b39603411a41c5025efbe52f89560b827825/aten/src/ATen/native/cuda/Blas.cpp#L854-L856)
Parameters:
Fp8MoEMethod
¶
Bases: FusedMoEMethodBase
MoE method for FP8. Supports loading FP8 checkpoints with static weight scale and dynamic/static activation scale.
Also supports loading quantized FP16/BF16 model checkpoints with dynamic activation scaling. The weight scaling factor will be initialized after the model weights are loaded.
Parameters:
Methods:
-
dequantize_weight–Yield
(experts, w13, w2)dequantized FP8 experts, for online