Skip to content

[Triton/Gluon] Add gfx1250 Gluon all-reduce for 4 ranks - #6923

Merged
Boss2002n merged 12 commits into
mainfrom
satya/gluon_allreduce_1250
Oct 28, 2026
Merged

Boss2002n merged 12 commits into
mainfrom
satya/gluon_allreduce_1250

Conversation

@Boss2002n

@Boss2002n Boss2002n commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

RCCL takes 7.3 us and the aiter custom all-reduce (CAR) takes 6.9 us. This PR adds a Gluon all-reduce for 4 ranks. It takes 4.8 us at 8 toks.

Benchmark:

Tokens Message Gluon RCCL CAR Speedup vs RCCL
1 4 KB 4.48 6.62 6.31 1.48x
2 8 KB 4.53 6.76 6.70 1.49x
4 16 KB 4.72 7.13 6.80 1.51x
8 32 KB 4.80 7.34 6.92 1.53x
16 64 KB 4.95 7.46 7.12 1.51x
32 128 KB 5.10 7.64 7.35 1.50x
64 256 KB 5.38 8.16 7.87 1.52x
128 512 KB 6.05 9.20 9.01 1.52x
256 1 MB 10.12 11.25 12.08 1.11x
512 2 MB 14.11 20.63 17.44 1.46x
1024 4 MB 22.54 22.71 32.09 1.01x
2048 8 MB 38.00 27.30 87.83 0.72x

@Boss2002n Boss2002n self-assigned this Oct 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

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

Extended tests (opt-in via labels):

Label Tests
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 gfx1201 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 6923 --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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Buffer aliasing can corrupt reductions, and tensor validation, timeout accounting, and CI test execution need fixes.

1 open issue
What changed in this PR

This PR adds a four-rank bf16 Gluon all-reduce for gfx1250, aimed at small tensor-parallel decode messages.

Changes:

  • Adds two communication protocols, HIP IPC scratch buffers, device-side epochs, and size-based configuration.
  • Allows the comms package to load without Iris while preserving optional Iris exports.
  • Adds multi-GPU correctness tests, a comparison benchmark, and config-layout documentation.
File Description
op_tests/​op_benchmarks/​triton/​bench_all_reduce.py Benchmarks Gluon against RCCL and CAR.
op_tests/​multigpu_tests/​triton_test/​test_all_reduce.py Tests exact results, mixed sizes, and graph replays.
aiter/​ops/​triton/​README.md Documents the comms config category.
aiter/​ops/​triton/​configs/​gfx1250/​gluon/​comms/​all_reduce/​DEFAULT.json Selects protocols and launch settings by message size.
aiter/​ops/​triton/​configs/​AGENTS.md Adds comms to the config-layout guidance.
aiter/​ops/​triton/​comms/​all_reduce.py Adds the host API, IPC setup, and resource lifecycle.
aiter/​ops/​triton/​comms/​__init__.py Makes Iris-based exports optional.
aiter/​ops/​triton/​_gluon_kernels/​gfx1250/​comms/​all_reduce.py Implements LL and simple all-reduce protocols.
aiter/​ops/​triton/​__init__.py Updates optional comms imports and availability reporting.

Review effort: Balanced

@Boss2002n
Boss2002n force-pushed the satya/gluon_allreduce_1250 branch 2 times, most recently from 153d815 to 46880f0 Compare October 26, 2026 02:47
@Boss2002n
Boss2002n force-pushed the satya/gluon_allreduce_1250 branch from 46880f0 to 1e4f3a2 Compare October 26, 2026 14:34
Removed license and copyright comments from all_reduce.py
Removed SPDX license and copyright notice from the file.
@Boss2002n
Boss2002n marked this pull request as ready for review October 26, 2026 14:42
@Boss2002n
Boss2002n requested review from a team and a balanced review from Copilot October 26, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Counter rollover, valid tensor shape handling, runtime compatibility, and test execution need correction before approval.

4 open issues
1 resolved since last review

Review effort: Balanced

