Skip to content

Raise the TRL cap to 1.10.0, and open the datasets hole it needs - #8810

Closed
danielhanchen wants to merge 1 commit into
mainfrom
trl-1x-datasets-caps
Closed

danielhanchen wants to merge 1 commit into
mainfrom
trl-1x-datasets-caps

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Split out of #8701, which now carries only the rollout fix and changes no resolved version for anyone.

This is the half that actually moves people onto TRL 1.x, so it is separated to be judged on its own. Nothing needs it merged: #8701's fix is inert below TRL 0.28.0 and only does something for someone who has already installed a newer TRL themselves.

What changes

-    "trl>=0.18.2,!=0.19.0,<=0.24.0",
+    "trl>=0.18.2,!=0.19.0,<=1.10.0",
-    "datasets>=3.4.1,!=4.0.*,!=4.1.0,<4.4.0",
+    "datasets>=3.4.1,!=4.0.*,!=4.1.0,!=4.4.*,!=4.5.0,<5.0.0",

Both [huggingfacenotorch] and the colab-* extras, four lines.

Why the two move together

Raising only the TRL cap ships a pin nobody exercises. TRL 1.10.0 requires datasets>=4.7.0, so with datasets<4.4.0 still in place a resolver asked for trl<=1.10.0 silently settles on trl==0.29.1.

The datasets change opens a hole rather than raising the floor. A datasets>=4.7.0 floor would drop Python 3.9 and force 4.x on TRL 0.22.2 users who do not need it. The hole !=4.4.*,!=4.5.0 is exactly what patch_datasets in import_fixes.py:794-805 already refuses at runtime over the _thread.RLock recursion bug, so the metadata and the runtime guard agree rather than the metadata being the stricter of the two.

Evidence carried over from #8701

trl<=0.24.0 is metadata only. Nothing in unsloth or unsloth_zoo reads the TRL version and refuses 1.x at runtime; the only comparisons are floors at trainer.py:725 and :993. With the trees on PYTHONPATH so no resolver sees the cap:

suite result
tests/ -k grpo 991 passed
tests/version_compat 1702 passed
3-step GRPO, TRL 1.10.0 vs 0.22.2 identical to all 16 digits

The 5-test gap against 0.22.2 is this repo's own TRL >= 1.7.0 gated assertions, which 0.22.2 skips and 1.10.0 runs and passes. Re-verified on datasets 4.8.5 with TRL 1.10.0: 991 / 1702 passed, GRPO smoke numbers identical to the datasets 3.6.0 run.

Not covered

Multi-rank / TP and TRL server mode; vLLM builds other than 0.15.1; TRL versions between 0.22.2 and 1.10.0 at runtime; datasets 5.x; the 4.4-4.5 recursion failure itself; Mac, Windows and WSL; transformers 5.x.

Split out of #8701 so the cap raise is decided on its own. #8701 now carries only the
rollout fix and changes no resolved version.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e21da89be

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

Comment thread pyproject.toml
"diffusers ; python_version < '3.10'",
"transformers>=4.51.3,!=4.52.0,!=4.52.1,!=4.52.2,!=4.52.3,!=4.53.0,!=4.54.0,!=4.55.0,!=4.55.1,!=4.57.0,!=4.57.4,!=4.57.5,!=5.0.0,!=5.1.0,<=5.5.0",
"trl>=0.18.2,!=0.19.0,<=0.24.0",
"trl>=0.18.2,!=0.19.0,<=1.10.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Raise the unsloth_zoo floor with the TRL cap

When upgrading an environment that already has the currently permitted unsloth_zoo release installed, pip can retain it because the unchanged unsloth_zoo>=2026.8.11 floor remains satisfied. That Zoo metadata still requires trl<=0.24.0—the repository's canary documents this explicitly in tests/kaggle/test_t4_smoke_harness.py:4133-4140—so its intersection with this widened constraint still resolves at most TRL 0.24.0 (and an explicit TRL 1.x request conflicts). Raise the Zoo floor to a coordinated release that permits TRL 1.x; otherwise normal upgrades do not receive the rollout this change intends.

Useful? React with 👍 / 👎.

danielhanchen added a commit that referenced this pull request Sep 20, 2026
trl<=1.13.0 was declared next to datasets<4.4.0, and every trl 1.x
requires datasets>=4.7.0, so the two windows do not intersect anywhere
in 1.x. pip does not error on that: it backtracks and installs trl
0.29.1. The lift that was measured, reviewed and advertised was one no
install could reach, and the ceiling lane, which pins trl==1.13.0
exactly and so cannot backtrack, was the only thing that went red,
with ResolutionImpossible.

The datasets window moves to !=4.4.*,!=4.5.0,<5.0.0, which is exactly
the range patch_datasets already refuses at runtime over the
_thread.RLock recursion bug, so the metadata and the runtime guard now
say the same thing instead of the metadata being the stricter of the
two. The shipped <4.4.0 also forbade every release above the broken
range, which is what stranded the ceiling. Same specifier as #8810,
which carries the measurement behind it: 991 passed on tests/ -k grpo
and 1702 on tests/version_compat under trl 1.10.0, and a 3-step GRPO
identical to 16 digits against 0.22.2, re-verified on datasets 4.8.5.
Verified here that the pair now resolves trl 1.13.0 on datasets 4.8.5
rather than backtracking.

Studio's single-env keeps datasets==4.3.0, for the reason it keeps
transformers==5.5.0: a window says what a pip install may resolve, an
exact pin says what the pinned installer ships.

Three gates in tests/test_trl_cap_sites.py, each mutation-checked:
the declared datasets window must be able to supply the declared trl
ceiling, it must exclude exactly what patch_datasets refuses (wider
installs a release that raises at import, narrower strands the
ceiling), and TRL_DATASETS_FLOORS is re-derived from PyPI when the
network is there.

scan_packages_baseline.json gains three entries, hand-written rather
than regenerated. The resolved trl moves 0.24.0 to 1.13.0 and upstream
relocated the approved sites: trl/import_utils.py to
trl/_lazy_module.py, same evidence_hash e584ecfd, so it is the same
reviewed line under a new path; and two copies of
wait_for_server_ready under trl/experimental, which poll a
user-supplied server_url /health until it answers or server_timeout
elapses. The 0.24.0-path entries stay, since the floor is still
0.18.2.
@danielhanchen

Copy link
Copy Markdown
Member Author

Superseded by main: unslothai/unsloth-zoo#1260 and #11016 raised the TRL ceiling to 1.13.0, with the same datasets window as here (!=4.4.*,!=4.5.0,<5.0.0). It goes out with the next unsloth release. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant