Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a critical issue in the reinforcement learning loss computation by ensuring the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request addresses issue #4081 by modifying the compute_loss function to correctly capture the completion_mask returned by grpo_compute_loss_slow and grpo_accumulated_loss. This change ensures that the updated completion_mask, whose length is adjusted relative to the logprob tensors, is used in subsequent calculations within compute_loss. The modification is consistently applied across all relevant calls to these loss computation functions.
for more information, see https://pre-commit.ci
| flat_is_ratio, | ||
| coef_1, | ||
| completion_mask, | ||
| ) = grpo_compute_loss_slow( |
There was a problem hiding this comment.
You might want to return the mask here as well (in the function)
https://github.com/unslothai/unsloth-zoo/blob/1fb6e85080e6f5bd934d2ee957407095fc65f19c/unsloth_zoo/rl_replacements.py#L484
Edit: I see the PR https://github.com/unslothai/unsloth-zoo/pull/528/changes
Should fix this issue: #4081 essentially we changed the completion mask the compute loss function and change its length relative to the logprob tensors. Relies on: unslothai/unsloth-zoo#528.