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

🛣️ inference_mode to no_grad when computing old_per_token_logps #2987

Merged
merged 2 commits into from
Feb 28, 2025

Conversation

qgallouedec
Copy link
Member

@qgallouedec qgallouedec commented Feb 28, 2025

Fixes #2953

I couldn't reproduce myself the bug, but numerous users reported that it solved the issue. AFAIK no_grad and inference_mode are mostly equivalent. The rule of thumb from the torch forum whose ref I no longer have is to prefer inference mode, and if it raises an error use no grad.

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

@qgallouedec qgallouedec changed the title inference_mode to no_grad when computing old_per_token_logps 🛣️ inference_mode to no_grad when computing old_per_token_logps Feb 28, 2025
@qgallouedec qgallouedec merged commit 491921c into main Feb 28, 2025
14 checks passed
@qgallouedec qgallouedec deleted the fix-num_generations-sup-1 branch February 28, 2025 21:58
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.

[GRPO] Gradient mode issue when num_iterations > 1
3 participants