Repository navigation
version_compat tests: follow TRL 1.15's chunked_nll alias and GPU-only DPO scorer - #13207
Merged
Merged
Conversation
…DPO scorer TRL 1.15 deprecated loss_type="chunked_nll" as an alias of "nll" and rewrites it in SFTConfig.__post_init__, so the explicit-loss_type tests read TRL's own rewrite as Unsloth clobbering the user's choice. Compare against what TRL itself makes of the value (read from its deprecation FutureWarning), and also check "dft", which no TRL aliases. TRL 1.15 also scores DPO through its fused LM head, a Triton kernel with no CPU path, so plain TRL cannot train DPO on a CPU. Skip test_dpo_trains_on_cpu only when the installed TRL's dpo_trainer calls the model with fused_lm_head=True.
Member
Author
|
@codex review |
Codex Review SummaryThis 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. Swish! 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.
Problem
The
GRPO fake-run (CPU spoof, TRL latest)lane is red on every PR, because "TRL latest" is now TRL 1.15.0. Reproduced on main (a2915de) with TRL 1.15.0, transformers 5.18 and unsloth-zoo main. Three of the failures come from the tests, not from Unsloth:loss_type="chunked_nll"as an alias of"nll". Its ownSFTConfig.__post_init__rewrites the value and raises a FutureWarning. Plain TRL does the same with Unsloth not imported, so this is not Unsloth overriding the user's choice.DPOTraineralways calls the model withfused_lm_head=True. That routes log-probs throughtrl/kernels/chunked_logprob.py, a Triton kernel with no CPU fallback, so plain TRL cannot train DPO on a CPU either.The ORPO/CPO row-cap failures in the same lane are a real Unsloth gap. #13203 fixes them, so they are not touched here.
Fix
test_trl_loss_normalization_contract.py:_trl_resolves(wanted)asks TRL's ownSFTConfigwhat it does with the value, treating it as an alias only when TRL raises its deprecation FutureWarning for it. Both tests now also check"dft", which TRL never aliases, so a real Unsloth rewrite still fails them.test_trl_fake_train_cpu.py: skiptest_dpo_trains_on_cpuonly when the installedtrl.trainer.dpo_trainerusesfused_lm_head=True. TRL 1.14 and older still have to train DPO on a CPU.Verification
Sabotage check: a plugin that forces
loss_type = "nll"after TRL's__post_init__makes both loss_type tests fail on TRL 1.14.1 and 1.15.0.