-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[FSDP()][13/N] Refactor unshard/reshard/grads #87926
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/87926
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit d827723: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR is not too complicated. We just move unshard/reshard/grads out to `_runtime_utils.py` and make them take `state: _State` instead of `self`. [ghstack-poisoned]
This PR is not too complicated. We just move unshard/reshard/grads out to `_runtime_utils.py` and make them take `state: _State` instead of `self`. [ghstack-poisoned]
ghstack-source-id: 019c863 Pull Request resolved: pytorch#87926
This PR is not too complicated. We just move unshard/reshard/grads out to `_runtime_utils.py` and make them take `state: _State` instead of `self`. [ghstack-poisoned]
This PR is not too complicated. We just move unshard/reshard/grads out to `_runtime_utils.py` and make them take `state: _State` instead of `self`. [ghstack-poisoned]
ghstack-source-id: 7b33348 Pull Request resolved: pytorch#87926
|
@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 |
This PR is not too complicated. We just move unshard/reshard/grads out to `_runtime_utils.py` and make them take `state: _State` instead of `self`. Pull Request resolved: pytorch#87926 Approved by: https://github.com/mrshenli
This PR is not too complicated. We just move unshard/reshard/grads out to `_runtime_utils.py` and make them take `state: _State` instead of `self`. Pull Request resolved: pytorch#87926 Approved by: https://github.com/mrshenli
Stack from ghstack:
unflat_param_name->fqnfor consistency #88123 [FSDP] Renameunflat_param_name->fqnfor consistency_get_buffer_names()#88122 [FSDP] Simplify_get_buffer_names()torch.no_grad()context when offloading to CPU #88121 [FSDP] Remove unneededtorch.no_grad()context when offloading to CPU_lazy_init()into_fsdp_root_pre_forward()#87941 [FSDP()][26/N] Move_lazy_init()into_fsdp_root_pre_forward()_post_forward_reshard()#87940 [FSDP()][25/N] Add_post_forward_reshard()_lazy_init()#87939 [FSDP()][24/N] Refactor_lazy_init()_reset_lazy_init()#87937 [FSDP] Simplify_reset_lazy_init()_cast_buffers()in_lazy_init()#87936 [FSDP()][22/N] Refactor_cast_buffers()in_lazy_init()_cast_buffers()#87935 [FSDP()][21/N] Refactor_buffer_name_to_orig_dtypecomputationdtypetobuffer_name_to_dtype#87934 [FSDP] Renamedtypetobuffer_name_to_dtypedevicearg from_cast_buffers()#87933 [FSDP] Removedevicearg from_cast_buffers()pre_forward_unshard()#87931 [FSDP()][18/N] Refactorpre_forward_unshard()_fsdp_root_pre_forward()#87930 [FSDP()][17/N] Refactor_fsdp_root_pre_forward()_init_streams()#87928 [FSDP()][15/N] Refactor_init_streams()This PR is not too complicated. We just move unshard/reshard/grads out to
_runtime_utils.pyand make them takestate: _Stateinstead ofself.