mxfp8linear ¶
MXFP8 block quantization and linear operations for Blackwell inference.
Functions:¶
fastvideo.layers.mxfp8linear.mxfp8_scaled_mm ¶
mxfp8_scaled_mm(activation_values: Tensor, activation_scales: Tensor, weight_values: Tensor, weight_scales: Tensor, bias: Tensor | None) -> Tensor
Multiply two MXFP8 matrices and return a BF16 matrix.
Source code in fastvideo/layers/mxfp8linear.py
fastvideo.layers.mxfp8linear.mxfp8_swiglu_feed_forward ¶
Run the MiniMax-H3 feed-forward network with MXFP8 GEMMs.
Source code in fastvideo/layers/mxfp8linear.py
fastvideo.layers.mxfp8linear.quantize_mxfp8_blockwise ¶
quantize_mxfp8_blockwise(matrix: Tensor) -> tuple[Tensor, Tensor]
Quantize activation rows and write hardware-blocked scales directly.
Source code in fastvideo/layers/mxfp8linear.py
fastvideo.layers.mxfp8linear.quantize_mxfp8_weight_blockwise ¶
quantize_mxfp8_weight_blockwise(matrix: Tensor) -> tuple[Tensor, Tensor]
Prequantize a weight with Quack and return hardware-blocked scales.
Source code in fastvideo/layers/mxfp8linear.py
fastvideo.layers.mxfp8linear.swiglu_quantize_mxfp8_blockwise ¶
swiglu_quantize_mxfp8_blockwise(preactivation: Tensor) -> tuple[Tensor, Tensor]
Apply H3 value-first SwiGLU and quantize the BF16 result to MXFP8.