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
{{ message }}
Repository navigation
[HIP] perf(custom_ar): gfx1250 LL all-gather for messages up to 4 MiB a rank - #7265
On gfx1250 every custom all-gather pays a start barrier, a remote read of each peer's input and an end barrier: 12.8 us for 24 floats. The LM-head logits of a MiniMax-M3 decode step (12 x 50016 bf16 a rank at TP4) take 61 us on the 37 CTAs the last-dim kernel launches for them. An all-gather of up to 4 MiB a rank now pushes its input into the peers' existing LL scratch instead.
Dev record
Found: on MI455X, the logits gather plus the EAGLE3 drafter's three argmax gathers cost about 0.1 ms of a 5.2 ms MiniMax-M3 decode step.
Decided: ag_ll_gfx1250 shares ar_ll_gfx1250's epoch (d_ll_block_flags_) and scratch banks, so LL all-gathers and LL all-reduces can interleave. Only size and row bytes route to LL, so every rank takes the same protocol; misaligned pointers pick a byte-wise build of the kernel. Check use_ll_ag and all_gather's LL branch.
Surprised: none
Left undone: messages above 4 MiB a rank, or not in whole 8-byte packets, keep the existing kernels.
Named result
MI455X TP4, MiniMax-M3 MXFP4 with EAGLE3 (3 draft tokens), 3 requests of 4096 prompt tokens: the decode step drops from 5.226 to 5.118 ms. That is the median GPU period over 250 steps, 2 interleaved runs of each build.
Gates
op_tests/multigpu_tests/test_allgather.py at TP4 and TP2, including the new shapes and rank_offset (odd ranks' input one element in): every case err 0; c774e6a hangs on rank_offset.
The aligned build of ag_ll_gfx1250 (2, 4, 8 ranks) is instruction-identical to c774e6a's.
4-rank graph replay (20 ops a replay, 30 replays) is bit-exact against torch.cat for last-dim, dim-0 and an LL all-gather, LL AR + RMSNorm, LL all-gather sequence.
ruff, black clean.
Evidence
Per-op time on 4 x MI455X, 20 back-to-back ops captured in one graph (us an op, median of 25 replays):
all-gather
before
this PR
12 x 50016 bf16, last dim
61.1
17.0
12 x 2 fp32, dim 0
12.8
6.2
3 x 2 fp32, dim 0
12.5
6.3
1024 x 512 bf16, dim 0
37.2
12.6
LL AG, LL AR + RMSNorm (12 x 6144), LL AG
93.4
43.2
test_allgather.py, TP4, custom path, min us (dim 0 / last dim):
shape
before
this PR
(128, 7168)
39.9 / 64.5
19.8 / 19.8
(65, 7168)
26.0 / 62.7
12.6 / 12.9
(12, 50016)
29.5 / 63.1
17.0 / 16.9
(1345,), (4097, 8192) and (65, 32320) stay on the existing kernels and time the same.
… a rank
An all-gather of up to kLLArMaxBytes a rank (whole 8-byte packets, the
output clear of the input) now takes ag_ll_gfx1250: ar_ll_gfx1250's
flag-in-data publish into every peer's LL scratch, then each peer's lines
polled from this rank's scratch and written to their place along dim 0 or
the last dim. No start/end barrier and no registered copy of the input. It
shares the LL epoch and banks with the LL all-reduce kernels, so the two
interleave. AITER_CUSTOM_AR_DISABLE_LL=1 turns it off with them.
ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm
vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all
All standard extended tests (excludes ci:atom_full)
Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 7265 --add-label <label>
One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.
PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.
The LL route also required an 8-byte aligned input and output clear of each
other, checked on each rank's own pointers, so ranks passing differently
offset views picked different protocols and waited on each other. Only the
size and row bytes decide now. A rank whose input or output is not 8-byte
aligned launches the byte-wise build of the same kernel (same packets, same
flags); the aligned build's instructions are unchanged. A dim-0 gather into
the output's own slice reads in place, and any other overlap stages the
input through the copy-in buffer.
test_allgather.py: the odd ranks gather a view one element into its storage.
bf16 dim=-1 regression bypasses the custom LL dispatch path
op_tests/multigpu_tests/test_allgather.py:322
For bf16 with dim=-1, (12, 4) falls back to RCCL even with use_custom=True, so it does not test the new eight-byte-row LL path. The public dispatch requires 16-byte rows in both aiter/dist/parallel_state.py:1183–1186 and aiter/dist/device_communicators/communicator_cuda.py:867–870. Exercise the gfx1250 custom communicator directly, or update both dispatch gates for eligible LL inputs while preserving legacy restrictions, and verify that the regression selects the custom path.
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Resolve the conflict in csrc/include/custom_all_reduce_gfx1250.cuh: both
sides added new CustomAllreduce members after allreduce_ll(). Keep both,
the Lamport fused AR + RMSNorm entry points (init_lamport_ar_rms,
fused_allreduce_rmsnorm_lamport) followed by the LL all-gather ones from
#7265 (use_ll_ag, ll_ag_reads_in_place, allgather_ll), each closing its
own brace.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
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.
Ready for review. No blocking issues.
On gfx1250 every custom all-gather pays a start barrier, a remote read of each peer's input and an end barrier: 12.8 us for 24 floats. The LM-head logits of a MiniMax-M3 decode step (12 x 50016 bf16 a rank at TP4) take 61 us on the 37 CTAs the last-dim kernel launches for them. An all-gather of up to 4 MiB a rank now pushes its input into the peers' existing LL scratch instead.
Dev record
ag_ll_gfx1250sharesar_ll_gfx1250's epoch (d_ll_block_flags_) and scratch banks, so LL all-gathers and LL all-reduces can interleave. Only size and row bytes route to LL, so every rank takes the same protocol; misaligned pointers pick a byte-wise build of the kernel. Checkuse_ll_agandall_gather's LL branch.Named result
MI455X TP4, MiniMax-M3 MXFP4 with EAGLE3 (3 draft tokens), 3 requests of 4096 prompt tokens: the decode step drops from 5.226 to 5.118 ms. That is the median GPU period over 250 steps, 2 interleaved runs of each build.
Gates
op_tests/multigpu_tests/test_allgather.pyat TP4 and TP2, including the new shapes andrank_offset(odd ranks' input one element in): every case err 0; c774e6a hangs onrank_offset.ag_ll_gfx1250(2, 4, 8 ranks) is instruction-identical to c774e6a's.torch.catfor last-dim, dim-0 and an LL all-gather, LL AR + RMSNorm, LL all-gather sequence.Evidence
Per-op time on 4 x MI455X, 20 back-to-back ops captured in one graph (us an op, median of 25 replays):
test_allgather.py, TP4, custom path, min us (dim 0 / last dim):(1345,), (4097, 8192) and (65, 32320) stay on the existing kernels and time the same.
Decode step on MI455X (median of 250 steps, ms):