Add switch-channel NVLS cross-rank barrier - #843
Open
RJ Souza (Empyreus) wants to merge 22 commits into
Open
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
RJ Souza (Empyreus)
force-pushed
the
rjsouza/nvls-barrier
branch
from
July 17, 2026 17:41
bca12f2 to
c90bdc1
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a device-side, cross-rank barrier for NVLS (multimem) SwitchChannels and wires it through the executor and Python DSL so kernels can synchronize all ranks in an NVLS group without an O(n²) semaphore mesh.
Changes:
- Add NVLS-backed barrier state to
NvlsConnection/SwitchChanneland expose it viaSwitchChannelDeviceHandle::barrier(). - Introduce a new executor op (
MULTI_BARRIER/"gbarrier") with device-side implementation that grid-syncs then issues a single multimem arrival per rank. - Add Python DSL support (
SwitchChannel.barrier(...)) plus a single-node allgather example that uses the new barrier.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/core/switch_channel.cc | Creates an auxiliary NVLS multicast for barrier state and stamps barrier pointers onto bound SwitchChannels. |
| src/core/include/execution_kernel.hpp | Implements MULTI_BARRIER device handler (grid-converge → one multimem barrier → release). |
| src/core/include/execution_common.hpp | Adds OperationType::MULTI_BARRIER. |
| src/core/executor/execution_plan.cc | Parses "gbarrier" and maps JSON switch_channel_id into Operation.nvlsInputIndex. |
| include/mscclpp/switch_channel.hpp | Stores barrier resources on NvlsConnection and propagates them into SwitchChannel handles. |
| include/mscclpp/switch_channel_device.hpp | Adds SwitchChannelDeviceHandle::barrier() API and barrier metadata fields. |
| python/mscclpp/language/internal/types.py | Adds DSL instruction enum value for "gbarrier". |
| python/mscclpp/language/internal/operations.py | Adds GroupBarrier operation with instancing semantics collapsed onto one per-rank syncer. |
| python/mscclpp/language/internal/buffer_access.py | Treats group_barrier as an access-sequence breaker like other barriers/nops. |
| python/mscclpp/language/channel.py | Adds SwitchChannel.barrier() plus rank-view convenience wrapper and docstrings. |
| python/mscclpp/language/tests/single_node/allgather_nvls_zero_copy_barrier.py | Example program exercising the new switch-native barrier. |
Changho Hwang (chhwang)
requested changes
Jul 28, 2026
…nto rjsouza/nvls-barrier
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.
Adds a device-side cross-rank barrier built on NVLS (multimem) atomics