Skip to content

[Dist] GroupCoordinator: run the NCCL path on PyNccl, fix send/recv - #8095

Merged
TennyWang1223 merged 6 commits into
mainfrom
lingzha/group-coordinator-pynccl
Nov 24, 2026
Merged

TennyWang1223 merged 6 commits into
mainfrom
lingzha/group-coordinator-pynccl

Conversation

@ZLkanyo009

@ZLkanyo009 ZLkanyo009 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

GroupCoordinator's NCCL path now runs on the group's PyNccl communicator: all_gather when it does not take the custom kernel (including every use_custom=False call), reduce_scatter_tensor(use_custom=False), and send / recv. send / recv read a self.pynccl_comm that GroupCoordinator never sets, so they raised AttributeError on every call; they work now. torch.distributed stays the fallback for groups without a usable PyNccl communicator, for dtypes PyNccl does not carry, and while dynamo traces.

Motivation

ATOM's Qwen4Exp sequence parallelism all-gathers and reduce-scatters with GroupCoordinator.all_gather / reduce_scatter_tensor(use_custom=False), which called torch.distributed directly. ROCm/ATOM#3429 made those two calls take the TP group's PyNccl communicator itself (group.device_communicator.pynccl_comm): the same RCCL collective, on the current stream, at about half the host time per call. ATOM's maintainer asked for the routing to live in aiter instead, so ATOM can go back to the group's two calls and delete its PyNccl lookup (review: "The root cause is in aiter: GroupCoordinator.all_gather / reduce_scatter_tensor(use_custom=False) call torch.distributed directly and skip CudaCommunicator's PyNccl path. Also, GroupCoordinator.send/recv read a self.pynccl_comm that is never set.").

