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

Fix FSDP summon_full_params(..., with_grads=True) when grad precision is not fp32 #112746

Conversation

konstantinjdobler
Copy link
Contributor

Fixes #112717

I moved the torch.empty call after the conditional so that we don't need to check whether flat_param.grad is None

cc @awgu

Copy link

linux-foundation-easycla bot commented Nov 2, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: konstantinjdobler / name: Konstantin Dobler (86f9d5c)

Copy link

pytorch-bot bot commented Nov 2, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit 86f9d5c with merge base 51a3838 (image):
💚 Looks good so far! There are no failures yet. 💚

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

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.

This makes sense! Thanks for the fix.

We can land if CI is green.

@konstantinjdobler
Copy link
Contributor Author

I there still a blocker I can resolve? @awgu

@awgu
Copy link
Contributor

awgu commented Nov 13, 2023

@konstantinjdobler Really sorry about this. We can try to land (and rebase if needed).

@awgu
Copy link
Contributor

awgu commented Nov 13, 2023

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 13, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@konstantinjdobler
Copy link
Contributor Author

No worries, thanks 🚀

Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Nov 14, 2023
…on is not `fp32` (pytorch#112746)

Fixes pytorch#112717

I moved the `torch.empty` call after the conditional so that we don't need to check whether `flat_param.grad` is None

Pull Request resolved: pytorch#112746
Approved by: https://github.com/awgu
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 open source release notes: distributed (fsdp) release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FSDP summon_full_params(with_grads=True) fails when gradients are in bfloat16
4 participants