Repository navigation
Let the composite renaming tests run inside the transformers 5.4 window - #11572
Conversation
The Repo tests (CPU, rest) lane pins transformers<5.5 and so installs 5.4.0, the exact release fix_transformers_composite_prefix_renaming exists for. #11452 added five tests there whose own lane was cancelled before it reported, and all five fail on main at that pin: - the drift test failed whenever the probe answered unscoped, which on 5.4.0 is the expected answer. It now fails when the probe answers unscoped on a release that ships upstream's fix (the probe drifted), or when no repair, unsloth's or unsloth_zoo's, is live inside the window. - the install gate read only the top of the chain. unsloth_zoo's MoE wrapper sits on top of the repair and publishes no __wrapped__, so a live repair read as missing. It now walks the chain by both links. - forced_install measured installs from whatever the import left live, where the repair is already in the chain and declines. It now starts from the bare upstream function, through monkeypatch so a test that monkeypatches the same attribute cannot restore the stripped function on teardown.
|
@codex review |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
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. |
On transformers 4.x, importing unsloth installs inert stand-ins for transformers.core_model_loading and transformers.conversion_mapping so peft can import. The helpers found them and ran four tests against a WeightRenaming that renames nothing; at 4.57.6 those four fail. A real module is a file on disk, and the stand-ins are not.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! 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". |
…ow (unslothai#11572) * Let the composite renaming tests run inside the transformers 5.4 window The Repo tests (CPU, rest) lane pins transformers<5.5 and so installs 5.4.0, the exact release fix_transformers_composite_prefix_renaming exists for. unslothai#11452 added five tests there whose own lane was cancelled before it reported, and all five fail on main at that pin: - the drift test failed whenever the probe answered unscoped, which on 5.4.0 is the expected answer. It now fails when the probe answers unscoped on a release that ships upstream's fix (the probe drifted), or when no repair, unsloth's or unsloth_zoo's, is live inside the window. - the install gate read only the top of the chain. unsloth_zoo's MoE wrapper sits on top of the repair and publishes no __wrapped__, so a live repair read as missing. It now walks the chain by both links. - forced_install measured installs from whatever the import left live, where the repair is already in the chain and declines. It now starts from the bare upstream function, through monkeypatch so a test that monkeypatches the same attribute cannot restore the stripped function on teardown. * Skip the composite renaming tests on unsloth's own stand-in modules On transformers 4.x, importing unsloth installs inert stand-ins for transformers.core_model_loading and transformers.conversion_mapping so peft can import. The helpers found them and ran four tests against a WeightRenaming that renames nothing; at 4.57.6 those four fail. A real module is a file on disk, and the stand-ins are not. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Summary
Repo tests (CPU, rest)is red on every recent PR (#11559, #11558, #11555, #11553, #11528) with five failures intests/test_composite_prefix_renaming.pyandtests/test_import_fixes_drift.py. Those tests came in with #11452. That lane installstransformers>=4.51,<5.5(studio-backend-ci.yml:297, pinned since #5298), which resolves to 5.4.0, the exact release the repair targets. #11452's run of that lane was cancelled, so it merged without a verdict at that pin.Reproduced on main
f39470176with transformers 5.4.0: 5 failed. With 5.17.0: all pass.fix_transformers_composite_prefix_renamingitself is correct. On 5.4.0 it installs at import, and unsloth_zoo'smoe_utils_bnb4bitwrapper then sits on top of it. The tests are what fail:test_transformers_scopes_a_submodules_conversion_mappingtest_installation_is_gated_on_the_probe__wrapped___composite_prefix_renaming_repaired)test_the_patch_is_idempotent_and_undoable,test_the_patch_rebinds_the_copies_other_modules_imported,test_a_vllm_module_holding_its_own_copy_is_reboundforced_installmeasured installs starting from whatever the import left live, which already contained the repair, so it declined ("the repair declined",'function' object has no attribute '__wrapped__')forced_installstarts from the bare upstream functionforced_installdoes that swap throughmonkeypatch, not by assignment. Fixture teardown is LIFO, so a test that also monkeypatchesget_model_conversion_mapping(test_a_module_holding_the_pre_zoo_function_is_still_rebound) would otherwise restore the stripped function after the fixture'sfinally, and leave the repair uninstalled for every test after it. That ordering failure was reproduced before the change and is gone after it.Verification
-n 4transformers.__version__faked to5.6.0fails with the probe-drift message.Also: stand-in modules on transformers 4.x
On transformers 4.x, importing unsloth installs inert stand-ins for
transformers.core_model_loadingandtransformers.conversion_mappingso peft can import._weight_renaming()and_conversion_mapping()found them, and at 4.57.6 four tests ran against them and failed (test_a_renaming_that_lands_off_the_map_is_destructive,test_rescoped_renaming_matches_upstreams_doubled_prefix_semantics,test_a_non_composite_model_is_untouched,test_a_module_holding_the_pre_zoo_function_is_still_rebound). No lane pins 4.x for these files today, but zoo's copy of the same tests is red on exactly this (unslothai/unsloth-zoo#1345). Both helpers now skip a module that is not a file on disk.