feat(moe): add CUTLASS BF16+MXFP4 SM90 MoE definition, solution, workload, trace
#17
by omeng-nvidia - opened
Add a new definition for flashinfer.fused_moe.cutlass_fused_moe's SM90
mixed-input path (BF16 activation x MXFP4 weight, W4A16), Qwen3-30B-A3B
shape (128 experts, H=2048, I=768, top_k=8).
- reference: deterministic pure-PyTorch MXFP4 dequant (E2M1 LUT unpack +
UE8M0 power-of-two decode) + per-expert SwiGLU, no flashinfer dependency. - solution: calls the real cutlass_fused_moe, converting canonical
linear-packed weights/scales into the SM90 interleaved byte layout. - workload: real MXFP4-quantized weights + 3 seq_len variants (1/16/64),
generated via flashinfer.fp4_quantize on a real NVIDIA H20 node. - trace: real correctness + performance numbers -- 3/3 PASSED,
matched_ratio 100% at all seq_len.
Two reference-correctness bugs found and fixed during verification:
- UE8M0 decode must treat the reserved sentinel byte 0xFF (255) as scale
0.0 (block amax quantized to zero), not literally 2^128. - flashinfer.fp4_quantize on this H20 environment occasionally emits a
small number of implausible non-sentinel scale bytes (e.g. 254);
worked around via retry-with-validation in workload generation.
Verified end-to-end on NVIDIA H20 (SM90a, 78 SMs), flashinfer-python==0.6.14.
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com