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

🫘 Add set_seed() call in GRPO to ensure unique seed for each process #2824

Merged
merged 4 commits into from
Feb 11, 2025

Conversation

qgallouedec
Copy link
Member

Fixes the issue described in #2776 (comment)

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@mark-mcl
Copy link

this seems to also affect sampling, tried patching this and I get a different prompt on each device now

@kiddj
Copy link
Contributor

kiddj commented Feb 11, 2025

thanks! does using a different seed for each process affect training?

@qgallouedec
Copy link
Member Author

qgallouedec commented Feb 11, 2025

True @kiddj!! Fixed in 95fcfeb

Copy link
Member

@lewtun lewtun left a comment

Choose a reason for hiding this comment

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

Nice fix, and could possibly benefit from a regression test to check completions are indeed unique across devices (ignore if you want to go fast though!)

@qgallouedec
Copy link
Member Author

I've checked it locally, and yes it's now working as expected.
I'll see in a follow up PR if I can add a test for this

@qgallouedec qgallouedec merged commit 674bb75 into main Feb 11, 2025
14 checks passed
@qgallouedec qgallouedec deleted the fix-seed-grpo branch February 11, 2025 09:30
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.

6 participants