Repository navigation
TRL discovery shim: check AsyncGRPOTrainer as patched in place (Core latest red on TRL 1.18) - #18088
Merged
Merged
Conversation
…(Core latest red)
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Core (HF=latest + TRL=latest)fails on main now that CI installs TRL 1.18.0 (seen on the staging run for #18082, on8c99caf36c):TRL 1.18 moved
AsyncGRPOTrainerintotrl.trainer.async_grpo_trainer. #18070 handles that on purpose:patch_trl_rl_trainersskipsasync_grpo_trainer, andpatch_trl_async_grpopatches the class in place, because it needs TRL's own module globals (create_model_from_path, the lm_head helpers). The class keeps its name. The discovery shim inconsolidated-tests-ci.ymlcounts a trainer as patched only if its class name starts withUnsloth, and it did not know about that exclusion.#18070 is right. The shim did not follow it.
Change
In the shim embedded in
.github/workflows/consolidated-tests-ci.yml:PATCHED_IN_PLACE = {"async_grpo_trainer"}mirrors the exclusion inpatch_trl_rl_trainers, and the canonical-trainer test leaves those modules out of its renamed-class check.test_trainers_patched_in_place_are_wrapped: where TRL ships one of those modules, it runspatch_trl_async_grpo()and checks that each*Trainerclass's__init__has a layer whose code is inunsloth/models/rl.py, following the__wrapped__chain since other Unsloth patches wrap on top. On TRL versions without the module it skips. So the trainer is still checked, only in the way it is actually patched.Verification
The shim extracted from the workflow and run locally:
1 failed, 4 passed); this one passes (6 passed).patch_trl_async_grpomade a no-op: the new test fails (__init__ has no layer from Unsloth's in-place patch ...: [unsloth/trainer.py, trl/trainer/async_grpo_trainer.py]).5 passed, 1 skipped(notrl.trainer.async_grpo_trainer).