Skip to content

enable window AGP in ncclx 2.28 (#2003)#2003

Open
tianfengfrank wants to merge 4 commits intomainfrom
export-D100036330
Open

enable window AGP in ncclx 2.28 (#2003)#2003
tianfengfrank wants to merge 4 commits intomainfrom
export-D100036330

Conversation

@tianfengfrank
Copy link
Copy Markdown
Contributor

@tianfengfrank tianfengfrank commented Apr 8, 2026

Summary:

Expose window based AGP via ncclx 2.28

Differential Revision: D100036330

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

meta-codesync bot commented Apr 8, 2026

@tianfengfrank has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100036330.

@meta-codesync meta-codesync bot changed the title enable window AGP in ncclx 2.28 enable window AGP in ncclx 2.28 (#2003) Apr 8, 2026
@meta-codesync meta-codesync bot force-pushed the export-D100036330 branch from 2512811 to 28bff31 Compare April 8, 2026 21:37
meta-codesync bot pushed a commit that referenced this pull request Apr 8, 2026
Summary:



Expose window based AGP via ncclx 2.28

Differential Revision: D100036330
Summary:

We need to align AGP's internal persistent request with the window API so that regular AllGather can be converted to AGP in graph capture mode (window init + dry-run exec at capture time, SM-free CE replay at execution time). In this diff, we extract `initResources` to a public func so that window AGP can directly call it

Reviewed By: dsjohns2

Differential Revision: D99514784
Summary:

The NvlEnabledTestParam test was hanging because it had two NCCL communicators alive simultaneously — and it only needed one.

How it happened: D95122239 migrated RMATest from ::testing::Test to NcclxBaseTest, which made SetUp() create a full NCCL communicator (this->comm) for every test. This was correct for RMATestParam and MultiWindowTestParam which use this->comm. But NvlEnabledTestParam never uses it — it creates its own communicator with parameterized backends (NVL+IB or IB-only). Nobody noticed the test body was now running with two active comms.

Why it hangs: After 97 prior test cycles (each creating/destroying a comm with ~54MB pinned memory across 8 ranks), the CUDA pinned memory pool is fragmented. When NvlEnabledTestParam tries to bootstrap its second comm while the fixture's comm is still alive, one or more ranks can't complete cudaHostAlloc → ncclSocketAccept blocks waiting for that rank → all ranks hang → parent process sends SIGTERM.

The fix: Override SetUp()/TearDown() in NvlEnabledTestParam to skip the unnecessary fixture comm creation. Now only one comm exists at a time, and the bootstrap completes cleanly.

NOTE: we also decrease the NumIter to save test resources. And add re_timeout to avoid false alarm.

Reviewed By: dolpm

Differential Revision: D100051366
Summary:


Enables window based AGP using the same SM-free CE+IB algorithm as the persistent AGP path, the memory registration & handler exchange is handled by window, while the core algorithm is reusing the existing AGP. The work flow is as following:
```
cudaMalloc()
      → user allocates recv buffer
           │
  ctranWinRegister()
      → register buffer with window
           │
    exchange()
      → populates remWinInfo with remote addresses and keys
           │
  allGatherWinInit()
      → pArgs.recvbuff           = win->winDataPtr
      → pArgs.recvHdl            = win->dataRegHdl
      → pArgs.remoteRecvBuffs[r] = win->remWinInfo[r].dataAddr
      → pArgs.remoteAccessKeys[r]= win->remWinInfo[r].dataRkey
      → pArgs.initialized        = true  (skip waitInit)
      → initResources()                  (allocate pipeSync)
           │
   allGatherWinExec()
      → algo->execDirect() or algo->execPipeline()
      → same code path as legacy persistent AGP
           │
   allGatherWinDestroy()
      → algo->destroy(), free resources
```

Reviewed By: dsjohns2

Differential Revision: D99771595
Summary:



Expose window based AGP via ncclx 2.28

Differential Revision: D100036330
@meta-codesync meta-codesync bot force-pushed the export-D100036330 branch from 28bff31 to e18b44e Compare April 8, 2026 21:37
tianfengfrank added a commit to tianfengfrank/torchcomms-1 that referenced this pull request Apr 9, 2026
Summary:
Pull Request resolved: meta-pytorch#2003

- Expose window based AGP via ncclx
- add UT for testing

Differential Revision: D100036330
tianfengfrank pushed a commit to tianfengfrank/torchcomms-1 that referenced this pull request Apr 9, 2026
Summary:
Pull Request resolved: meta-pytorch#2003

Expose window based AGP via ncclx 2.28

Differential Revision: D100036330
tianfengfrank added a commit to tianfengfrank/torchcomms-1 that referenced this pull request Apr 9, 2026
Summary:
Pull Request resolved: meta-pytorch#2018

Pull Request resolved: meta-pytorch#2003

- Expose window based AGP via ncclx
- add UT for testing

Differential Revision: D100036330
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