-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[FSDP] Add keep_low_precision_grads
support when CPU offloading
#86495
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/86495
Note: Links to docs will display an error until the docs builds have been completed. ✅ No Failures, 5 PendingAs of commit 5fcc277: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
ghstack-source-id: 7f7cd5b25a32452a396adeb434ae58d31b579812 Pull Request resolved: #86495
…loading" When CPU offloading, FSDP uses `_cpu_grad`, not `_saved_grad_shard`. This adds support for `keep_low_precision_grads` for that case. [ghstack-poisoned]
ghstack-source-id: 5211bbd049442bc53d7a3bd2db846b294627db72 Pull Request resolved: #86495
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.
LGTM
…loading" When CPU offloading, FSDP uses `_cpu_grad`, not `_saved_grad_shard`. This adds support for `keep_low_precision_grads` for that case. [ghstack-poisoned]
@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 |
Hey @awgu. |
…6495) (#86495) Summary: When CPU offloading, FSDP uses `_cpu_grad`, not `_saved_grad_shard`. This adds support for `keep_low_precision_grads` for that case. Pull Request resolved: #86495 Approved by: https://github.com/rohan-varma Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/af9c6bc851cfc8fba9e4c71830b783cb34d92a05 Reviewed By: seemethere Differential Revision: D40217972 Pulled By: seemethere fbshipit-source-id: 4d5b595d9246dba4237bea7ca6c27b8cebf1beff
Stack from ghstack:
backward_prefetch
default toBACKWARD_PRE
#86513 [FSDP] Changebackward_prefetch
default toBACKWARD_PRE
low_prec
prefix to param and reduce dtype varnames #86512 [FSDP] Add_low_prec
prefix to param and reduce dtype varnameskeep_low_precision_grads
support when CPU offloading #86495 [FSDP] Addkeep_low_precision_grads
support when CPU offloadingsummon_full_params(with_grads=True)
#85738 [FSDP] Add initialsummon_full_params(with_grads=True)
use_orig_params
#84911 [FSDP] Adduse_orig_params
When CPU offloading, FSDP uses
_cpu_grad
, not_saved_grad_shard
. This adds support forkeep_low_precision_grads
for that case.