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 gradient clipping for Sharded DDP #9168

Merged
merged 2 commits into from Dec 17, 2020
Merged

Fix gradient clipping for Sharded DDP #9168

merged 2 commits into from Dec 17, 2020

Conversation

sgugger
Copy link
Collaborator

@sgugger sgugger commented Dec 17, 2020

What does this PR do?

As mentioned in the discussion of #9156, Trainer does not do gradient clipping correctly when using a sharded optimizer. This PR fixes that, and also allows Trainer to not perform any gradient clipping (by passing None or 0 to the corresponding argument).

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for adding comments

@LysandreJik LysandreJik merged commit 77d6941 into master Dec 17, 2020
@LysandreJik LysandreJik deleted the sharded_ddp_clip branch December 17, 2020 14:44
guyrosin pushed a commit to guyrosin/transformers that referenced this pull request Jan 15, 2021
* Fix gradient clipping for Sharded DDP

* Fix typos in comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants