Skip to content
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] Allow MixedPrecision to skip inputs #90620

Closed
wants to merge 6 commits into from

Conversation

@pytorch-bot
Copy link

pytorch-bot bot commented Dec 10, 2022

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/90620

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 Failures

As of commit 85a007b:

The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the release notes: distributed (fsdp) release notes category label Dec 10, 2022
mrshenli added a commit that referenced this pull request Dec 10, 2022
ghstack-source-id: a6d90b935b2d22509be120e82277a5130e178572
Pull Request resolved: #90620
Copy link
Member

@rohan-varma rohan-varma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but curious what's the use case to skip inputs?

@mrshenli
Copy link
Contributor Author

Thanks @rohan-varma, one model I am working on has one forward argument, which is sensitive to precision. So have to keep it in fp32, instead of converting it to bfloat16 and convert back.

@mrshenli mrshenli added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 10, 2022
torch/distributed/fsdp/api.py Outdated Show resolved Hide resolved
@awgu awgu changed the title [FSDP] Allos MixedPrecision to skip inputs [FSDP] Allow MixedPrecision to skip inputs Dec 10, 2022
torch/distributed/fsdp/api.py Outdated Show resolved Hide resolved
Copy link
Contributor

@awgu awgu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this looks good to me. Sorry for leaving all of the comments in separate reviews instead of just one.

@awgu
Copy link
Contributor

awgu commented Dec 11, 2022

My bad for suggesting to un-default cast_forward_inputs. I did not see that it already existed in past tests.

I think you need to add a value for cast_forward_inputs in this line:

model = SaveForwardInputsModel(forward_inputs).cuda()

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 80542ad.

mrshenli added a commit to mrshenli/pytorch that referenced this pull request Dec 12, 2022
ghstack-source-id: d9e229fce99a0fc8c422aee8f80405dd21352a17
Pull Request resolved: pytorch#90620
@facebook-github-bot facebook-github-bot deleted the gh/mrshenli/355/head branch June 8, 2023 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged release notes: distributed (fsdp) release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants