Skip to content

feat(nccl): add all-gather communication - #59

Merged
Ziminli merged 3 commits into
masterfrom
feat/nccl-all-gather
Sep 15, 2026
Merged

Ziminli merged 3 commits into
masterfrom
feat/nccl-all-gather

Conversation

@voltjia

@voltjia voltjia commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Implement the existing infinicclAllGather API for the NCCL backend and add the corresponding example programs.

Changes

  • Support NCCL AllGather

    • Map the generic AllGather operation directly to ncclAllGather while preserving NCCL's per-rank count and legal in-place buffer contract.
  • Examples

    • Add examples/ccl/all_gather.cc, a deterministic single-node multi-GPU example using one worker thread per GPU;
    • Add ·examples/ccl_mpi_hybrid/all_gather.cc·, which performs all_gather between global MPI-launched ranks;
    • Make the existing MPI examples/mpi/all_gather.cc example propagate validation failures through its exit status.

Platform and Backend Affected

Platform

  • CPU
  • NVIDIA GPU
  • Iluvatar GPU
  • MetaX GPU
  • Moore Threads GPU
  • Cambricon MLU
  • HYGON DCU

Backend

  • OpenMPI
  • MPICH
  • NCCL
  • MCCL

Performance Impact

  • No performance impact
  • Performance improved
  • Performance regression possible

N/A. This PR enables an existing API for NCCL and makes no performance claim.

Known Issues & Future Work

  • N/A.

Test Results

Test Involved Platform

  • CPU
  • NVIDIA GPU
  • Iluvatar GPU
  • MetaX GPU
  • Moore Threads GPU
  • Cambricon MLU
  • HYGON DCU

Test Involved Backend

  • OpenMPI
  • MPICH
  • NCCL
  • MCCL

NVIDIA NCCL + OMPI (Single Node):
ccl_mpi_hybrid_all_gather.log
ccl_mpi_hybrid_all_reduce.log
ccl_mpi_hybrid_send_recv.log

NVIDIA NCCL (Single Node):
ccl_all_gather.log
ccl_all_reduce.log
ccl_send_recv.log

Iluvatar NCCL + OMPI (Single Node):
ccl_mpi_hybrid_all_gather.log
ccl_mpi_hybrid_all_reduce.log
ccl_mpi_hybrid_send_recv.log

HYGON RCCL + OMPI (2 Nodes):
ccl_mpi_hybrid_all_gather.log
ccl_mpi_hybrid_all_reduce.log
ccl_mpi_hybrid_send_recv.log


Checklist

Title, Branch, and Commits

  • PR title follows Conventional Commits.
  • Branch name follows <type>/xxx-yyyy-zzzz where <type> matches the PR title's Conventional Commits type and words are joined with hyphens.
  • Each commit message follows Conventional Commits.
  • This small PR is a single squashable commit.
  • No stray merge commits are present; this PR is cleanly stacked on feat(nccl): add point-to-point communication #58.
  • No fixup! / squash! / wip commits remain.

Scope and Design

  • Changes are minimal and limited to NCCL AllGather and its reliable validation.
  • No dead code, commented-out blocks, debug prints, or unowned TODOs were introduced.
  • No unrelated formatting churn was introduced.
  • The existing public C API signature is unchanged; this PR provides its NCCL implementation.

General Code Hygiene

  • Comments are limited to non-obvious intent.
  • Every modified and added file ends with a trailing newline.
  • No trailing whitespace, inconsistent indentation, or mixed formatting styles remain.
  • Identifiers in comments and error messages use Markdown syntax where applicable.
  • Comments and error messages are in English.
  • Comments and error messages follow repository sentence conventions.

C++ Specific

  • Code follows the Google C++ Style Guide and the repository .clang-format.
  • clang-format version 16.0.6 passed with --dry-run --Werror.
  • No exceptions were introduced.
  • Error and warning wording follows repository conventions.
  • No constructor initializer-order issue was introduced.
  • Required blank-line conventions are satisfied.

Python Specific

N/A. This PR does not change Python files.

Testing

  • All applicable AllGather examples were built and run successfully on NVIDIA with NCCL and with the mixed OpenMPI/NCCL configuration described above.

Build, CI, and Tooling

N/A. This PR does not add a backend or device to auto-detection. The repository's C++ formatting gate was reproduced locally; hosted CI will run on the pushed branch.

Documentation

  • The new validated usage is documented by examples/ccl/all_gather.cc and this PR description.
  • No user-visible breaking change is introduced.

Security and Safety

  • No secrets, access tokens, internal URLs, customer data, or personal hardware identifiers were committed.
  • No third-party source code was added.
  • Buffer capacities and the NCCL-defined in-place offset are validated by the two-GPU example; no uninitialized reads were introduced.

@Ziminli
Ziminli force-pushed the feat/nccl-all-gather branch from 0251d7f to 3816cd5 Compare September 15, 2026 02:34
…le program

- remove communicator redispatch from the `AllGather` operation
- align CCL `AllGather` communicator validation with the existing collective style
- handle zero-element operations without requiring data buffers
- add a hybrid example for global-rank `AllGather` through InfiniCCL APIs
- add configurable element count, warmup iterations, and profiling iterations
- print clear pass/fail summaries for out-of-place and in-place all-gather modes
@Ziminli
Ziminli marked this pull request as ready for review September 15, 2026 10:16
@Ziminli
Ziminli merged commit 93857d3 into master Sep 15, 2026
2 checks passed
@Ziminli
Ziminli deleted the feat/nccl-all-gather branch September 15, 2026 10:23
@Ziminli Ziminli mentioned this pull request Sep 15, 2026
52 tasks
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.

2 participants