Skip to content

[HIP] gfx1250: Lamport inbox on the torch.symm_mem transport (cross-node TP) + opt-in one-shot all-reduce - #8015

Draft
gbyu-amd wants to merge 1 commit into
mainfrom
gyu/gfx1250-lamport-symm-oneshot
Draft

gbyu-amd wants to merge 1 commit into
mainfrom
gyu/gfx1250-lamport-symm-oneshot

Conversation

@gbyu-amd

Copy link
Copy Markdown
Contributor

Summary

On gfx1250 the Lamport inbox behind the fused all-reduce + RMSNorm and all-reduce + add kernels is set up only on the IPC transport. TP groups that span nodes use the torch.symm_mem transport, so they never get it. This PR:

  1. Builds the same inbox on the torch.symm_mem transport.
    • One symm_mem buffer per rank, of lamport_ar_rms_buffer_size_gfx1250 bytes.
    • The same init_lamport_ar_rms_gfx1250 and the same kernels as the IPC inbox.
    • A barrier after the init, so every rank's sentinel fill lands before any rank's first push.
    • It is sized by AITER_CUSTOM_AR_LAMPORT_RMS_MAX_SIZE, which is unset at TP8 by default. So nothing changes unless the env var is set.
  2. Adds an opt-in plain all-reduce on that inbox.
    • AITER_CUSTOM_AR_LAMPORT_AR_MAX_SIZE=<bytes> (default 0 = off) routes CudaCommunicator.all_reduce inputs of at most that size to lamport_ar_add with a zero addend.
    • inp + 0 rounds to inp, so the result has the plain sum's bits.
    • It is one-shot (every rank sends the whole message to every peer), so it pays only at decode sizes. Larger inputs keep their current route.

The decision is shape-only, so every rank takes the same route.

Results

TP8 across two MI455X nodes (torch.symm_mem, mori backend). bf16, CUDA graphs, slowest rank's median, us per all-reduce. "Off" is the same call through the custom all-reduce window, with #7937's two-shot in that window:

size 0.11 MiB 0.55 MiB
one-shot on the inbox (cap 1 MiB) 13.4 15.1
off 17.0 17.9

Above the 1 MiB cap both configurations take the same route (1.09 MiB: 18.8 vs 18.0 us, 2.19 MiB: 19.8 vs 19.0 us, run to run).

Test

Related: #8012 (INT4 / INT8-coded two-shot, also on the symm_mem transport), #7937, #7861 (gfx1250 Lamport all-gather).

@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter standard tests on MI35X
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the Radeon R9700 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full 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 8015 --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.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

gbyu-amd added a commit that referenced this pull request Dec 3, 2026
#8012 @ c3b4113, head 2026-11-16T06:45:00Z)

Applied as the PR diff onto the rebased 1116 tree; PR state: draft. Conflicts resolved by keeping both sides (both PRs add different opt-in routes next to each other): communicator_cuda.py (#8015 Lamport one-shot check, then this PR's INT4 two-shot check), custom_all_reduce.py (constants, both symm_mem inits, both init methods), custom_all_reduce_gfx1250.h / pybind (main's #7927 allreduce_lamport and fused AR+RMS+quant declarations kept next to this PR's q4 declarations).

(cherry picked from commit 1bb791e)

Rebase onto main 12-03: #8015 (one-shot + symm_mem inbox) is not carried: main's #7937 final builds the Lamport inbox on every transport and routes plain all-reduce itself (should_lamport_ar(inp, two_shot)). So _LAMPORT_AR_MAX_SIZE / _init_lamport_symm / should_lamport_ar / lamport_all_reduce and the communicator's one-shot branch from #8015 are left out; the symm_mem init calls main's _init_lamport_ar_rms, then this PR's _init_lamport_q4_2s(symm=True). pybind keeps main's allreduce_lamport(split=False) next to the q4 bindings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant