You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the MegaMoECuteDsl backend (ported swap-AB MoE kernel) with NVFP4 quantization for the PyTorch fused-MoE path, wired through ConfigurableMoE / create_moe and the cute_dsl_megamoe_nvfp4_blackwell custom op.
Key points:
- Per-expert NVFP4 scales (fc1_alpha / fc2_alpha / fc1_norm_const) threaded through the v2 kernel ABI, derived from each expert raw input scales.
- FC1/FC2 weights are stored in the natural (slots, N, K_bytes) layout with K (hidden//2 / intermediate//2) innermost, and presented to the kernel as non-contiguous transpose(1, 2) views (slots, K_bytes, N) so the swap-AB kernel reads K-major with K stride-1.
Materializing the transpose with .contiguous() would move K off the innermost axis and corrupt the GEMM (per-token cosine ~0).
- local_workspace is passed with a static cute layout (not mark_layout_dynamic), matching the kernel region-offset contract.
- AutoTuner input pre-hook only sanitizes the regenerated dynamic inputs and leaves the static per-expert weight scales / alphas untouched.
- deepgemm-graph NVFP4 reference (NVFP4RefMegaMoECuteDsl) for accuracy checks.
Verified on GB200: single-GPU test_moe_backend / test_moe_module megamoe_cutedsl
cases pass (per-token cosine ~1.0), and multi-GPU DEP (EP) cases pass.
Signed-off-by: xxi <xxi@nvidia.com>
0 commit comments