Skip to content

[release/2.13] [test] Reuse process groups across FSDP hybrid-shard subtests (#198302) - #3692

Merged
pragupta merged 1 commit into
release/2.13from
users/chinmaydk99/cp-198302-release-2.13
Sep 24, 2026
Merged

pragupta merged 1 commit into
release/2.13from
users/chinmaydk99/cp-198302-release-2.13

Conversation

@chinmaydk99

Copy link
Copy Markdown

Cherry-pick of pytorch#198302 into release/2.13.

TestFSDPHybridShard is a continuous test, so its 8 worker processes are
reused for every test in the class. test_fsdp_hybrid_shard_basic_setup
built a new device mesh in each subtest and test_fsdp_hybrid_shard_parity
built new HSDP process groups in each subtest.

On RCCL every communicator keeps a ~40 MB proxy-ops segment per rank in
/dev/shm until the workers exit. basic_setup left ~7 GB behind and parity
then hit ENOSPC on a 10 GiB /dev/shm, passing only on retry with fresh
workers.

Build the mesh and the HSDP groups once per test and share them across
subtests. Peak /dev/shm for the class on 8x MI300X at this commit drops
from 11.4 GB to 7.5 GB, and all tests pass on a 10 GiB /dev/shm.

Cherry-picked with -x from edef8852b9461b1b86adeaf7eac4b9726fbc4167; applied cleanly with no conflicts. Touches one file: test/distributed/fsdp/test_fsdp_hybrid_shard.py (+17/-10).

Note: the upstream PR is still open at the time of this cherry-pick. If it is squashed or rebased on merge, the SHA in the (cherry picked from ...) trailer will not exist in main — the PR link above is the stable reference for provenance.

TestFSDPHybridShard is a continuous test, so its 8 worker processes are
reused for every test in the class. test_fsdp_hybrid_shard_basic_setup
built a new device mesh in each subtest and test_fsdp_hybrid_shard_parity
built new HSDP process groups in each subtest.

On RCCL every communicator keeps a ~40 MB proxy-ops segment per rank in
/dev/shm until the workers exit. basic_setup left ~7 GB behind and parity
then hit ENOSPC on a 10 GiB /dev/shm, passing only on retry with fresh
workers.

Build the mesh and the HSDP groups once per test and share them across
subtests. Peak /dev/shm for the class on 8x MI300X at this commit drops
from 11.4 GB to 7.5 GB, and all tests pass on a 10 GiB /dev/shm.

(cherry picked from commit edef885)
@pragupta
pragupta merged commit c21b548 into release/2.13 Sep 24, 2026
3 checks passed
@pragupta
pragupta deleted the users/chinmaydk99/cp-198302-release-2.13 branch September 24, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants