Skip to content

[blackwell][draft] sm100: MXFP4 dispatch -> Triton fused_mxfp4_gemm (#227) - #235

Draft
Andrewxu313 wants to merge 2 commits into
mainfrom
tairan/blackwell-02-04-mxfp4-triton-dispatch
Draft

[blackwell][draft] sm100: MXFP4 dispatch -> Triton fused_mxfp4_gemm (#227)#235
Andrewxu313 wants to merge 2 commits into
mainfrom
tairan/blackwell-02-04-mxfp4-triton-dispatch

Conversation

@Andrewxu313

Copy link
Copy Markdown
Contributor

Closes #227. Part of #204 (Blackwell Phase 2).

Summary

Wire arch=='sm100' in fused_wgmma_grouped.py and fused_wgmma_expert.py to call existing pure-Triton fused_mxfp4_gemm.py. Tune tile sizes for B200 128KB SMEM.

Spec

blackwell-kernel-port-v1.md § Sub-task 4

v-tairan Copilot user and others added 2 commits May 30, 2026 09:24
Placeholder commit for draft PR. Implementation tracked in:
batchgen-agent-metadata/batchgen_design/blackwell/blackwell-kernel-port-v1.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
On Blackwell the Hopper WGMMA/TMA MXFP4 .cu kernels are not built. Route
both MXFP4 MoE paths to the existing pure-Triton fused_mxfp4_gemm kernels:

- fused_wgmma_expert.py: is_wgmma_available() returns True on sm100 without
  loading _C; fused_mxfp4_expert_forward() dispatches to fused_mxfp4_mlp_forward
- fused_wgmma_grouped.py: is_grouped_wgmma_available() True on sm100;
  new fused_mxfp4_grouped_moe_forward_triton() does a per-expert masked loop
  with fp32 accumulation and slot-specific routing-weight reduction
- model.py _grouped_forward: sm100 branch uses the stacked per-expert weight
  tensors (device-pointer arrays can't be reversed) via the Triton helper

Verified on B200: grouped output bit-exact vs per-token reference; expert
path matches direct Triton call; no _C_*_mxfp4_wgmma import on sm100.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the ci:run Trigger build + GPU regression on H20 label May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run Trigger build + GPU regression on H20

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[blackwell] sm100: MXFP4 grouped/expert dispatch -> Triton fused_mxfp4_gemm

1 participant