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

[distributed] Fix early stopping and DP #254

Merged
merged 5 commits into from
Mar 28, 2023
Merged

Conversation

younesbelkada
Copy link
Collaborator

@younesbelkada younesbelkada commented Mar 27, 2023

What does this PR do?

This PR fixes an issue where the training was hanging in multi-GPU setting and using earyl stopping
In fact, in a multi-GPU setting, we need to compute the average of policykl across all GPUs, and call early stopping

I can confirm this solution worked, the way I checked was to add a print after the self.optimizer_zero_grad and forcing the coefficient to be 0 :
if policykl > 0 * self.config.target_kl:

cc @edbeeching @lvwerra

4it [00:03,  1.36it/s]early stopping successfulearly stopping successful
5it [00:04,  1.21it/s]early stopping successful

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 27, 2023

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

@lvwerra
Copy link
Member

lvwerra commented Mar 28, 2023

If it looks good for @edbeeching I am happy to merge it.

@younesbelkada
Copy link
Collaborator Author

Should have addressed the last comment by now!

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

@younesbelkada younesbelkada merged commit 237eb9c into main Mar 28, 2023
@younesbelkada younesbelkada deleted the fix-early-stopping-dp branch March 28, 2023 12:31
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

4 participants