-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[FSDP][optim_state_dict] Make FSDP.optim_state_dict compatbile with DMP #93285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
`torchrec.DistributedModelParallel` overwrites `named_parameters` and is not compatible with `FullyShardedDataParallel`'s optim_state_dict. This PR adds some workaround in `FullyShardedDataParallel` to make both work together. Differential Revision: [D42764611](https://our.internmc.facebook.com/intern/diff/D42764611/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/93285
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 8c9e355: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
`torchrec.DistributedModelParallel` overwrites `named_parameters` and is not compatible with `FullyShardedDataParallel`'s optim_state_dict. This PR adds some workaround in `FullyShardedDataParallel` to make both work together. Differential Revision: [D42764611](https://our.internmc.facebook.com/intern/diff/D42764611/) ghstack-source-id: 178786341 Pull Request resolved: #93285
…bile with DMP" `torchrec.DistributedModelParallel` overwrites `named_parameters` and is not compatible with `FullyShardedDataParallel`'s optim_state_dict. This PR adds some workaround in `FullyShardedDataParallel` to make both work together. Differential Revision: [D42764611](https://our.internmc.facebook.com/intern/diff/D42764611/) [ghstack-poisoned]
Pull Request resolved: #93285 `torchrec.DistributedModelParallel` overwrites `named_parameters` and is not compatible with `FullyShardedDataParallel`'s optim_state_dict. This PR adds some workaround in `FullyShardedDataParallel` to make both work together. ghstack-source-id: 178905353 Differential Revision: [D42764611](https://our.internmc.facebook.com/intern/diff/D42764611/)
| # overwite the flat_parameters traversal result to only obtain | ||
| # the last one, which happens to be the correct one. | ||
| # | ||
| # TODO: Remove this hack once DMP + FSDP is not supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this mean it should be removed once we've landed the composable path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If all existing use cases are migrated to the composable path, then yes, we should only support trech_shard + fully_shard but not DMP + FSDP.
…bile with DMP" `torchrec.DistributedModelParallel` overwrites `named_parameters` and is not compatible with `FullyShardedDataParallel`'s optim_state_dict. This PR adds some workaround in `FullyShardedDataParallel` to make both work together. Differential Revision: [D42764611](https://our.internmc.facebook.com/intern/diff/D42764611/) [ghstack-poisoned]
Pull Request resolved: #93285 `torchrec.DistributedModelParallel` overwrites `named_parameters` and is not compatible with `FullyShardedDataParallel`'s optim_state_dict. This PR adds some workaround in `FullyShardedDataParallel` to make both work together. ghstack-source-id: 179122189 Differential Revision: [D42764611](https://our.internmc.facebook.com/intern/diff/D42764611/)
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
The merge job was canceled. If you believe this is a mistake,then you can re trigger it through pytorch-bot. |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Stack from ghstack (oldest at bottom):
torchrec.DistributedModelParalleloverwritesnamed_parametersand is not compatible withFullyShardedDataParallel's optim_state_dict. This PR adds some workaround inFullyShardedDataParallelto make both work together.Differential Revision: D42764611