-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[FSDP2] Added module, mp policy to fsdp_pre_all_gather
#136129
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
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/136129
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit b0ea438 with merge base c64ae60 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@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 |
I messed up the test before. The extensions were not running :/ Pull Request resolved: #136130 Approved by: https://github.com/weifengpy ghstack dependencies: #136129
) - Sometimes having access to the `MixedPrecisionPolicy` in the `fsdp_pre_all_gather` is useful. See [here](https://github.com/pytorch/ao/pull/748/files#r1760375325) in the torchao INT8 mixed precision training PR. - Sometimes having access to the owning `nn.Module` allows for using it for saving state. See [here](pytorch#114299 (comment)) for an example. The major paint point here is how to deal with backward compatibility. For now, we use `signature.inspect` to check if the user subclass follows the old vs. new signature. However, for the new signature, the `param_dtype` in the post-all-gather is redundant, as if the user needed it, the user could save it from the `mp_policy` passed in the pre-all-gather now. Pull Request resolved: pytorch#136129 Approved by: https://github.com/weifengpy
I messed up the test before. The extensions were not running :/ Pull Request resolved: pytorch#136130 Approved by: https://github.com/weifengpy ghstack dependencies: pytorch#136129
Stack from ghstack (oldest at bottom):
test_all_gather_extensions_monkey_patch#136130fsdp_pre_all_gather#136129MixedPrecisionPolicyin thefsdp_pre_all_gatheris useful. See here in the torchao INT8 mixed precision training PR.nn.Moduleallows for using it for saving state. See here for an example.The major paint point here is how to deal with backward compatibility. For now, we use
signature.inspectto check if the user subclass follows the old vs. new signature. However, for the new signature, theparam_dtypein the post-all-gather is redundant, as if the user needed it, the user could save it from themp_policypassed in the pre-all-gather now.cc @XilunWu @H-Huang @kwen2501 @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @c-p-i-o