[ring-hce-bd] Hierarchical CE: Ring implementation for better scalability. - #2299
Open
cesar-stuardo-bd wants to merge 2 commits into
Open
[ring-hce-bd] Hierarchical CE: Ring implementation for better scalability. #2299cesar-stuardo-bd wants to merge 2 commits into
cesar-stuardo-bd wants to merge 2 commits into
Conversation
Contributor
|
/mirror |
Collaborator
|
Mirroring to the internal repository failed. Please make sure this branch is rebased on the latest target branch and that every commit has a |
Signed-off-by: cesar.stuardo <cesar.stuardo@bytedance.com>
Signed-off-by: cesar.stuardo <cesar.stuardo@bytedance.com>
cesar-stuardo-bd
force-pushed
the
feat/ring-hce-bd
branch
from
July 24, 2026 17:47
cff012f to
4da8b1a
Compare
Collaborator
|
/mirror dev |
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.
cc @zhenhaohe @xiaofanl-nvidia , we can discuss improvements and iterate over this as needed. This is a component we are very interested in.
Description
Adds a ring-based implementation for Hierarchical CE AllGather.
Related Issues
The initial ncclHierCEAllGather version provided at commit id 8a07411 does not meet expectations when scaling the number of (remote) nodes. There is a heavy performance regression when comparing against the traditional CPU proxy (+ SM-based kernel).
Changes & Impact
This note documents the current retained hierarchical CE allgather implementations in
src/ce_coll.cc.src/ce_coll.ccnow contains only the retained hierarchical allgather implementations described in this note:ncclHierCeAllGather()(NV)ncclHierCeAllGatherRing()(BD)ncclHierCeAllGatherDispatch()is the active selector that chooses between those two implementations based onNCCL_ENABLE_HCE_AG_RINGCurrent Selection
NCCL_ENABLE_HCE_AG_RINGnow acts as a direct-vs-ring selector for hierarchical allgather:NCCL_ENABLE_HCE_AG_RING0or unsetncclHierCeAllGather()(NV)ncclHierCeAllGatherRing()(BD)The tuning log is correspondingly simplified:
RMA proxy + CERMA proxy ring + CEImplementation Comparison
ncclHierCeAllGather()(NV)ncclHierCeAllGatherRing()(BD)ncclProxyWaitPeersRing()fast path1 -> full1 -> fullperRankBytes >= 128 MiBandnumCtx >= 4; otherwise legacyCurrent Ring Design
The current
ncclHierCeAllGatherRing()(BD)is the currentHCE-Ring AllGatherimplementation and keeps the large-message improvements that previously lived in historicalRingV5:ncclProxyWaitPeersRing()1 -> fullcontext regime asRingV2The half-aware chunk-width rule activates only when:
perRankBytes >= 128 MiBnumCtx >= 4Below that regime, the current ring implementation uses the same legacy chunk width as the baseline ring-family path.
Why The Ring Differs From The Direct Path
The current ring implementation changes the inter-node schedule and, for large messages, changes the chunk geometry so the clockwise and counterclockwise half transfers are not too coarse.
Illustrative
numCtx = 4examples:cwBytes/ccwBytes128 MiB64 MiB/64 MiB32 MiB16 MiB24256 MiB128 MiB/128 MiB64 MiB32 MiB24512 MiB256 MiB/256 MiB64 MiB64 MiB44This keeps the small and medium regime unchanged while improving chunk geometry first in the
128 MiBto256 MiBper-rank range.Performance Impact
The table below records the benchmark results shared during this discussion. This benchmark section now compares only:
[SM] Cpu-Proxy AllGather (NVIDIA): SM-based version using CPU proxy for remote communication.[SM-Free] HCE-Direct AllGather (NVIDIA): SM-Free version developed by NVIDIA at commit8a074116f105b7febdc6761115a46e5673dbf045.[SM-Free] HCE-Ring AllGather (BD): SM-Free version developed by BD.Setup
GIN_NCONNECTIONS=4328GB/sInplace Bus Bandwidth Table (
GB/s)1K0.0100.012K0.020.010.014K0.040.040.028K0.090.080.0516K0.170.160.0932K0.340.070.1864K0.650.20.36128K1.251.250.69256K2.452.441.37512K4.584.742.651M4.799.295.252M5.4714.5210.184M9.9216.7420.128M19.9462.1236.1716M66.7894.2759.3732M123.84124.0397.5964M146.12146131.34128M252.75128.88225.35256M271.34171.11282.45512M319.64229.09322.331G370.92260.81352.782G379.37261.86369.34G382.61275.41377.428G382.87277.11380.8816G383.45276.94381.74