Skip to content

Conversation

salygin
Copy link
Contributor

@salygin salygin commented Jul 28, 2025

Context

What is the purpose of this PR? Is it to

  • add a new feature
  • fix a bug
  • update tests and/or documentation
  • other (please add here)

Please link to any issues this PR addresses.

Changelog

What are the changes made in this PR?

Test plan

Please make sure to do each of the following if applicable to your PR. If you're unsure about any one of these just ask and we will happily help. We also have a contributing page for some guidance on contributing.

  • run pre-commit hooks and linters (make sure you've first installed via pre-commit install)
  • add unit tests for any new functionality
  • update docstrings for any new or updated methods or classes
  • run unit tests via pytest tests
  • run recipe tests via pytest tests -m integration_test
  • manually run any new or modified recipes with sufficient proof of correctness
  • include relevant commands and any other artifacts in this summary (pastes of loss curves, eval results, etc.)

UX

If your function changed a public API, please add a dummy example of what the user experience will look like when calling it.
Here is a docstring example
and a tutorial example

  • I did not change any public API
  • I have added an example to docs or docstrings

Copy link

pytorch-bot bot commented Jul 28, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/2893

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 2 Pending

As of commit ffd3650 with merge base 4249bd2 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link

Hi @salygin!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@krammnic krammnic self-assigned this Jul 28, 2025
@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 28, 2025
Copy link
Collaborator

@krammnic krammnic left a comment

Choose a reason for hiding this comment

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

LGTM. It is proper way to fix this, before I will merge #2876

@krammnic krammnic merged commit 8a507ad into pytorch:main Jul 28, 2025
15 of 17 checks passed
@hammoudhasan
Copy link

By the way the issue with running (@krammnic @salygin ):

tune run --nnodes 1 --nproc_per_node 4 dev/grpo_full_finetune_distributed --config 3B_full_grpo.yaml 

Still persists. First you get an error in

./torchtune/recipes/dev/grpo_full_finetune_distributed.py

Line 649 about missing device, easily fixable with adding device=self._device.

However the second error that occurs is related to the fact that for a given sample all samples in the group have the same label hence no 2D indexing is needed.

[rank3]:   File "./torchtune/torchtune/dev/rl/rewards.py", line 302, in batched_rewards
[rank3]:     answer = answers[b][g]
[rank3]: IndexError: string index out of range

@krammnic
Copy link
Collaborator

krammnic commented Sep 4, 2025

Yes, this is a good catch.

@salygin Would you mind to open another PR? (It is a really simple fix). Only then, I will be ablw to merge my with final fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants