Repository navigation
chore(EPv2): drop redundant total_recv.zero_() on gfx1250 intranode - #735
Merged
kawhil-amd merged 1 commit intoOct 10, 2026
Merged
Conversation
The gfx1250 dispatch kernel's first-arriver unconditionally overwrites totalRecvTokenNum, so the host-side fill kernel is redundant. Gate self_resets_counters on _is1250: gfx942/950 still need the host zero because their dispatch uses atomicAdd and relies on combine to clear it. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Contributor
Author
zhangfei829
added a commit
that referenced
this pull request
Oct 11, 2026
Conflicts were all #726's selfFirst-follows-TOKOFF_EXT, which this branch already replaced with aggReserve on the same tokOffExt field; kept the branch side. #725's EP4 topk 8/9 dispatch rows are taken, and its topk 9 row is folded into the one (4, 7168, 9) key so #726's fp4 row no longer shadows it. #735 is taken: the gfx1250 dispatch still stores totalRecvTokenNum.
Merged
zhangfei829
added a commit
that referenced
this pull request
Oct 11, 2026
gfx1250 EPv2: one-RMW slot reservation, EP16 fp4 dispatch and push combine, fp8 push combine
## Summary
- Dispatch slot reservation: a rank's blocks add up their token counts and the last block reserves once per destination (one RMW on the slot word instead of one per block). Replaces selfFirst; `MORI_EP_TOKOFF_EXT=1` keeps the per-block protocol for a single-host EP.
- EP16 fp4 dispatch: 128x16 sends each destination's rows from a pinned set of warps.
- fp4 push combine: the landing offset rides the 64-bit dispatch signal, and the landing area is M x min(world, topk) rows instead of world x world x M, so EP16 push fits at 16384 tokens a rank.
- fp8 push combine (`fp8_blockwise`).
- EP16 64x16 bf16/fp8: a metadata warp holding exactly two runs loads both, then stores both. Built into those instances and chosen at run time, with no switch.
- Tuning tables: EP16 dispatch and fp4 push combine, EP4 fp8 push combine. Removed the `MORI_V2_EP_{DISP,COMB}_{BLOCKS,WARPS}` overrides.
- Merged main: #725 and #735 taken; #726's selfFirst change superseded. The duplicate `(4, 7168, 9)` dispatch key on main is folded into one, so #725's topk 9 row takes effect.
## Test
CHECK=1 passes on EP4 (topk 6 and 9), EP8 (2 hosts) and EP16 (4 hosts) at 1 / 64 / 512 / 4096 / 8192 / 8193 / 16384 tokens a rank, for fp4 push, fp4 pull, bf16 and fp8 push.
EP16 (4 hosts x 4 gfx1250), fp4 dispatch, topk 6, 96 experts/rank, HIP graph, ITERS=50, 3 alternating rounds, medians in us. The baseline has main's kernel and its untuned 64x16 geometry; main cannot allocate the fp4 push landing area at EP16 with 16384 tokens, so its combine is pull. The fp4 machine code is identical to this branch's head.
| tokens/rank | dispatch main → branch | combine main (pull) → branch (fp4 push) |
|---:|---:|---:|
| 64 | 27.39 → 26.56 | 17.95 → 16.02 |
| 512 | 38.83 → 31.66 | 50.57 → 28.33 |
| 4096 | 113.03 → 92.57 | 275.81 → 87.99 |
| 16384 | 378.46 → 292.98 | 1032.22 → 302.42 |
EP4 is about even with main: topk 9 fp4 push, same node, 3 alternating rounds, dispatch +0.1..+1.2 us, combine +0.2..+0.7 us (+2.5 at 1536).
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.
Summary
totalRecvTokenNumevery call, making the host-sidetotal_recv.zero_()fill kernel redundantself_resets_countersonself._is1250so only gfx1250 skips the zero — gfx942/950 still need it because their dispatch usesatomicAddand relies on combine to clear itTest plan
🤖 Generated with Claude Code