[Bugfix] Fix FlashInfer CUTLASS MXFP4-MXFP8 MoE by restoring swizzled scale (#42089)

Signed-off-by: mgoin <mgoin64@gmail.com>
This commit is contained in:
Michael Goin
2026-05-08 15:59:06 -07:00
committed by GitHub
parent 8a2fc80b84
commit 8bcd8a260c
12 changed files with 30 additions and 27 deletions
@@ -256,7 +256,7 @@ def moe_kernel_quantize_input(
quant_dtype: None | torch.dtype | str,
per_act_token_quant: bool,
block_shape: list[int] | None = None,
is_fp4_scale_swizzled: bool = True,
is_scale_swizzled: bool = True,
ocp_mx_scheme: str | None = None,
quantization_emulation: bool = False,
mx_alignment: int = 0,
@@ -296,9 +296,7 @@ def moe_kernel_quantize_input(
return _int8_quantize(A, A_scale, per_act_token_quant, block_shape)
elif quant_dtype == "nvfp4":
if not quantization_emulation:
return _nvfp4_quantize(
A, A_scale, is_sf_swizzled_layout=is_fp4_scale_swizzled
)
return _nvfp4_quantize(A, A_scale, is_sf_swizzled_layout=is_scale_swizzled)
else:
A = ref_nvfp4_quant_dequant(A, A_scale, block_size=16)
return A, None
@@ -322,7 +320,7 @@ def moe_kernel_quantize_input(
A_scale,
per_act_token_quant,
block_shape,
is_sf_swizzled_layout=False,
is_sf_swizzled_layout=is_scale_swizzled,
mx_alignment=mx_alignment,
)
elif quant_dtype == "mxfp6_e3m2":