Fold initNvlFabricTopologies into createCommStateXFromNcclComm and convert CommStateXTest to distributed (#2152)#2152
Open
minsii wants to merge 6 commits intometa-pytorch:mainfrom
Open
Fold initNvlFabricTopologies into createCommStateXFromNcclComm and convert CommStateXTest to distributed (#2152)#2152minsii wants to merge 6 commits intometa-pytorch:mainfrom
minsii wants to merge 6 commits intometa-pytorch:mainfrom
Conversation
Contributor
|
@minsii has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101586421. |
89df137 to
9b38de7
Compare
minsii
added a commit
to minsii/torchcomms-1
that referenced
this pull request
Apr 24, 2026
…nvert CommStateXTest to distributed (meta-pytorch#2152) Summary: Refactor CommStateX initialization to consolidate the two-step factory pattern into a single call: - Change `createCommStateXFromNcclComm` to accept `CtranComm*` instead of `IBootstrap*`, accessing bootstrap internally via `ctranComm->bootstrap_`; return `ncclResult_t` and assign `ctranComm->statex_` directly inside the function - Fold `initNvlFabricTopologies` into the factory function (moved to unnamed namespace), replacing raw NCCL C `bootstrapAllGather` with the `IBootstrap::allGather` abstraction (matching how `initRankStatesTopology` already works) - Remove outdated TODO comment about removing ncclx fields from all 3 init.cc versions - Enrich the CommStateX init log with commDesc, commHash, rank, nRanks, nLocalRanks - Convert CommStateXTest from single-rank unit test to 1x8 distributed test using real ncclComm, testing default topology, noLocal (via global hint), and vCliqueSize (via per-comm ncclx::Hints config) - DISABLED_CreateVCliqueSizeFromNcclComm: vCliqueSize uses vnode topology override which sets hostname to `vnode_node_N` and pid to -1, causing gPid collisions. Fixed in follow-up diff. Differential Revision: D101586421
2c23dab to
8f87dc6
Compare
minsii
added a commit
to minsii/torchcomms-1
that referenced
this pull request
Apr 24, 2026
…nvert CommStateXTest to distributed (meta-pytorch#2152) Summary: Pull Request resolved: meta-pytorch#2152 Refactor CommStateX initialization to consolidate the two-step factory pattern into a single call: - Change `createCommStateXFromNcclComm` to accept `CtranComm*` instead of `IBootstrap*`, accessing bootstrap internally via `ctranComm->bootstrap_`; return `ncclResult_t` and assign `ctranComm->statex_` directly inside the function - Fold `initNvlFabricTopologies` into the factory function (moved to unnamed namespace), replacing raw NCCL C `bootstrapAllGather` with the `IBootstrap::allGather` abstraction (matching how `initRankStatesTopology` already works) - Remove outdated TODO comment about removing ncclx fields from all 3 init.cc versions - Enrich the CommStateX init log with commDesc, commHash, rank, nRanks, nLocalRanks - Convert CommStateXTest from single-rank unit test to 1x8 distributed test using real ncclComm, testing default topology, noLocal (via global hint), and vCliqueSize (via per-comm ncclx::Hints config) - DISABLED_CreateVCliqueSizeFromNcclComm: vCliqueSize uses vnode topology override which sets hostname to `vnode_node_N` and pid to -1, causing gPid collisions. Fixed in follow-up diff. Differential Revision: D101586421
minsii
added a commit
to minsii/torchcomms-1
that referenced
this pull request
Apr 24, 2026
…nvert CommStateXTest to distributed (meta-pytorch#2152) Summary: Refactor CommStateX initialization to consolidate the two-step factory pattern into a single call: - Change `createCommStateXFromNcclComm` to accept `CtranComm*` instead of `IBootstrap*`, accessing bootstrap internally via `ctranComm->bootstrap_`; return `ncclResult_t` and assign `ctranComm->statex_` directly inside the function - Fold `initNvlFabricTopologies` into the factory function (moved to unnamed namespace), replacing raw NCCL C `bootstrapAllGather` with the `IBootstrap::allGather` abstraction (matching how `initRankStatesTopology` already works) - Remove outdated TODO comment about removing ncclx fields from all 3 init.cc versions - Enrich the CommStateX init log with commDesc, commHash, rank, nRanks, nLocalRanks - Convert CommStateXTest from single-rank unit test to 1x8 distributed test using real ncclComm, testing default topology, noLocal (via global hint), and vCliqueSize (via per-comm ncclx::Hints config) - DISABLED_CreateVCliqueSizeFromNcclComm: vCliqueSize uses vnode topology override which sets hostname to `vnode_node_N` and pid to -1, causing gPid collisions. Fixed in follow-up diff. Differential Revision: D101586421
321d1c3 to
6173d46
Compare
minsii
added a commit
to minsii/torchcomms-1
that referenced
this pull request
Apr 27, 2026
…nvert CommStateXTest to distributed (meta-pytorch#2152) Summary: Refactor CommStateX initialization to consolidate the two-step factory pattern into a single call: - Change `createCommStateXFromNcclComm` to accept `CtranComm*` instead of `IBootstrap*`, accessing bootstrap internally via `ctranComm->bootstrap_`; return `ncclResult_t` and assign `ctranComm->statex_` directly inside the function - Fold `initNvlFabricTopologies` into the factory function (moved to unnamed namespace), replacing raw NCCL C `bootstrapAllGather` with the `IBootstrap::allGather` abstraction (matching how `initRankStatesTopology` already works) - Remove outdated TODO comment about removing ncclx fields from all 3 init.cc versions - Enrich the CommStateX init log with commDesc, commHash, rank, nRanks, nLocalRanks - Convert CommStateXTest from single-rank unit test to 1x8 distributed test using real ncclComm, testing default topology, noLocal (via global hint), and vCliqueSize (via per-comm ncclx::Hints config) - DISABLED_CreateVCliqueSizeFromNcclComm: vCliqueSize uses vnode topology override which sets hostname to `vnode_node_N` and pid to -1, causing gPid collisions. Fixed in follow-up diff. Differential Revision: D101586421
Summary:
Remove the old colltrace fallback paths that were guarded by NCCL_COLLTRACE_USE_NEW_COLLTRACE. The new colltrace is now the only path.
Changes:
- CollTraceFunc.cc: collTraceBaselineGetHandle() now always uses the new colltrace path. Delete all old event acquisition/recording functions (collTraceAquireEvent*, collTraceRecordStartEvent, collTraceRecordEndEvent, etc.) that served the old CollTraceEvent pipeline.
- CollTraceFunc.h: Remove declarations for deleted functions. Remove CollTrace.h include.
- Delete CollTraceLegacyHandle.h/.cc (adapter from old events to ICollTraceHandle interface, no longer used).
- ctran CollTraceWrapper: Remove legacyFunc static variable, setCollTraceLegacyHandleFunc(), and the CVAR-guarded fallback in getCollTraceHandle(). Always use getNewCollTraceHandle().
- v2_27/v2_28/v2_29 param.cc: Delete initLegacyColltraceForCtran() and its call_once invocation. Remove includes for CollTraceFunc.h, CollTraceLegacyHandle.h, and ctran CollTraceWrapper.h.
- Delete old colltrace tests: CollTraceDistTest.cc (tested old colltrace with USE_NEW_COLLTRACE=0) and SlowCollReporterUT.cc (tested SlowCollReporter from old CollTrace). Equivalent coverage exists in NewCollTraceDistTest{NoLocal,Local}.cc.
- AllToAllTest.cc: Remove commented-out old colltrace dump code.
- CommWithCtranTest.cc: Remove assertion comparing old collTrace_ field.
Differential Revision: D102560243
Differential Revision: D102736360
Differential Revision: D102736358
Differential Revision: D102736359
…istributed
Summary:
Deduplicate statex gPid/host validation logic repeated across ncclx tests into a shared helper:
- Add `VerifyCommStateXHelper` class in `ctran/tests/VerifyCommStateXUtil.{h,cc}` (namespace `ctran::testing`) with `RankIdentity::local()` factory, `verifyAllHosts()`, and `verifyAllGPids()` methods
- Convert `CommStateXTest` from single-rank unit test to 1x8 distributed test using real ncclComm, testing default topology, noLocal (via global hint), and vCliqueSize (via per-comm ncclx::Hints config)
- DISABLED_CreateVCliqueSizeFromNcclComm: vCliqueSize uses vnode topology override which sets hostname to `vnode_node_N` and pid to -1, causing gPid collisions. Fixed in follow-up diff.
Differential Revision: D102739420
…nvert CommStateXTest to distributed (meta-pytorch#2152) Summary: Pull Request resolved: meta-pytorch#2152 Refactor CommStateX initialization to consolidate the two-step factory pattern into a single call: - Change `createCommStateXFromNcclComm` to accept `CtranComm*` instead of `IBootstrap*`, accessing bootstrap internally via `ctranComm->bootstrap_`; return `ncclResult_t` and assign `ctranComm->statex_` directly inside the function - Fold `initNvlFabricTopologies` into the factory function (moved to unnamed namespace), replacing raw NCCL C `bootstrapAllGather` with the `IBootstrap::allGather` abstraction (matching how `initRankStatesTopology` already works) - Remove outdated TODO comment about removing ncclx fields from all 3 init.cc versions - Enrich the CommStateX init log with commDesc, commHash, rank, nRanks, nLocalRanks - Convert CommStateXTest from single-rank unit test to 1x8 distributed test using real ncclComm, testing default topology, noLocal (via global hint), and vCliqueSize (via per-comm ncclx::Hints config) - DISABLED_CreateVCliqueSizeFromNcclComm: vCliqueSize uses vnode topology override which sets hostname to `vnode_node_N` and pid to -1, causing gPid collisions. Fixed in follow-up diff. Differential Revision: D101586421
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:
Refactor CommStateX initialization to consolidate the two-step factory pattern into a single call:
createCommStateXFromNcclCommto acceptCtranComm*instead ofIBootstrap*, accessing bootstrap internally viactranComm->bootstrap_; returnncclResult_tand assignctranComm->statex_directly inside the functioninitNvlFabricTopologiesinto the factory function (moved to unnamed namespace), replacing raw NCCL CbootstrapAllGatherwith theIBootstrap::allGatherabstraction (matching howinitRankStatesTopologyalready works)vnode_node_Nand pid to -1, causing gPid collisions. Fixed in follow-up diff.Differential Revision: D101586421