feat: support CCL Broadcast - #54
Open
GordonYang1 wants to merge 4 commits into
Open
GordonYang1 wants to merge 4 commits into
GordonYang1 wants to merge 4 commits into
Conversation
Broadcast
GordonYang1
force-pushed
the
feat/support-ccl-broadcast
branch
from
August 23, 2026 09:32
78a6d8c to
7c6d61b
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
Broadcastsupport to the shared CCL backend abstraction, including native bindings through the existing NCCL and MCCL provider layers for the publicinfinicclBroadcast()API and its legacy in-placeinfinicclBcast()alias. It also teachesBroadcastdispatch to follow the backend/device combination stored in the communicator for mixed-backend bootstrap flows, adds generated-bridge dependency tracking for header-only operation implementations, and includes CCL-only plus OpenMPI-assistedBroadcastexample programs covering out-of-place, in-place, and legacy broadcast flows with correctness and communication-bandwidth reporting.Changes
Public API and Dispatch
infinicclBroadcast()andinfinicclBcast()APIs for configured CCL backends through generated bridge dispatch.Broadcastaccording to the initialized backend and device stored in the supplied communicator.Common CCL Implementation
Broadcastimplementation following the existing provider-orientedAllReducestructure.NotSupportedwhen the selected provider cannot represent the requested data type.Existing CCL Provider Bindings
ncclBroadcast()andmcclBroadcast().Broadcastand the legacy in-placeBcastalias with the existing NCCL and MCCL provider layers.Bridge Generation
Examples and Validation
Broadcastexample.Broadcastexample that uses OpenMPI for rank discovery and unique-ID broadcast, then initializes a native CCL communicator for GPU data broadcast.Broadcast, in-placeBroadcast, and legacy in-placeBcastwith the last GPU rank as root.count * type_size / time, and bus bandwidth with the Broadcast correction factor of 1 for every scenario.Platform and Backend Affected
Platform
Backend
Performance Impact
This adds a GPU-native CCL path for
Broadcast, avoiding the existing MPI host-staging path when a supported CCL backend is selected. Existing MPI collectives are intended to remain unchanged.Known Issues & Future Work
AllReduce,Broadcast, and the legacyBcastalias; other CCL collective operations remain future work.Broadcastinherits the backend/device combinations and data type support of the existing CCL providers; this PR does not add a new provider or device integration.Float32payloads with the last rank as root on the default stream. Additional data types, roots, non-default streams, and runtime coverage on Iluvatar and Moore Threads remain future work.Test Results
The tested head is
7c6d61b2670a709597b0ba1a72de9e829bdc1659. Its four focused commits are rebased linearly onef4045a2d99837c75c2acd90aae57dacb83172d2. The current-commit evidence contains exactly 15 canonical logs: all 15 targets passed on the full matrix. All 23 expected validation outcomes are positive with no negative result; in the pure-NCCL log, one asynchronous NCCL INFO line split the firstCorrect:label from its immediately followingYEStoken, while the target and runner both exited successfully.Every Broadcast scenario used 1,048,576
Float32elements (4.00 MiB), 2 warm-up iterations, and 20 profiled iterations. The three values in each cell are out-of-place / in-place / legacyBcast:Algorithm bandwidth uses
count * sizeof(float) / time; Broadcast bus bandwidth uses a correction factor of 1, so it equals algorithm bandwidth. Values were independently checked against the three-decimal displayed time and are execution evidence, not a cross-platform benchmark comparison.Test Involved Platform
Test Involved Backend
Pure CCL (NCCL) on single-node NVIDIA:
ccl_all_reduce.log
ccl_broadcast.log
CCL + MPI on single-node NVIDIA:
ccl_mpi_hybrid_all_reduce.log
ccl_mpi_hybrid_broadcast.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_broadcast.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