feat: support CCL AllToAll - #65
Open
GordonYang1 wants to merge 1 commit into
Open
Conversation
GordonYang1
force-pushed
the
feat/support-ccl-all-to-all
branch
from
August 20, 2026 09:42
ec6caa8 to
a4ada89
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds
AllToAllsupport to the shared CCL backend abstraction by composing provider-native grouped point-to-point operations through the existing NCCL and MCCL layers for the publicinfinicclAllToAll()API. It also keeps inter-only communicators on the existing OpenMPI staging path during mixed-backend bootstrap flows, corrects the shared OpenMPI/MPICH movement path to use byte counts for all data types, defines zero-count behavior, makes the existing MPI example validate every received source block and propagate failures, and includes CCL-only plus OpenMPI-assistedAllToAllexample programs.Changes
Public API and Dispatch
infinicclAllToAll()API for configured CCL backends through generated bridge dispatch without changing its public signature.AllToAllafter validating the communicator and data type, without requiring non-null buffers or entering a backend.NotSupported.Common CCL Implementation
AllToAllimplementation using one groupedSend/Recvpair per peer, including self.size_toverflow.GroupEndafter a successfulGroupStart.Existing CCL Provider Bindings
GroupStart,GroupEnd,Send, andRecvbindings.AllToAllwith the existing NCCL and MCCL provider layers without introducing a dependency on a vendor-specificAllToAllentry point.MPI Correctness and Safety
AllToAllas a movement operation in the shared OpenMPI/MPICH implementation by usingMPI_BYTEwithcount * type_sizebytes per peer.size_tmultiplication, total-buffer-size, and MPIintcount-range checks.Examples and Validation
AllToAllexample using one shared unique ID and rank-based communicator initialization.AllToAllAPI through the OpenMPI inter communicator to distribute the native unique ID, then initializes the native CCL communicator for grouped GPU point-to-point exchange.AllToAllstatus exchange in the process-based examples.world_size * peer_bytes / time, and bus bandwidth as algorithmic bandwidth multiplied by(world_size - 1) / world_size.Platform and Backend Affected
Platform
Backend
Performance Impact
This adds GPU-native NCCL and MCCL paths for
AllToAll, avoiding the existing MPI host-staging path when a supported CCL backend and matching native communicator are available. The native implementation uses grouped point-to-point operations because neither provider exposes a vendorAllToAllentry point, while the shared MPI fallback remains host-staged with corrected byte-count handling. Other collective operations are intended to remain unchanged. The validation-log timing output is reference data rather than a quantified cross-backend performance comparison.Known Issues & Future Work
AllReduceandAllToAll; other CCL collective operations remain future work.AllToAllinherits the backend/device combinations and data type support of the existing CCL providers; this PR does not add a new provider or device integration.Send/Recvpair per peer, including self, rather than a vendor-specificAllToAllentry point. The number of point-to-point operations therefore grows linearly per rank and quadratically across the communicator.Float32payloads on the default stream. Additional data types, non-default streams, and runtime coverage on Iluvatar and Moore Threads remain future work.intrange; chunked transfers remain future work.Test Results
The implementation commit is
a4ada89dffe7b22afd595124df304efc0f5ce7ac, a single commit directly based onef4045a2d99837c75c2acd90aae57dacb83172d2. The attached evidence contains exactly 15 hash-verified canonical logs from the current commit: all 15 targets passed, withCorrect: YES17 times andCorrect: NO0 times. The extra two positive results are the additional expected validation cases in the broadcast log.All four current-commit
AllToAllpaths passed:The reported times are the rank-0 averages over 20 profiled payload calls after 2 warm-up calls. Algorithm bandwidth uses the total per-rank transfer size, and bus bandwidth applies the
(world_size - 1) / world_sizecorrection factor. The values were independently recomputed while accounting for the displayed time being rounded to three decimal places. They are included as execution evidence, not as a cross-platform performance comparison or an all-rank aggregate.AllToAlllog reports 8 target GPUs and validates all eight source blocks at every destination.Test Involved Platform
Test Involved Backend
Pure CCL (NCCL) on single-node NVIDIA:
ccl_all_reduce.log
ccl_all_to_all.log
CCL + MPI on single-node NVIDIA:
ccl_mpi_hybrid_all_reduce.log
ccl_mpi_hybrid_all_to_all.log
MPI on Heterogeneous Cluster:
mpi_all_gather.log
mpi_all_reduce.log
mpi_all_to_all.log
mpi_broadcast.log
mpi_gather.log
mpi_reduce.log
mpi_reduce_scatter.log
mpi_scatter.log
mpi_send_recv.log
Pure CCL (MCCL) on single-node MetaX:
ccl_all_reduce.log
ccl_all_to_all.log
Checklist
Title, Branch, and Commits
feat: …,fix(nccl): …).<type>/xxx-yyyy-zzzzwhere<type>matches the PR title's Conventional Commits type and words are joined with hyphens (seeCONTRIBUTING.md§Branches).CONTRIBUTING.md§Pull Requests).master— the branch is rebased cleanly on top of the currentmaster.fixup!/squash!/wipcommits remain.Scope and Design
CONTRIBUTING.md§Code/General).printf/std::cout/print(...)left behind, orTODOwithout an owner and issue link.General Code Hygiene
CONTRIBUTING.md§Code/General).CONTRIBUTING.md§Code/General).the `AllReduce` implementation) (CONTRIBUTING.md§Code/General).CONTRIBUTING.md§Code/General).CONTRIBUTING.md§Code/General; §Python).C++ Specific (if C++ files changed)
clang-format(version 16, per.github/workflows/clang-format.yml) has been run against all modified applicable files; the diff is clean.assertwith messages that include at least__FILE__,__LINE__, and__func__(CONTRIBUTING.md§C++).CONTRIBUTING.md§C++).CONTRIBUTING.md§C++).CONTRIBUTING.md§C++).CONTRIBUTING.md§C++).CONTRIBUTING.md§C++).Python Specific (if Python files changed)
ruff checkpasses cleanly on CI (see `.github/workflows/ruff.yml).ruff format --checkpasses cleanly — if not, runruff formatand commit the result.CONTRIBUTING.md§Python).pytest.skipmessages without terminal period) are honored where applicable (CONTRIBUTING.md§Python).CONTRIBUTING.md§Python).if,for, and similar control-flow statements (CONTRIBUTING.md§Python).return, except when it directly follows a control-flow statement (CONTRIBUTING.md§Python).CONTRIBUTING.md§Python).Testing
Build, CI, and Tooling
CMakeLists.txtunderif(AUTO_DETECT_DEVICES)or toif(AUTO_DETECT_BACKENDS)if applicable.clang-format.yml,ruff.yml) are green locally (or expected to be green on CI).Documentation
README.md,CONTRIBUTING.md, or inline docs updated when behavior, build flags, or developer workflow changed.!orBREAKING CHANGE:footer.Security and Safety