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] Add fast path for NO_SHARD clip_grad_norm_() #89137

Closed
wants to merge 3 commits into from

Conversation

awgu
Copy link
Contributor

@awgu awgu commented Nov 16, 2022

Stack from ghstack:

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 16, 2022

🔗 Helpful Links

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

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

✅ No Failures

As of commit ab9f9de:
💚 Looks good so far! There are no failures yet. 💚

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 Nov 16, 2022
awgu added a commit that referenced this pull request Nov 16, 2022
ghstack-source-id: e5ad011e74f0dd5cf7a1e3d96db35682705aa2e1
Pull Request resolved: #89137
awgu added a commit to awgu/pytorch that referenced this pull request Nov 16, 2022
ghstack-source-id: e5ad011e74f0dd5cf7a1e3d96db35682705aa2e1
Pull Request resolved: pytorch#89137
awgu added a commit that referenced this pull request Nov 16, 2022
ghstack-source-id: df801495fc5517d7420e151ad8a5807627e1f5cc
Pull Request resolved: #89137
@awgu awgu added the topic: improvements topic category label Nov 16, 2022
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, thanks for tracking the follow up issues around improved testing!

# TODO: Gradient computation on CPU and GPU differ slightly causing
# drift unrelated to `clip_grad_norm_()`.
# https://github.com/pytorch/pytorch/issues/89133
return
Copy link
Member

Choose a reason for hiding this comment

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

A bit hacky, but would it help if we just ran DDP on CPU for this case if having this coverage is important?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does DDP work on CPU with NCCL backend?

test/distributed/fsdp/test_fsdp_clip_grad_norm.py Outdated Show resolved Hide resolved
torch/distributed/fsdp/fully_sharded_data_parallel.py Outdated Show resolved Hide resolved
awgu added a commit to awgu/pytorch that referenced this pull request Nov 16, 2022
ghstack-source-id: df801495fc5517d7420e151ad8a5807627e1f5cc
Pull Request resolved: pytorch#89137
awgu added a commit that referenced this pull request Nov 16, 2022
ghstack-source-id: 0dd6ff61ca05986e32893b082e76f4341f1af61e
Pull Request resolved: #89137
@awgu awgu added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 16, 2022
@awgu
Copy link
Contributor Author

awgu commented Nov 16, 2022

@pytorchbot merge

@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

kulinseth pushed a commit to kulinseth/pytorch that referenced this pull request Dec 10, 2022
@facebook-github-bot facebook-github-bot deleted the gh/awgu/203/head branch June 8, 2023 15:27
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 topic: improvements topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants