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

[core] Add max_grad_norm support #177

Merged
merged 2 commits into from
Feb 28, 2023

Conversation

younesbelkada
Copy link
Contributor

@younesbelkada younesbelkada commented Feb 27, 2023

What does this PR do?

This PR adds the support of clipping gradients norm, that was not supported before but implemented in other frameworks such as clean RL: https://github.com/vwxyzjn/cleanrl/blob/2e41da2a3649c50f27121d74896110fe8f69dd52/cleanrl/ppo.py#L286

This PR also adds a nice test

I can confirm multi-GPU training works with this PR (ran 1 PPO step of gpt2-sentiment with 2 GPU)

cc @edbeeching @lvwerra @natolambert

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Feb 27, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@edbeeching edbeeching 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.

Copy link
Member

@lvwerra lvwerra 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 adding @younesbelkada!

@younesbelkada younesbelkada merged commit 8855022 into huggingface:main Feb 28, 2023
@younesbelkada younesbelkada deleted the add-grad-clipping branch February 28, 2023 09:52
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.

4 participants