[WIP][Full Dtensor] Work with full dtensor fully_shard#2616
Draft
fegin wants to merge 2 commits intogh/fegin/100/basefrom
Draft
[WIP][Full Dtensor] Work with full dtensor fully_shard#2616fegin wants to merge 2 commits intogh/fegin/100/basefrom
fegin wants to merge 2 commits intogh/fegin/100/basefrom
Conversation
fegin
added a commit
that referenced
this pull request
Mar 17, 2026
**NOT READY YET** This PR is still a WIP, so code quality and design are not finalized. We publish this PR to get early signals of CIs and also verify pytorch/pytorch#176334. ghstack-source-id: fc1597e Pull-Request: #2616
fegin
added a commit
that referenced
this pull request
Mar 17, 2026
**NOT READY YET** This PR is still a WIP, so code quality and design are not finalized. We publish this PR to get early signals of CIs and also verify pytorch/pytorch#176334. ghstack-source-id: 184da4a Pull-Request: #2616
pytorchmergebot
pushed a commit
to pytorch/pytorch
that referenced
this pull request
Mar 19, 2026
…mesh (#176334) **Summary** Enable `fully_shard` to operate on models whose parameters are already DTensors distributed across a full SPMD mesh, including the data-parallel dimensions. Previously, `fully_shard` only handled the case where DP dimensions were not part of an existing DTensor mesh (which is TP or EP). This PR introduces `DataParallelMeshDims`, which lets users specify which mesh dimensions correspond to data parallelism (sharding and/or replication). The DP dimensions must carry `Replicate` placements in the original DTensor spec before `fully_shard` replaces them with `Shard`. Note that, the input/activation will also be DTensors distributed across the full SPMD mesh. **Verification** We verify this PR through unittests and TorchTitan integration: pytorch/torchtitan#2616. Pull Request resolved: #176334 Approved by: https://github.com/weifengpy
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.
Stack from ghstack (oldest at bottom):
NOT READY YET
NOT READY YET
This PR is still a WIP, so code quality and design are not finalized.
We publish this PR to get early signals of CIs and also verify pytorch/pytorch#176334.