-
Notifications
You must be signed in to change notification settings - Fork 25.5k
[DCP][DSD] Add AdamW to distributed state dict unit tests #121774
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/121774
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 0e57f15 with merge base 522d972 ( UNSTABLE - The following job failed but was likely due to flakiness present on trunk and has been marked as unstable:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
if compile_model: | ||
dist_model = torch.compile(dist_model) | ||
dist_optim = torch.optim.Adam(dist_model.parameters(), lr=1e-3) | ||
dist_optim = optimizer_class(dist_model.parameters(), lr=1e-3) |
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.
In these unit tests, are we comparing FSDP2 against a non-FSDP2 (e.g. DDP) model?
If so, maybe we need to pass foreach=True
for now to the FSDP2 optimizer to get closer numeric parity since otherwise the FSDP2 optimizer would use foreach=False
path, which is a different implementation. (just mentioning in case this might be affecting numerics here)
cc mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse H-Huang kwen2501 awgu penguinwu fegin XilunWu wanchaol fduwjj tianyu-l wconstab yf225 chauhang LucasLLC Thanks fegin for removing the fsdp root module check in DCP to unblock test updates. #121544 This PR adds "optimzer_class" as a kwarg for the subtests of the following tests to add AdamW as an option. - test_fsdp - test_compiled_fsdp - test_fsdp2 - test_ddp - test_fsdp_ddp - test_cpu_offload_full_state_dict In addition, we temporarily remove the two _verify_osd_by_load in _test_save_load, as state dict loading seems affect parameters. Creating an issue #121186 to keep track. [ghstack-poisoned]
cc mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse H-Huang kwen2501 awgu penguinwu fegin XilunWu wanchaol fduwjj tianyu-l wconstab yf225 chauhang LucasLLC Thanks fegin for removing the fsdp root module check in DCP to unblock test updates. #121544 This PR adds "optimzer_class" as a kwarg for the subtests of the following tests to add AdamW as an option. - test_fsdp - test_compiled_fsdp - test_fsdp2 - test_ddp - test_fsdp_ddp - test_cpu_offload_full_state_dict In addition, we temporarily remove the two _verify_osd_by_load in _test_save_load, as state dict loading seems affect parameters. Creating an issue #121186 to keep track. [ghstack-poisoned]
@pytorchmergebot 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):
cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @penguinwu @fegin @XilunWu @wanchaol @fduwjj @tianyu-l @wconstab @yf225 @chauhang @LucasLLC
Thanks @fegin for removing the fsdp root module check in DCP to unblock test updates. #121544
This PR adds "optimzer_class" as a kwarg for the subtests of the following tests to add AdamW as an option.
In addition, we temporarily remove the two _verify_osd_by_load in _test_save_load, as state dict loading seems affect parameters. Creating an issue #121186 to keep track.