Repository navigation
[release/2.13] [test] Reuse process groups across FSDP hybrid-shard subtests (#198302) - #3692
Merged
Merged
Conversation
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)
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.
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
-xfromedef8852b9461b1b86adeaf7eac4b9726fbc4167; 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 inmain— the PR link above is the stable reference for provenance.