Changes

  • GroupCoordinator._pynccl_comm(dtype) makes the choice once for all four calls. It returns the device communicator's PyNccl communicator, or None to keep torch.distributed when:
    • dynamo is tracing (it traces torch.distributed collectives, not PyNccl's ctypes calls);
    • the group has no device communicator, PyNccl failed to initialize, or it is disabled;
    • PyNccl does not carry the dtype (fp8, bool, ...).
      The answer depends only on the group and the dtype, so every rank takes the same path.
  • ncclDataTypeEnum.supports(dtype): from_torch and supports now read one table.
  • all_gather allocates its NCCL output concatenated along dim 0 (both PyNccl and all_gather_into_tensor take that form), so a dim-0 gather needs no movedim / reshape. Other dims are transposed as before. reduce_scatter_tensor allocates with new_empty. Together these remove about 6 us of host time per dim-0 gather (measured below).
  • send / recv use _pynccl_comm; the stale pynccl_comm class annotation is removed.
  • PyNccl reads raw buffers, so the PyNccl calls take .contiguous() inputs. The torch.distributed calls are unchanged.

Not changed: CudaCommunicator's own collectives, the custom kernels, and use_custom=True calls that the custom kernel takes. Seen while reading and left alone, since this PR's paths do not reach them:

  • CudaCommunicator.reduce_scatter asserts that PyNccl exists but does not check disabled;
  • CudaCommunicator.all_gather passes a non-contiguous input to PyNccl as is;
  • all_gather(use_custom=True, dim=0) on a group without a custom all-reduce (ca_comm is None) still picks _all_gather_out_place, which asserts.

Callers on these paths in ATOM main (b7b5ec3f2):

  • Qwen4Exp sequence parallelism (bf16, int32);
  • the PP receive's all-gather in recv_tensor_dict (bf16);
  • the logits and hidden-state gathers in embed_head.py and dspark_markov_argmax.py when use_custom is False;
  • the MTP drafters' get_tp_group().all_gather(hidden_states);
  • the DCP gathers the custom kernel does not take (dcp_ops.py, the indexer's FP4 planes);
  • load-time weight gathers (linear.py, moe.py, attention_mla.py).

bf16, fp32, int32 and uint8 tensors now take PyNccl; fp8, e8m0 and fp4 tensors keep torch.distributed. ATOM's simulated TP replaces these methods on the group instance and is not affected. The SGLang and vLLM plugin code that uses the host framework's own groups is not affected either.

Performance

MI308X (gfx942), TP2, ROCm 7.2.4, torch 2.10.0+rocm7.2.4, RCCL 2.27.7. Host time per call, the median of 5 rounds of 16-call bursts (the GPU queue is drained between bursts); "cold" walks 8 MiB and runs unrelated Python between two calls. The shapes are ATOM's sequence-parallel prefill shapes for 2112 tokens. Same process, same group, same inputs; the three paths are bitwise identical on these shapes.

Call (TP2, prefill of 2112 tokens) torch.distributed (main) hot / cold ATOM#3429 direct PyNccl hot / cold this PR hot / cold
all-gather bf16 [1056, 2560], dim 0 44.0 / 80.7 us 18.3 / 44.7 us 19.8 / 49.4 us
reduce-scatter bf16 [2112, 2560], dim 0 39.5 / 71.4 us 19.6 / 48.2 us 21.9 / 55.7 us
all-gather int32 [1056, 512], dim 0 44.0 / 79.5 us 18.0 / 43.8 us 19.6 / 48.8 us

Rank 0; rank 1 is within 2.5 us. This PR costs 1.5-2.3 us (hot) more than ATOM#3429's direct call: the generic argument checks, the use_custom dispatch and _pynccl_comm (torch.compiler.is_compiling() 0.18 us, supports 0.19 us). Of the allocation change, skipping movedim + reshape on a dim-0 gather saves 4.5 us and new_empty 1.3 us over torch.empty(..., dtype=, device=) (measured in isolation).

End to end on ATOM (Qwen4Exp, TP2 on two MI308X, SGLang baa9befa38 (v0.5.22) and Native ATOM, MTP on, the issue-#576 prefix-hit TTFT protocol at c=1: input_ids, the hit prefix filled before every wave, a new tail salt per wave, the hit checked every wave, round 0 dropped). One server at a time on the same two GPUs, 2-5 sessions per path alternating between the paths, 3 or 6 counted rounds per session. The TTFT is the median over all counted rounds of a path (n rounds). Sessions of one path differ by 6-8 ms, more under load (load average 4-25; other jobs share the box). One Native ATOM#3429 session is left out: it overlapped a CPU-heavy test run of mine on the same host.

Stack ATOM aiter TTFT 8192/6080 (ms) TTFT 10240/7104 (ms) GSM8K strict MTP accept
SGLang ATOM#3429 with _pynccl reverted (the group's calls) 95d2112 (torch.distributed) 230.7 (n=9) 246.8 (n=9)
SGLang ATOM#3429 fa5ebfe15 (direct PyNccl) 95d2112 212.3 (n=21) 237.2 (n=21) 0.985 0.719
SGLang ATOM#3429 with _pynccl reverted 95d2112 + this PR 212.5 (n=18) 236.9 (n=18) 0.985 0.720
SGLang ATOM main b7b5ec3f2 95d2112 + this PR 211.8 (n=3) 239.9 (n=3) 0.985 0.722
Native ATOM#3429 with _pynccl reverted 95d2112 (torch.distributed) 393.1 (n=9) 575.7 (n=9)
Native ATOM#3429 fa5ebfe15 (direct PyNccl) 95d2112 382.0 (n=12) 557.2 (n=12) 0.985 0.725
Native ATOM#3429 with _pynccl reverted 95d2112 + this PR 378.9 (n=18) 553.2 (n=18) 0.980 0.719
Native ATOM main b7b5ec3f2 95d2112 + this PR 383.4 (n=3) 558.5 (n=3) 0.980 0.710
  • "ATOM#3429 with _pynccl reverted" is the follow-up ATOM change: _SequenceParallel back on group.all_gather / reduce_scatter_tensor(use_custom=False), which leaves those two files identical to ATOM main. With this PR it matches ATOM#3429's direct calls (-4.0 to +0.2 ms, inside the spread between sessions of one path); without it, it is 10-23 ms slower. ATOM main gets the same gain with no ATOM change.
  • GSM8K: 5-shot chat completions, limit 200, max_gen_toks=4096, until=<|im_end|>, temperature 0, concurrency 16. 0.980-0.985 everywhere; the run-to-run noise at limit 200 is about one or two questions. MTP acceptance is 0.710-0.725.

Testing

  • Unit tests added or updated
  • Performance benchmarks run (host-time numbers above come from a standalone script, not committed)
  • Tested on MI250X
  • Tested on MI300X (MI308X, gfx942)

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

No document describes which communicator these calls use.

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

None in values or signatures. Behavior a caller can notice:

  • These collectives no longer go through ProcessGroupNCCL, so its watchdog, flight recorder and the profiler's record_param_comms events do not see them (the same holds today for the all-reduces aiter runs on PyNccl).
  • A non-contiguous input now works on the PyNccl path; torch.distributed rejected it ("Tensors must be contiguous") and still does for the fallback dtypes.

PR Self-Review

Reviewed revision

e276fe4

Behavior and intent

Behavior change: GroupCoordinator.all_gather on its NCCL path (every use_custom=False call, and use_custom=True calls the custom kernel does not take), reduce_scatter_tensor(use_custom=False), send and recv run on the device communicator's PyNccl communicator when it is usable and carries the dtype. They keep torch.distributed for groups without one, for dtypes PyNccl does not carry, and while dynamo traces. Values are unchanged. send / recv raised AttributeError on every call before; they work now. A dim-0 all-gather returns its concatenated output directly.

Why the existing behavior is insufficient: torch.distributed takes about twice the host time per call (a c10d work object, events and a side stream), which shows in host-bound eager prefill. ATOM#3429 worked around it by taking the PyNccl communicator out of device_communicator in the model; ATOM's maintainer asked for the routing to be fixed in aiter, so ATOM can delete that.

Validation and unverified scope

Validated at e7dd5f1 on MI308X (gfx942), ROCm 7.2.4, torch 2.10.0+rocm7.2.4, RCCL 2.27.7. The image's aiter build (95d2112) is overlaid with the changed files: parallel_state.py there differs from main 03f9f37 only by the unrelated dcp_lse_merge method; the other changed files are identical. Reverting the change was checked by running the new tests against the unmodified 95d2112 build.

  • python3 -m pytest -q tests (the focused suite, as CI runs it): 413 passed, 2 skipped, 1 failed: test_mega_moe_gfx1250_recipe.py::test_layout, which fails the same way on the unmodified build. tests/test_group_coordinator_all_gather.py alone: 11 passed. Against the unmodified build: 9 failed, the 2 existing cases pass. All 11 mutations of the change fail at least one case: dropping the dynamo / disabled / dtype check, dropping each .contiguous(), sending the global rank to PyNccl, putting all-gather / reduce-scatter / recv back on torch.distributed, and skipping the dim != 0 transpose.
  • TP2, all default shapes and suites:
    • python3 op_tests/multigpu_tests/test_allgather.py -t 2: 58 rows, 18 of them CUDA-graph cases; every use_custom=False row is exact and never calls torch.distributed. Against the unmodified build it fails at once with NCCL path not exact or not on PyNccl.
    • python3 op_tests/multigpu_tests/test_reduce_scatter.py -t 2: custom 5, fallback 3 and nccl 3 cases, all with error 0; the nccl cases' compiled results match. Against the unmodified build, all 3 nccl cases fail: went through torch.distributed=True.
    • python3 op_tests/multigpu_tests/test_parallel_groups.py --tp 2 --dp 1: passes, including the send/recv ring. Against the unmodified build: AttributeError: 'GroupCoordinator' object has no attribute 'pynccl_comm'.
  • A standalone two-rank script (not committed) compares each call with torch.distributed called directly on the same input. 55 cases are byte-equal:
    • all-gather of bf16, fp16, fp32, int32, int64, int8, uint8, fp8 and bool, each at dims 0, 1 and -1;
    • a transposed (non-contiguous) input;
    • a use_custom=True gather on the middle dim that the custom kernel does not take;
    • reduce-scatter of bf16, fp16, fp32 and int32 on random mixed-magnitude data at dims 0, 1, 2 and -1;
    • capture and replay of both collectives under graph_capture();
    • torch.compile(fullgraph=True) of both collectives;
    • send/recv of bf16 (contiguous and transposed) and bool.
      fp8 and bool took torch.distributed; every other case took PyNccl. On the unmodified build, 5 cases fail: the non-contiguous input ("Tensors must be contiguous"), the compiled all-gather (a fake-tensor error from dynamo's all_gather_into_tensor rewrite into a (world, ...) output), and the 3 send/recv cases (AttributeError).
  • CUDA graphs on the unmodified build hit two problems that PyNccl does not have (standalone probe):
    • When a group's first use_custom=False collective happens inside capture, c10d creates its communicator during capture and fails with hipErrorStreamCaptureInvalidated.
    • While a graph that captured a c10d all-gather is alive, destroying the groups hangs.
  • ATOM end to end (TP2, SGLang and Native): see the end-to-end table above. The sequence-parallel collectives of ATOM's follow-up branch are byte-identical to ATOM#3429's direct PyNccl calls and to torch.distributed: 30 of 30 cases over 6 token counts and 5 shapes.
  • black and ruff check (ruff 0.16.0) are clean on the six files.

Unverified:

  • Only TP2. This box had two GPUs for this. The multi-GPU CI defaults (TP4 for test_allgather, TP8 for test_reduce_scatter, tp2 x dp2 for test_parallel_groups) were not run here; they need ci:multi-gpu.
  • gfx950 / gfx1250: no hardware. Nothing in the change is arch-specific.
  • Multi-node groups: not run.
  • End to end only for Qwen4Exp. The other ATOM callers listed under Changes were not run.

PR-specific question

The most important failure mode is ranks of one group taking different paths for the same collective, PyNccl on some and torch.distributed on others: the group would hang. A second one is a dtype PyNccl cannot carry reaching PyNccl (ValueError), which would break callers that gather fp8 or bool tensors today.

Evidence:

  • _pynccl_comm depends only on the group (its device communicator and that communicator's PyNccl state, the same on every rank), the dtype (the same on every rank for one collective) and dynamo tracing (a property of the code being compiled, the same on every rank).
  • The dtype check reads the same table as ncclDataTypeEnum.from_torch, so it cannot disagree with what PyNccl accepts.
  • CPU tests: each fallback (no device communicator, no PyNccl, disabled, bool, dynamo tracing) keeps torch.distributed for all four calls. On GPUs, fp8 and bool all-gathers take torch.distributed and equal it; the supported dtypes take PyNccl and equal torch.distributed byte for byte.

The output layout is the third boundary: a dim-0 gather now returns the concatenated buffer, and dims 1, 2 and -1 are still transposed. Both are checked against torch.distributed on GPUs, and dims 0, 1 and -1 against an independent expectation on CPU.

Changed op tests

  • op_tests/multigpu_tests/test_allgather.py: each case now records whether it issued a torch.distributed all-gather and whether the result equals the reference exactly. The use_custom=False cases run a second time captured in a CUDA graph. The test asserts that those cases are exact and never call torch.distributed; the eager sweep is checked before the graph sweep, since a live graph that captured a torch.distributed all-gather hangs the group's teardown. Not redundant: the file checked the custom kernel's accuracy, never asserted on the NCCL path and never ran graph mode.
  • op_tests/multigpu_tests/test_reduce_scatter.py: a new nccl suite (use_custom=False) on the fallback suite's shapes (dims 0, 1, 2) with the exact integer reference, a check that it never calls torch.distributed, and a torch.compile(fullgraph=True, backend="eager") run that must still trace and match. Not redundant: the custom and fallback suites reach CudaCommunicator.reduce_scatter, not GroupCoordinator's own use_custom=False path.
  • op_tests/multigpu_tests/test_parallel_groups.py: a send/recv ring over the TP group; each rank must hold its predecessor's input. Not redundant: nothing called GroupCoordinator.send / recv (every call raised).

The three files run with the ci:multi-gpu label. tests/test_group_coordinator_all_gather.py (not under op_tests/) runs in the focused pytest step.

cc @valarLip

ZLkanyo009 and others added 2 commits November 17, 2026 09:07
all_gather's NCCL path and reduce_scatter_tensor(use_custom=False) called
torch.distributed directly, so a caller that wanted the group's PyNccl had
to reach into device_communicator itself (ROCm/ATOM#3429). send/recv read
self.pynccl_comm, which GroupCoordinator never sets, so every call raised
AttributeError.

- GroupCoordinator._pynccl_comm(dtype) decides for all four: the device
  communicator's PyNccl when it is usable and carries the dtype, else
  torch.distributed, which is also kept while dynamo traces.
- ncclDataTypeEnum.supports(dtype) answers from the table from_torch uses.
- all_gather's NCCL output is allocated concatenated along dim 0, so dim 0
  needs no movedim/reshape; reduce_scatter_tensor allocates with new_empty.

Tests: tests/test_group_coordinator_all_gather.py (CPU) covers the routing,
each fallback and the dim layouts; the multi-GPU test_allgather,
test_reduce_scatter and test_parallel_groups check exactness, the path
taken, CUDA-graph capture, torch.compile(fullgraph=True) and send/recv.

Co-authored-by: Cursor <[email protected]>
@ZLkanyo009
ZLkanyo009 requested a review from a team November 17, 2026 09:55
@ZLkanyo009 ZLkanyo009 self-assigned this Nov 17, 2026
@ZLkanyo009 ZLkanyo009 added ci:atom ci:multi-gpu Trigger multi-GPU op tests on PR labels Nov 17, 2026
@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 8095 --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.

The focused suite runs tests/ in one process, and an earlier module sets
the default device to cuda, so torch.full() landed on the GPU while recv
allocates on the group's (CPU) device.

Co-authored-by: Cursor <[email protected]>
@aiter-bot

aiter-bot commented Nov 17, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 5dad9b284154 · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. What behavior would each changed op test fail on before this PR, and why is that coverage not already provided by an existing canonical test?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@ZLkanyo009

Copy link
Copy Markdown
Contributor Author

The MI35X Standard Tests shard 3 failure here (job: op_tests/flydsl_tests/test_flydsl_allreduce_rank_agreement.py::test_matching_ranks_build[fused], 'CustomAllreduce' object has no attribute '_is_gfx1250') also happens on main and does not come from this PR; #8117 fixes it.

@ZLkanyo009

Copy link
Copy Markdown
Contributor Author

CI status at e7dd5f1f32 (run 44061557767, two attempts). The three failing jobs do not exercise this change:

  • Multi-GPU Tests (8 GPU), MI350X: both attempts stop in the "Mori smoke test" step, before this PR's multi-GPU tests run. Only cco_sdma fails, with mori's SDMA transport error anvil.cpp:251 ERROR code: 6 on all 8 ranks; import, shmem, ep and cco_window pass. op_tests/multigpu_tests/test_mori_smoke.py uses torch.distributed and mori directly and never touches aiter.dist.GroupCoordinator. This looks like an SDMA problem on that runner pool; could a maintainer check it? The extended test_allgather / test_reduce_scatter / test_parallel_groups cases have therefore not run on 8 GPUs yet.
  • Standard Tests shard 3: op_tests/flydsl_tests/test_flydsl_allreduce_rank_agreement.py::test_matching_ranks_build[fused] fails on main too ('CustomAllreduce' object has no attribute '_is_gfx1250'); the fix is custom_all_reduce: set _dcp_merge_max_rows in __init__, not in _init_fly_rms #8117.
  • Standard Tests shard 4: op_tests/test_flydsl_mega_mhc.py segfaulted in the first attempt and passed on the re-run.

All other jobs passed, including the focused pytest tests step with tests/test_group_coordinator_all_gather.py.

cc @valarLip

@TennyWang1223

Copy link
Copy Markdown
Contributor

LGTM code-wise. Just waiting for the multi-GPU CI to actually run and pass test_allgather, test_reduce_scatter and test_parallel_groups (they're currently blocked by the unrelated Mori smoke failure), and then I'll approve.

@ZLkanyo009

Copy link
Copy Markdown
Contributor Author

@TennyWang1223 Thanks, and thanks for merging main. That merge brings in #8172, which moved the multi-GPU tests from linux-aiter-do-mi350x-dpx-8 (where the Mori SDMA smoke test kept failing) to linux-aiter-do-mi350x-8. So run 44482673330 at e276fe4ea2 should reach test_allgather, test_reduce_scatter and test_parallel_groups. I'll post their results when the job finishes. I also updated the Reviewed revision in the description to e276fe4ea2. The PR's own diff is unchanged by the merge.

@ZLkanyo009

Copy link
Copy Markdown
Contributor Author

@TennyWang1223 The multi-GPU job at e276fe4ea2 ran on linux-aiter-do-mi350x-8 this time, and the Mori smoke test passed (job 135501862715):

  • test_allgather.py: passed (39 s).
  • test_parallel_groups.py: passed.
  • test_reduce_scatter.py: did not fail, but it was cut off. The Tests step has a 120-minute limit, and the 43 multi-GPU tests that ran before it (alphabetical order) took 118.7 minutes in total, led by test_attention_a2a.py (21.8 min), test_flydsl_quick_allreduce.py (14.9 min) and test_flydsl_one_shot_allreduce.py (9.7 min). test_reduce_scatter.py started at 12:46:43, was still producing output, and the step timed out at 12:48:15.

A plain re-run would hit the same limit, since the order is the same. Could you either run test_reduce_scatter.py on its own on that runner, or raise or split the multi-GPU step's limit? The suite already uses almost all of it, so any PR that triggers the full multi-GPU set will lose the tests that sort last.

Meanwhile I'm running the three tests locally on 4× MI308X at the CI defaults where 4 GPUs allow: test_allgather TP4, test_parallel_groups tp2 × dp2, and test_reduce_scatter TP4 (its CI default is TP8). I'll post the results here.

@ZLkanyo009

Copy link
Copy Markdown
Contributor Author

@TennyWang1223 I reran the three multi-GPU tests locally at the current head. All three pass at TP4, and the TP2 controls pass too.

Setup

  • Hardware: 4× MI308X (gfx942), GPUs 0,1,4,5 of an 8-GPU node. This is not the MI350X CI runner, and the box has only 4 free GPUs, so nothing ran at TP8.
  • Code: head e276fe4ea2. Same method as the "Validated at" section: the PR's diff vs main (git diff e276fe4ea2^2 e276fe4ea2) is applied onto the image aiter (rocm/atom-dev:sglang-latest, aiter 95d2112, ROCm 7.2.4, torch 2.10.0+rocm7.2.4, RCCL 2.27.7) and put first on PYTHONPATH. The diff touches six files: aiter/dist/parallel_state.py, aiter/dist/device_communicators/pynccl_wrapper.py, op_tests/multigpu_tests/test_{allgather,parallel_groups,reduce_scatter}.py and tests/test_group_coordinator_all_gather.py. They are byte-identical to e7dd5f1; the main merge did not touch them.

Results

test command cases errors nccl cases on torch.distributed wall time
test_allgather -t 4 58 rows (36 nccl / 22 custom; 18 with CUDA graph) all err 0, all exact 0 / 58 37 s
test_parallel_groups --tp 2 --dp 2 group sizes, 5D layout, TP send/recv ring ALL PASS — 18 s
test_reduce_scatter -t 4 11 (custom 5, fallback 3, nccl 3) all max_abs_err 0; nccl compiled_equal True 0 / 3 40 s
test_allgather -t 2 (control) 58 rows, same mix all err 0, all exact 0 / 58 32 s
test_parallel_groups --tp 2 --dp 1 (control) same checks ALL PASS — 15 s
test_reduce_scatter -t 2 (control) 11, same split all max_abs_err 0; nccl compiled_equal True 0 / 3 34 s

The TP2 numbers match the earlier TP2 run in the PR description (allgather 31 s then).

On the CI timeout: test_reduce_scatter takes about 40 s at TP4 here, and test_allgather took 39 s on the MI350X runner. So it looks like the step's 120-minute budget ran out (the 43 tests before it used 118.7 min) rather than reduce_scatter hanging. Caveat: reduce_scatter was only verified up to TP4, not at the CI default of TP8.

@ZLkanyo009

Copy link
Copy Markdown
Contributor Author

@TennyWang1223 A CI note on e276fe4ea2. Shard 0 (job 135501912842) ran pytest -q tests with 498 passed and 1 failed. That failure is tests/test_ar_rmsnorm_routing.py::test_ar_norm_precedence[False-341-6152-False-True-custom_fused]: AttributeError: 'types.SimpleNamespace' object has no attribute 'should_fly_allreduce_rmsnorm' at communicator_cuda.py:501.

It is not from this PR:

The multi-GPU results are in my comments above.

@ZLkanyo009

Copy link
Copy Markdown
Contributor Author

@TennyWang1223 The current-head MI350X multi-GPU CI has now completed all three requested tests.

At 5dad9b28415419f54060e6c6031225398270cfe8, job 136110728584 on linux-aiter-do-mi350x-8 reports:

Test Result Elapsed
test_allgather.py passed 38.570 s
test_parallel_groups.py passed, including the TP send/recv ring 15.171 s
test_reduce_scatter.py passed 174.952 s

The three completion records are at 06:25:25, 07:52:04 and 07:57:23 UTC on November 20. The job and Aiter Test Gate are successful. This supersedes the earlier timeout report: reduce-scatter reached completion on this run. These are existing CI results; no new local GPU run or code change was needed for this update.

cc @valarLip

@TennyWang1223
TennyWang1223 merged commit ee51699 into main Nov 24, 2026
62 checks passed
@TennyWang1223
TennyWang1223 deleted the lingzha/group-coordinator-pynccl branch November 24, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:atom ci:multi-gpu Trigger multi-GPU op tests on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants