Implement Group.split() for the ring backend - #4218
Open
erwinzhang7 wants to merge 1 commit into
Open
Conversation
erwinzhang7
force-pushed
the
ring-split
branch
from
August 13, 2026 02:02
d8052a6 to
a5e59bb
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.
Part of #3205.
RingGroup::splitthrew, somx.distributed.init().split(...)was unavailableon ring. MPI and NCCL both implement it, so this brings ring to the same contract:
key < 0(the default) means keep the parent's order.Two things made this smaller than expected.
TCPSocket::listenalready setsSO_REUSEADDRandSO_REUSEPORT, and the parent's listeningsockets are closed once
accept()returns, so a subgroup rebinds the same hostfile addresses.No port negotiation is needed.
RingGroupis constructed from the full address table, so once every rank knows every color itcan work out the subgroups by itself. The constructor was dropping that table, it is kept now.
The colors and keys rotate around the existing ring, so the connection side channel is not
involved.
RingGroupalso returns early at size one instead of trying to connect to itself, which is whata color nobody else shares produces. Collectives over a group that size are resolved in
ops.cppbefore they reach a backend.test_groupsinring_test_distributed.pyasserted that split raises. It now covers thebehaviour instead.
Verified
Ring backend on localhost at 2, 4 and 8 ranks. Beyond rank and size, every case checks an
all_suminside the subgroup to confirm the collective is carried by the subgroup and not theparent.
rank // 3)ring_test_distributed.py