Skip to content

GRPO: reduce the IS ratio metric per sequence for geometric modes and the env override - #14192

Merged
danielhanchen merged 4 commits into
mainfrom
dh/fu-rl-u
Oct 19, 2026
Merged

danielhanchen merged 4 commits into
mainfrom
dh/fu-rl-u

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

The GRPO IS ratio metric was reduced per sequence only for TRL's sequence_mask / sequence_truncate modes. unsloth-zoo's geometric_* modes (verl seq_mean_k1) also give one ratio per sequence, but their metric was token-weighted. The UNSLOTH_GRPO_VLLM_IS_MODE override, which zoo's grpo_accumulated_loss applies over the config value, was ignored here too.

The new _unsloth_grpo_is_sequence_level covers sequence_* and geometric_*, and reads the env override the same way zoo does. For the TRL config-only modes the metric is the same as before. The loss itself is not touched.

Tests

tests/test_grpo_is_metrics_mask.py: 10 new cases fail on current main (helper missing, geometric modes and the env override token-weighted); all 14 pass on this branch.

…nd the UNSLOTH_GRPO_VLLM_IS_MODE override

The sampling/importance_sampling_ratio metrics treated only sequence_* as one ratio per sequence, so
unsloth_zoo's geometric_* modes (and a mode set through UNSLOTH_GRPO_VLLM_IS_MODE) were token weighted.
Config-only TRL modes are unchanged.
@danielhanchen danielhanchen self-assigned this Oct 19, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-19T16:53:06.674657Z ec7231e New commits
🔒 Security Review ⚠️ Failed 2026-10-19T04:40:37.207779Z 94c6ce7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 94c6ce7ec5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

danielhanchen added a commit that referenced this pull request Oct 19, 2026
## Summary

The `Core zoo` cells in `consolidated-tests-ci.yml` keep hitting their
25 minute job cap after the tests have already passed. In one cancelled
cell:

- the zoo `pytest -n 4` step ran from 08:41 to 09:03 and passed (3015
passed, 620 skipped),
- the job was then cancelled at 25:17 during `test_apply_fused_lm_head`
and the pip cache save.

The comment above the cap assumed a ~7.6 min zoo suite. It now takes up
to about 23 minutes on a busy runner, so the cap cancels cells that have
already passed. Today that cancelled Core zoo cells on #14152, #14165,
#14188, #14192, #14199 and #14207, and on staging runs. Each one needs a
manual rerun before the PR can merge.

This raises the cap to 35 minutes, the same as `consolidated`. Hung
tests are still bounded: `PYTEST_TIMEOUT: 300` in the step still names
the culprit per test.

## Tests

The workflow-parsing tests (`git grep -l consolidated-tests-ci --
tests`): 158 passed, 3 skipped.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@danielhanchen
danielhanchen merged commit b6f21fd into main Oct 19, 2026
@danielhanchen
danielhanchen deleted the dh/fu-rl-u branch October 19, 2026 21:03
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.

1 participant