Comment thread aiter/ops/triton/comms/all_reduce.py Resolved
Comment thread aiter/ops/triton/comms/all_reduce.py Resolved
Copilot AI balanced review requested due to automatic review settings October 27, 2026 17:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Counter wrap can accept stale tail data, and failed IPC initialization leaves resources allocated.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Clean up peer mappings and allocation on failure

aiter/​ops/​triton/​comms/​all_reduce.py:62

[Medium] If a peer mapping fails, this function raises without freeing the hipMalloc allocation or closing earlier peer mappings. Add exception cleanup for opened mappings and coordinate release of the owned allocation with peers.

4 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 27, 2026 20:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Counter-reset synchronization, initialization cleanup and fused-path test coverage need correction before approval.

2 open issues
3 previously missed issues

In code that hasn't changed since last review

Medium severity Rollback allocated inboxes and peer mappings on failure

aiter/​ops/​triton/​comms/​all_reduce.py:51

If a HIP call or handle exchange fails after hipMalloc, initialization exits without freeing the local inbox or closing peer mappings already opened. Add rollback cleanup for these resources before re-raising the error.

Medium severity Synchronize ranks before resetting manual counters

op_tests/​multigpu_tests/​triton_test/​test_all_reduce.py:124

The counter reset makes steps 0 and 1 both use bank 1, so a fast rank can overwrite data that a peer still reads for step 0. Synchronize each GPU and then all ranks before each manual counter reset in this loop.

Medium severity Cover additional hidden sizes and both Gemma modes

op_tests/​multigpu_tests/​triton_test/​test_all_reduce_rmsnorm_quant.py:82

The fused tests use only hidden=2048 and gemma=True, so the other accepted warp layouts and the standard RMSNorm branch have no checks. Add cases for hidden sizes such as 256, 1024 and 4096 and both Gemma modes, with a reference for each mode.

2 resolved since last review

Review effort: Balanced

Comment thread aiter/ops/triton/comms/all_reduce.py Resolved
Copilot AI balanced review requested due to automatic review settings October 27, 2026 22:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Graph replay coverage must detect stale outputs, and test placement must follow the required category layout.

2 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Move all-reduce test into wrapper-matched category

op_tests/​multigpu_tests/​triton_test/​test_all_reduce.py:139

This test is outside the wrapper-matched category required by the test layout rule. Move it to op_tests/triton_tests/comms/test_all_reduce.py, add the package initializer, and update the multi-GPU runner so it still runs on four GPUs.

Medium severity Validate results for every graph replay

op_tests/​multigpu_tests/​triton_test/​test_all_reduce_rmsnorm_quant.py:111

The graph test uses unchanged inputs and checks only the last replay, so stale results from an earlier replay can pass. Change the inputs and references before each replay, then check each replay's results.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 27, 2026 23:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The benchmark underallocates inbox storage for single-token inputs, and stale hidden-size metadata can cause valid newly allocated states to fail assertions.

3 open issues

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 28, 2026 00:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Stale _HIDDEN entries can incorrectly reject new states after tensor-address reuse, and the single-token benchmark allocates insufficient inbox capacity, causing the wrapper’s capacity check to fail.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

@azaidy azaidy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copilot AI balanced review requested due to automatic review settings October 28, 2026 05:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The stale _HIDDEN cache can reject valid tensor states after address reuse, while the fused benchmark can fail on one-token inputs or report unfused execution as fused.

2 open issues

Review effort: Balanced

Comment thread aiter/ops/triton/comms/all_reduce.py Resolved
@Boss2002n
Boss2002n merged commit c9e5826 into main Oct 28, 2026
69 of 71 checks passed
@Boss2002n
Boss2002n deleted the satya/gluon_allreduce_1250 branch October 28, 2026 12:52
vgokhale added a commit that referenced this pull request Oct 28, 2026
…ain c9e5826)

The 4-rank Gluon all-reduce and fused all-reduce + RMSNorm (+ quant) kernels
and wrappers, with their multi-GPU tests and benchmarks, as merged on main,
over the earlier versions on this branch (cab04b3). Same wrapper signatures,
so ATOM's ATOM_USE_GLUON_FUSED_ALLREDUCE_RMSNORM path takes them unchanged.

