-
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
Make input casting in root module only in default #91365
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/91365
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 FailuresAs of commit 8fa7531: FLAKY - The following jobs failed but were likely due to flakiness present on master:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
Overall, the PR looks good to me. I left a few nits about clarifying comments, and also we should fix the cast_root_foward_inputs
typo by changing to cast_root_forward_inputs
.
Feel free to re-request review when ready.
0a861cc
to
0b0a7dd
Compare
@zhaojuanmao has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
0b0a7dd
to
8fa7531
Compare
@zhaojuanmao has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
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!
FSDP(FSDP(model.c2, MixedPrecision(param_dtype=torch.float16, cast_forward_inputs=True)), | ||
model.c1, MixedPrecision(param_dtype=torch.bfloat16, cast_forward_inputs=True)), | ||
model.c1 should be the first one executed, so that its inputs could be casted | ||
as expected inside the root FSDP instance.see examples in unit tests |
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.
I am not sure if we want to reference the unit tests like this from public docs since (1) users should not need to dig into our unit tests to understand the note and (2) the unit test may change without us remembering to change this public note.
We do not need to change address this in this PR. I can submit a follow-up if you do not mind, or you can do it as well.
@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 |
Merge failedReason: 2 additional jobs have failed, first few of them are: trunk ,trunk / linux-focal-rocm5.3-py3.8 / test (default, 1, 2, linux.rocm.gpu) Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge -f "failures are not related" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Make input casting in root module only in default, meanwhile allowing to set different mixed precisions for different submodules