migrate RMATest to meta/tests (#2017)#2017
Open
tianfengfrank wants to merge 2 commits intometa-pytorch:mainfrom
Open
migrate RMATest to meta/tests (#2017)#2017tianfengfrank wants to merge 2 commits intometa-pytorch:mainfrom
tianfengfrank wants to merge 2 commits intometa-pytorch:mainfrom
Conversation
Contributor
|
@tianfengfrank has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100051366. |
tianfengfrank
added a commit
to tianfengfrank/torchcomms-1
that referenced
this pull request
Apr 9, 2026
Summary: Pull Request resolved: meta-pytorch#2017 Pull Request resolved: meta-pytorch#2002 - the ncclx test are migrated to meta/test but RMATest has been left - this diff migrate RMATest to meta/tests shared by all ncclx version - also simplified the UT to save resources since we have similar test at Ctran level as well, e.g: - reduce kNumIters from 500 to 10 - remove winAlloc test since winRegister would be the only entry later - consolidate Put/PutSignal test case Reviewed By: MogicianWu, dolpm Differential Revision: D100051366
b3c9377 to
795b99e
Compare
tianfengfrank
added a commit
to tianfengfrank/torchcomms-1
that referenced
this pull request
Apr 9, 2026
Summary: Pull Request resolved: meta-pytorch#2017 Pull Request resolved: meta-pytorch#2002 - the ncclx test are migrated to meta/test but RMATest has been left - this diff migrate RMATest to meta/tests shared by all ncclx version - also simplified the UT to save resources since we have similar test at Ctran level as well, e.g: - reduce kNumIters from 500 to 10 - remove winAlloc test since winRegister would be the only entry later - consolidate Put/PutSignal test case Reviewed By: MogicianWu, dolpm Differential Revision: D100051366
795b99e to
bbc4f87
Compare
tianfengfrank
added a commit
to tianfengfrank/torchcomms-1
that referenced
this pull request
Apr 9, 2026
Summary: Pull Request resolved: meta-pytorch#2017 Pull Request resolved: meta-pytorch#2002 - the ncclx test are migrated to meta/test but RMATest has been left - this diff migrate RMATest to meta/tests shared by all ncclx version - also simplified the UT to save resources since we have similar test at Ctran level as well, e.g: - reduce kNumIters from 500 to 10 - remove winAlloc test since winRegister would be the only entry later - consolidate Put/PutSignal test case Reviewed By: MogicianWu, dolpm Differential Revision: D100051366
e926f00 to
01520bb
Compare
tianfengfrank
added a commit
to tianfengfrank/torchcomms-1
that referenced
this pull request
Apr 9, 2026
Summary: Pull Request resolved: meta-pytorch#2017 Pull Request resolved: meta-pytorch#2002 - the ncclx test are migrated to meta/test but RMATest has been left - this diff migrate RMATest to meta/tests shared by all ncclx version - also simplified the UT to save resources since we have similar test at Ctran level as well, e.g: - reduce kNumIters from 500 to 10 - remove winAlloc test since winRegister would be the only entry later - consolidate Put/PutSignal test case Reviewed By: MogicianWu, dolpm Differential Revision: D100051366
… core funcs and add Buffer abstraction layer
Summary:
## Motivation
AllGatherP's utility functions (`nvlCeBcast`, `copyToSelf`) are currently tightly coupled to `PersistArgs` — they take `PersistArgs&` and extract fields internally. This prevents reuse from any other context that has remote buffer metadata but not a `PersistArgs` struct.
This diff decouples these utilities by replacing the `PersistArgs&` parameter with explicit, individually-passed arguments. This is a pure refactoring with zero logic or behavior change.
## What Changed
**`CommUtils.h`:**
- `nvlCeBcast(... PersistArgs& pArgs ...)` →
`nvlCeBcast(... const vector<void*>& remoteRecvBuffs, const vector<RemoteAccessKey>& remoteAccessKeys ...)`
- `copyToSelf(... PersistArgs& pArgs ...)` →
`copyToSelf(... void* recvbuff ...)`
**`DirectImpl.cc` / `PipelineImpl.cc`:**
- Updated all call sites to pass `pArgs.remoteRecvBuffs`, `pArgs.remoteAccessKeys`, `pArgs.recvbuff` explicitly.
## Before → After (call site)
```
Before: nvlCeBcast(comm, sendBuff, sendSize, offset, pArgs, stream);
After: nvlCeBcast(comm, sendBuff, sendSize, offset,
pArgs.remoteRecvBuffs, pArgs.remoteAccessKeys,
stream);
Before: copyToSelf(comm, sendBuff, sendSize, pArgs, stream);
After: copyToSelf(comm, sendBuff, sendSize, pArgs.recvbuff, stream);
```
## Why This Enables Window-Based Reuse (Follow-up)
```
┌──────────────────────────────────────────────────┐
│ Reusable Utility Functions │
│ │
│ nvlCeBcast(remoteRecvBuffs[], accessKeys[]) │
│ copyToSelf(recvbuff) │
└────────────────┬────────────────┬────────────────┘
│ │
┌─────────┴──┐ ┌──────┴────────┐
│ Legacy AGP │ │ Window Path │
│ (existing) │ │ (follow-up) │
├────────────┤ ├───────────────┤
│ Passes: │ │ Passes: │
│ pArgs. │ │ win-> │
│ remoteRecv │ │ remWinInfo │
│ Buffs │ │ [peer]. │
│ pArgs. │ │ dataAddr │
│ remoteAccess│ │ win-> │
│ Keys │ │ remWinInfo │
│ │ │ [peer]. │
│ pArgs. │ │ dataRkey │
│ recvbuff │ │ win-> │
│ │ │ winDataPtr │
└─────────────┘ └───────────────┘
```
The follow-up diff will add a window-based execution path that calls
these same utility functions with `win->remWinInfo` data, enabling:
- Regular AG → persistent AGP conversion in graph capture mode
- SM-free CE-based allgather reusable via window API
- No duplication of the core CE broadcast and copy logic
```
┌──────────────┐ ┌──────────────┐
│ PersistArgs │ │ CtranWin │
│ (legacy) │ │ (Phase 3) │
└──────┬───────┘ └──────┬───────┘
│ │
populate Buffer populate Buffer
│ │
┌──────▼─────────────────────▼──────┐
│ Buffer (view) │
│ recvbuff, recvHdl, │
│ *remoteRecvBuffs, *remoteAccessKeys│
└──────────────┬─────────────────────┘
│
┌────────────────────┼─────────────────────┐
▼ ▼ ▼
┌─────────────────┐ ┌──────────────────┐ ┌───────────────┐
│ copyToSelf() │ │ nvlCeBcast() │ │ GPE submit() │
│ (CE → self) │ │ (CE → NVL peers)│ │ (IB put/ring) │
└─────────────────┘ └──────────────────┘ └───────────────┘
Phase 1 Phase 1 Phase 2
parameterized parameterized parameterized
```
Differential Revision: D99514784
Summary: Pull Request resolved: meta-pytorch#2017 Pull Request resolved: meta-pytorch#2002 - the ncclx test are migrated to meta/test but RMATest has been left - this diff migrate RMATest to meta/tests shared by all ncclx version - also simplified the UT to save resources since we have similar test at Ctran level as well, e.g: - reduce kNumIters from 500 to 10 - remove winAlloc test since winRegister would be the only entry later - consolidate Put/PutSignal test case Reviewed By: MogicianWu, dolpm Differential Revision: D100051366
01520bb to
33ba275
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.
Summary:
Reviewed By: MogicianWu, dolpm
Differential Revision: D100051366