mxfp8_config ¶
MXFP8 quantization for MiniMax-H3 transformer-block feed-forward layers.
Classes¶
fastvideo.layers.quantization.mxfp8_config.MXFP8Config ¶
Bases: QuantizationConfig
Select MXFP8 for the main MiniMax-H3 transformer-block FFN linears.
Source code in fastvideo/layers/quantization/base_config.py
fastvideo.layers.quantization.mxfp8_config.MXFP8QuantizeMethod ¶
Bases: QuantizeMethodBase
Dynamically quantize activations against prequantized MXFP8 weights.
Methods:¶
fastvideo.layers.quantization.mxfp8_config.MXFP8QuantizeMethod.apply ¶
Quantize one BF16 activation and apply the prequantized linear.
Source code in fastvideo/layers/quantization/mxfp8_config.py
fastvideo.layers.quantization.mxfp8_config.MXFP8QuantizeMethod.apply_quantized ¶
apply_quantized(layer: Module, activation_values: Tensor, activation_scales: Tensor, bias: Tensor | None = None) -> Tensor
Apply one linear to an activation that is already in MXFP8.
Source code in fastvideo/layers/quantization/mxfp8_config.py
fastvideo.layers.quantization.mxfp8_config.MXFP8QuantizeMethod.create_weights ¶
create_weights(layer: Module, input_size_per_partition: int, output_partition_sizes: list[int], input_size: int, output_size: int, params_dtype: dtype, **extra_weight_attrs: Any) -> None
Create the BF16 checkpoint weight and non-persistent MXFP8 buffers.
Source code in fastvideo/layers/quantization/mxfp8_config.py
fastvideo.layers.quantization.mxfp8_config.MXFP8QuantizeMethod.process_weights_after_loading ¶
Prequantize one adapter-merged BF16 linear weight.
Source code in fastvideo/layers/quantization/mxfp8_config.py
Functions:¶
fastvideo.layers.quantization.mxfp8_config.convert_model_to_mxfp8 ¶
convert_model_to_mxfp8(model: Module) -> int
Prequantize every MXFP8-tagged weight and return the converted count.