[blackwell][draft] sm100: MXFP4 dispatch -> Triton fused_mxfp4_gemm (#227) - #235
Draft
Andrewxu313 wants to merge 2 commits into
Draft
[blackwell][draft] sm100: MXFP4 dispatch -> Triton fused_mxfp4_gemm (#227)#235Andrewxu313 wants to merge 2 commits into
Andrewxu313 wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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