Repository navigation
perf(sm103): SIMT dispatch pull for NVFP4 MegaMoE at block_m <= 128 - #174
Conversation
Use block_m=128 as the decode floor for NVFP4 on SM103 and SM107 (monotonic in the multi-block loop) and enable SIMT dispatch pull by default on SM103 NVFP4 decode (block_m <= 128). Split out from #165 so it can be gated on Muse replay-routing benchmarks independently of the arch-policy refactor and SM107 K=128.
d998e61 to
cca508d
Compare
A 4-round decode sweep (expected 1..64 tokens per expert, uniform / zipf / biased routing) found the BM128 floor 1-5% slower than BM64 on SM103 and SM107 for uniform and moderately skewed routing; it wins only under heavy skew at 16+ expected tokens per expert. The SM103 SIMT pull alone is 0.2-1.8% faster in every cell, including BM16. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Decode sweep:
|
| route | exp 1 | 2 | 3 | 4 | 8 | 16 | 24 | 32 | 48 | 64 |
|---|---|---|---|---|---|---|---|---|---|---|
| u | -0.5 | -0.2 | -0.5 | -0.6 | -0.5 | -0.5 | -0.5 | -0.5 | -0.6 | -0.2 |
| z | -0.2 | -0.2 | -0.5 | -0.5 | -0.5 | -0.8 | -1.7 | -1.8 | -1.7 | -1.1 |
| b0.5 | -0.5 | 0.0 | -0.6 | -0.5 | -0.5 | -0.7 | -0.7 | -1.1 | -1.6 | -0.9 |
| b1 | -0.6 | -0.7 | -0.9 | -1.0 | -0.5 | -0.9 | -1.7 | -1.7 | -1.5 | -1.0 |
BM128 floor only (Pn)
| route | exp 1-2 | 3 | 4 | 8 | 16 | 24 | 32 | 48 | 64 |
|---|---|---|---|---|---|---|---|---|---|
| u | ~0 | +3.3 | +3.1 | +3.1 | +2.7 | +2.5 | +2.6 | +1.7 | ~0 |
| z | ~0 | +2.9 | +1.7 | +2.0 | +1.2 | -0.6 | -2.0 | -4.3 | ~0 |
| b0.5 | ~0 | +3.1 | +3.3 | +3.1 | +2.3 | +1.1 | -0.5 | -1.8 | ~0 |
| b1 | ~0 | +2.5 | +1.2 | +0.8 | -1.2 | -1.9 | -3.1 | -4.8 | ~0 |
At exp 1-2 both pick BM16, and at exp 64 dev already picks BM128.
SM107 (VR200), second production NVFP4 shape, 188 SMs
SM107 already uses the SIMT pull for NVFP4, so only block_m differs between the arms.
Original PR (BM128 floor) vs dev
| route | exp 1-2 | 3 | 4 | 8 | 16 | 24 | 32 | 48 | 64 |
|---|---|---|---|---|---|---|---|---|---|
| u | ~0 | +4.8 | +4.7 | +4.8 | +4.9 | +4.6 | +4.8 | +5.3 | ~0 |
| z | ~0 | +4.7 | +4.8 | +4.9 | +2.3 | +5.6 | +1.0 | -3.4 | ~0 |
| b0.5 | ~0 | +7.9 | +5.0 | +5.0 | +2.4 | +1.2 | -0.5 | -2.5 | ~0 |
| b1 | ~0 | +4.5 | +4.3 | +3.3 | -1.7 | -3.1 | -6.9 | -8.5 | ~0 |
Reading
- The BM128 floor wins only under heavy skew at 16+ expected tokens per expert. There, hot experts exceed 64 rows, so BM64 splits them into several blocks that each re-read the expert's weights.
- At the loads decode actually runs (exp 3-16) with uniform or moderate skew, BM128 costs 1-5% on both arches.
- The original "no regression on balanced decode" check used 1024-4096 tokens/rank, where
devalready picks BM >= 128. - A skew-aware
block_mwould need real routing captures; none usable exist yet. - The SIMT pull alone is a win in every cell, so that is all this PR keeps.
🤖 Generated with Claude Code
Summary
Turn on the SIMT dispatch pull by default for NVFP4 MegaMoE on SM103 when
block_m <= 128(decode and small prefill). BM192/240 prefill keeps the TMA pull.DG_MEGA_MOE_SIMT_PULL=0/1still overrides.This PR was split out of #165 with a second change, a
block_m=128decode floor for NVFP4 on SM103/SM107. That change is now dropped: a decode sweep found it 1-5% slower than the current BM64 for uniform and moderately skewed routing on both arches (results in the comment below).Why the SIMT pull helps on SM103
Testing
dev+DG_MEGA_MOE_SIMT_PULL=1arm is the exact config this PR selects by default (DG_PRINT_CONFIGSshowsuse_simt_pull=trueat everyblock_m <= 128). An A/A arm stays within +-0.3%.🤖 Generated with Claude Code