4 gfx1250 GPUs (ROCm 10.1): fused all-reduce + Gemma RMSNorm 5.5 / 5.7 / 6.0 us
at 16 / 32 / 64 tokens x 2048 (custom fused 8.3 / 8.5 / 9.2). Qwen3.5-35B-A3B
TP4 + MTP3 with ATOM_USE_GLUON_FUSED_ALLREDUCE_RMSNORM=1: 8k/1k c16 median ITL
4.92 -> 4.63 ms; MLPerf agentic c16 decode step 7.38 -> 6.87 ms.

Co-authored-by: Satya Nikhil Kodukula <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
solinzby1 pushed a commit that referenced this pull request Nov 2, 2026
lirui927 pushed a commit to lirui927/aiter that referenced this pull request Nov 16, 2026
all_reduce_rmsnorm becomes all_reduce_rmsnorm_per_token_quant, and its test
test_all_reduce_rmsnorm_per_token_quant.py. The old name is also that of the
HIP aiter.all_reduce_rmsnorm, and unlike all_reduce_rmsnorm_quant (ROCm#6923) the
op gives one scale a row, takes any hidden that is a multiple of 8 and uses the
inboxes of the plain all-reduce.

_use_gluon_ar_norm reads comm.gluon_ar_norm, which the communicator always
sets, and the communicator passes quant, the group and the inboxes by keyword.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lirui927 pushed a commit that referenced this pull request Nov 16, 2026
…launch

The all_reduce_rmsnorm epilogue of #7396, on main and without #7082. The
plain Gluon all-reduce (_all_reduce_kernel, set up on TP4 with
AITER_GLUON_FUSED_AR=1) gains an optional epilogue: residual add, RMSNorm
and optionally the per-token FP8 quant, so the call is one launch. Any
hidden that is a multiple of 8 up to 24576 works (norm_waves). At hidden
6144 the outputs are bit for bit those of the same all-reduce followed by
add_rmsnorm (and the per-token quant of its bf16 out); other sizes are
within 1 bf16 ulp or 1 FP8 code of an fp32 reference. Without the
epilogue the kernel is unchanged.

CudaCommunicator, TP4, bf16 in: all_reduce_rmsnorm takes calls up to the
4 MiB of the plain all-reduce, but only up to _GLUON_AR_NORM_MAX_TOKENS
(128) rows where the Lamport one-shot could take them, as Lamport is
faster past that. The #6923 Gluon AR + RMSNorm keeps its bf16 sizes
(power-of-2 hidden), and emit_bf16 stays on Lamport.
AITER_GLUON_AR_NORM=0 turns the new path off.

TP4 MI455X, HIP graph replay, slowest rank, hidden 6144, per call
(M1 / M16 / M64 / M128), against the Lamport kernels:
FP8 7.58 / 8.70 / 10.01 / 13.29 -> 5.74 / 6.68 / 8.09 / 11.42 us,
bf16 6.74 / 7.54 / 8.85 / 11.94 -> 5.54 / 6.24 / 7.72 / 11.10 us.
Part of wuhuikx/LLM-Booster#393.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e0fe5ee)

Conflict: aiter/dist/device_communicators/communicator_cuda.py, the same
qr_comm line as in the previous commit; kept.
lirui927 pushed a commit that referenced this pull request Nov 16, 2026
all_reduce_rmsnorm becomes all_reduce_rmsnorm_per_token_quant, and its test
test_all_reduce_rmsnorm_per_token_quant.py. The old name is also that of the
HIP aiter.all_reduce_rmsnorm, and unlike all_reduce_rmsnorm_quant (#6923) the
op gives one scale a row, takes any hidden that is a multiple of 8 and uses the
inboxes of the plain all-reduce.

_use_gluon_ar_norm reads comm.gluon_ar_norm, which the communicator always
sets, and the communicator passes quant, the group and the inboxes by keyword.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit ef3f765)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants