flashinfer.quantization.mxfp4_dequantize

flashinfer.quantization.mxfp4_dequantize(a_fp4, a_sf, sfLayout: SfLayout = SfLayout.layout_128x4)

Dequantize MXFP4 packed weights back to float32.

Parameters:
  • a_fp4 (torch.Tensor) – Quantized tensor of shape [M, K/2] with dtype uint8 (FLOAT4_E2M1X2).

  • a_sf (torch.Tensor) – UE8M0 scale-factor tensor (uint8); shape depends on sfLayout.

  • sfLayout (SfLayout) – Scale-factor layout used by a_sf. Defaults to SfLayout.layout_128x4.

Returns:

Dequantized tensor of shape [M, K] with dtype float32.

Return type:

torch.Tensor