net: compute recv sameDevice against self, not the PXN proxyRank - #2260
Open
EylonKrause wants to merge 1 commit into
Open
net: compute recv sameDevice against self, not the PXN proxyRank#2260EylonKrause wants to merge 1 commit into
EylonKrause wants to merge 1 commit into
Conversation
The recv proxy always runs on this rank (recvSetup connects it to myInfo->rank; PXN on receive is unsupported), but sameDevice was computed from peerInfo[proxyRank], which under a graph/PXN topology can be a different intermediate rank on a different GPU. That spuriously yields sameDevice=false and disables recv-side GDRCopy SYNC/flush. The send path legitimately uses proxyRank and is left unchanged. Signed-off-by: EylonKrause <eylon1909@gmail.com>
Author
|
Disclosure: this contribution was authored with an AI coding assistant (Claude) and reviewed before submission. |
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.
Description
recvSetupconnects its proxy to the local rank —ncclProxyConnect(comm, TRANSPORT_NET, 0, myInfo->rank, &recv->proxyConn)— and the adjacent comment notes "We don't support PXN on receive yet", so the recv proxy always runs on this rank (self). Butreq.sameDeviceis computed fromproxyRank:When
graph != NULL,ncclTopoGetNetDevsetsproxyRankto a PXN intermediate rank, which can be a different rank on a different GPU. So for the receiversameDevicemay be computed against the wrong device and come out false. The recv-side gateif (ncclGdrCopy && map->sameProcess && resources->sameDevice)then skips the GDRCopy SYNC/flush mapping, defeating the optimization on PXN-capable topologies even though the recv proxy is always on the kernel's own device. (The send path legitimately connects its proxy toproxyRank, so comparing againstproxyRankis correct there.)Related Issues
None.
Changes & Impact
src/transport/net.cc(recvSetup): computesameDeviceagainst self (comm->peerInfo[myInfo->rank].cudaDev), matching where the recv proxy actually runs. The send path is unchanged. Behavior-preserving on non-PXN / single-NIC setups whereproxyRank == myInfo->rankalready; on PXN topologies it stops spuriously disabling recv-side GDRCopy. Non-breaking.Performance Impact
Re-enables recv-side GDRCopy SYNC/flush on PXN-capable multi-GPU nodes where it was being spuriously disabled — a latency improvement on that path. No change elsewhere.
Testing
make src.build;all_reduce_perfregression:Out of bounds values : 0 OK.myInfo->rank(andrecvProxyConnectrejects a remote recv proxy), so self is the correct comparison;proxyRankcan differ only via the graph/PXN path. The misgating manifests on multi-GPU / multi-NIC PXN nodes, which cannot be reproduced on a single-GPU machine.