Skip to content

GRPO kept-set refusals: stop saying UNSLOTH_GRPO_TRUNCATED_SUPPORT=1 was set - #15307

Merged
danielhanchen merged 3 commits into
mainfrom
grpo-truncated-support-wording
Oct 26, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
grpo-truncated-support-wording

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Since unslothai/unsloth-zoo#2084, kept-set scoring (UNSLOTH_GRPO_TRUNCATED_SUPPORT) turns on automatically when truncated vLLM rollouts (top_k / top_p / min_p) feed TRL's IS correction or off-policy mask. Unsloth refuses kept-set scoring when the scored policy is not the sampler:

  • a reference model (beta != 0);
  • reused or buffered rollouts;
  • a skipped vLLM weight sync.

Those refusals still said Unsloth: ignoring UNSLOTH_GRPO_TRUNCATED_SUPPORT=1 because .... That now fires for users who never set the variable, and tells them they set something they did not.

Change (unsloth/models/rl_replacements.py)

  • Both refusal warnings now start with Unsloth: not scoring over the rollouts' top_k / top_p / min_p kept set. They name the variable as =1, or automatic for truncated vLLM rollouts feeding the IS correction or off-policy mask, then give the reason as before.
  • One comment and one docstring that still called the setting opt-in are updated.
  • No behaviour change: the same conditions refuse, and they fall back to the full vocabulary as before.

Tests

  • New test_refusals_do_not_claim_the_variable_was_set in tests/test_grpo_truncated_support_policy_gate.py. With the variable unset, it runs both refusal paths (reference model, skipped sync) and checks that neither message claims =1 was set. It fails on main and passes here.
  • All tests/test_*grpo*.py CPU tests:
    • main: 2 failed, 451 passed, 37 skipped;
    • this PR: 1 failed, 452 passed, 37 skipped.
    • The remaining failure, test_grpo_sample_weight.py::test_group_with_one_scored_completion_is_kept, is the same on both and is unrelated to this change.

…was set

unsloth-zoo now turns kept-set scoring on automatically for truncated vLLM
rollouts that feed the IS correction or off-policy mask, so the refusals for a
reference model, reused rollouts or a skipped weight sync can fire with the
variable unset. They now say the trainer is not scoring over the kept set and
why, without claiming the user set =1. Adds a test that fails on main.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 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 ✅ Completed 2026-10-26T03:13:28.506543Z a8c7af4 Manual request
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 73ca56627e

ℹ️ 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

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: a8c7af41bb

ℹ️ 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 26, 2026
…ugh its aliases (#15319)

## Problem

`Repo tests (CPU, studio)` is red on main since #15233, so every PR
based on it fails the same check (for example #15306 and #15307):

```
tests/studio/test_model_picker_contracts.py::test_a_multi_quant_parent_row_still_has_no_gear
E   AssertionError: the multi-quant parent row lost the spacer that stands in for a gear
```

#15233 replaced the empty gutter spacer on an On Device multi-quant
parent row with a chevron in the same column, wrapped in
`ROW_ACTIONS_PINNED_CLASS`, which is `cn(ROW_ACTIONS_CLASS,
"opacity-100")`. The guard only accepted the literal name
`ROW_ACTIONS_CLASS`, so it read the renamed reference as a missing
gutter. Bisected locally: the test passes at 61cfbaa and fails from
2563513 (#15233) onwards.

## Product or test

The product is fine. What the guard protects is that the parent row has
no gear, because `playwright_model_config.py` finds gears by their
accessible name (`Inference settings for ...`) and reads "no gear" as
"this row expands". The new chevron is an `aria-hidden` button with no
label, so the driver still sees no gear. The test was too literal.

## Fix

- The gutter is matched through `ROW_ACTIONS_CLASS` and every constant
whose definition is built from it, read from `pickers.tsx` itself, so a
future alias does not reopen this. A new test checks that reader (it
finds at least one alias on main, and ignores a `ROW_ACTIONS_*` constant
that does not build on the gutter class).
- The check now reads the expandable branch of the parent row. Before,
the partial-repo branch's row-menu gutter also satisfied it, so removing
the gutter from the branch that expands still passed.
- New: that branch must not contain an `aria-label`, since a labelled
control there is what would break the driver's inference.

## Verification

- `tests/studio/test_model_picker_contracts.py`: 202 passed on main's
source (1 failed before this change).
- Sabotage, each run against main's `pickers.tsx` with one edit:
- gutter class removed from the expandable branch: fails (passed with
the old guard)
  - `<ModelLoadSettingsAction />` added to that gutter: fails
- the chevron button given `aria-label="Inference settings for x"`:
fails
- The guard also passes against the pre-#15233 `pickers.tsx`
(61cfbaa).
@danielhanchen
danielhanchen merged commit fbc905f into main Oct 26, 2026
37 of 38 checks passed
@danielhanchen
danielhanchen deleted the grpo-truncated-support-wording branch October 26, 2026 04:48
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