Skip to content

migrate RMATest to meta/tests (#2017)#2017

Open
tianfengfrank wants to merge 2 commits intometa-pytorch:mainfrom
tianfengfrank:export-D100051366
Open

migrate RMATest to meta/tests (#2017)#2017
tianfengfrank wants to merge 2 commits intometa-pytorch:mainfrom
tianfengfrank:export-D100051366

Conversation

@tianfengfrank
Copy link
Copy Markdown
Contributor

@tianfengfrank tianfengfrank commented Apr 9, 2026

Summary:

  • 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

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 9, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Apr 9, 2026

@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
@meta-codesync meta-codesync bot changed the title migrate RMATest to meta/tests (#2002) migrate RMATest to meta/tests (#2017) Apr 9, 2026
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
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
@tianfengfrank tianfengfrank force-pushed the export-D100051366 branch 2 times, most recently from e926f00 to 01520bb Compare April 9, 2026 22:24
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
Feng Tian and others added 2 commits April 9, 2026 16:47
… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant