Skip to content

fix RMATest failure and reduce testing cost (#2002)#2002

Open
tianfengfrank wants to merge 2 commits intomainfrom
export-D100051366
Open

fix RMATest failure and reduce testing cost (#2002)#2002
tianfengfrank wants to merge 2 commits intomainfrom
export-D100051366

Conversation

@tianfengfrank
Copy link
Copy Markdown
Contributor

@tianfengfrank tianfengfrank commented Apr 8, 2026

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

@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 D100051366.

@meta-codesync meta-codesync bot changed the title increase test timeout and reduce numIter of RMA test fix RMATest failure and reduce testing cost (#2002) Apr 8, 2026
meta-codesync bot pushed a commit that referenced this pull request Apr 8, 2026
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
@meta-codesync meta-codesync bot force-pushed the export-D100051366 branch from 45db8d4 to ea9ee5d Compare April 8, 2026 21:32
meta-codesync bot pushed a commit that referenced this pull request Apr 8, 2026
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
meta-codesync bot pushed a commit that referenced this pull request Apr 8, 2026
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
tianfengfrank pushed a commit to tianfengfrank/torchcomms-1 that referenced this pull request Apr 8, 2026
Summary: Pull Request resolved: meta-pytorch#2002

Differential Revision: D100051366
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
@meta-codesync meta-codesync bot force-pushed the export-D100051366 branch from ea9ee5d to 43cabb0 Compare April 9, 2026 02:07
tianfengfrank pushed a commit to tianfengfrank/torchcomms-1 that referenced this pull request Apr 9, 2026
Summary: Pull Request resolved: meta-pytorch#2002

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#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 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 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 pushed a commit to tianfengfrank/torchcomms-1 that referenced this pull request Apr 9, 2026
Summary: Pull Request resolved: meta-pytorch#2002

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