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

Grpo loss #553

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Grpo loss #553

wants to merge 15 commits into from

Conversation

kashif
Copy link
Contributor

@kashif kashif commented Feb 1, 2025

Summary

Adds the GRPO chunked loss

fixes issue #548

Testing Done

  • Hardware Type:
  • run make test to ensure correctness
  • run make checkstyle to ensure code style
  • run make test-convergence to ensure convergence

attention_mask.view(-1)[mask_indices] = 0

# Create rewards with shape [B, num_generations]
rewards = torch.randn(B * num_generations, device=device, dtype=dtype)

Choose a reason for hiding this comment

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

If it is not too much work, would it be possible to test a scenario where the rewards are same same, i.e all 1s?

Copy link

@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, nice test.

@hongpeng-guo hongpeng-guo self-assigned this Feb 5, 2025
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.

3 participants