Repository navigation
[release/2.13] [test] Reuse device meshes across FSDP2 ND-mesh subtests (#198301) - #3695
Merged
Merged
Conversation
test_2d_mlp_with_nd_mesh and test_3d_mlp_with_nd_mesh build a global mesh and pass it to their subtest helpers, but each helper overwrote it with a freshly built mesh, so every subtest created new NCCL communicators. test_shard_placement_fn_tp_ep rebuilt its meshes in every subtest even though they depend only on tp_degree and dp_replicate. On RCCL every communicator keeps a ~40 MB proxy-ops segment per rank in /dev/shm until the test's processes exit, so each of these tests exceeded a 10 GiB /dev/shm on 8 GPUs and failed with ENOSPC. Use the mesh that is passed in, and build the tp_ep meshes once per configuration. Peak /dev/shm on 8x MI300X at this commit: 2D 16.1 -> 1.3 GB, 3D 21.4 -> 1.6 GB, tp_ep 20.5 -> 8.8 GB. (cherry picked from commit a13af27)
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#198301 into
release/2.13.test_2d_mlp_with_nd_mesh and test_3d_mlp_with_nd_mesh build a global mesh
and pass it to their subtest helpers, but each helper overwrote it with a
freshly built mesh, so every subtest created new NCCL communicators.
test_shard_placement_fn_tp_ep rebuilt its meshes in every subtest even
though they depend only on tp_degree and dp_replicate.
On RCCL every communicator keeps a ~40 MB proxy-ops segment per rank in
/dev/shm until the test's processes exit, so each of these tests exceeded
a 10 GiB /dev/shm on 8 GPUs and failed with ENOSPC.
Use the mesh that is passed in, and build the tp_ep meshes once per
configuration. Peak /dev/shm on 8x MI300X at this commit:
2D 16.1 -> 1.3 GB, 3D 21.4 -> 1.6 GB, tp_ep 20.5 -> 8.8 GB.
Cherry-picked with
-xfroma13af274c73c022c92f42f7925947f960d52e12d; applied cleanly with no conflicts. Touches one file:test/distributed/_composable/fsdp/test_fully_shard_training.py(+8/-3).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.