Repository navigation
[BUGFIX] Preserve explicit UNSLOTH_COMPILE_DISABLE=1 in FastModel loader - #18773
Merged
shimmyshimmer merged 5 commits intoNov 23, 2026
Merged
shimmyshimmer merged 5 commits into
shimmyshimmer merged 5 commits into
Conversation
…t as off [skip ci]
[skip ci]
danielhanchen
marked this pull request as ready for review
November 23, 2026 11:19
Member
|
@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. |
Member
|
@codex review |
|
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". |
danielhanchen
added a commit
that referenced
this pull request
Nov 23, 2026
## Summary `Repo tests (CPU, rest)` fails on `main`: ``` tests/test_loader_compile_disable_preserve.py::test_partial_is_written_only_inside_the_helper E assert False E + where False = all(<generator object test_partial_is_written_only_inside_the_helper.<locals>.<genexpr> ...>) ``` ## Root cause The Inkling 2 branch, not the guard. #18773 added `_set_partial_compile_disable()` to `unsloth/models/loader.py` and routed every branch that partly disables compile through it, with a guard that no other code writes `"partial"`. The Inkling 2 branch from #18812 / #18959 landed alongside it with its own direct write: ```python if os.environ.get("UNSLOTH_COMPILE_DISABLE", "0") == "0": os.environ["UNSLOTH_COMPILE_DISABLE"] = "partial" ``` Besides tripping the guard, that write keeps a value like `true` or `yes` as it is, and unsloth_zoo only reads `"1"` and `"partial"` as off, so `UNSLOTH_COMPILE_DISABLE=true` left Inkling 2 compiled. The helper turns `1` / `true` / `yes` into `"1"` and everything else into `"partial"`. ## Fix - `unsloth/models/loader.py`: the Inkling 2 branch calls `_set_partial_compile_disable()`. Unset or `0` still becomes `partial`, and `1` still stays fully off. - `tests/test_loader_compile_disable_preserve.py`: the helper-call count goes from five branches to six, with Inkling 2 named. ## Testing - `tests/test_loader_compile_disable_preserve.py` and `tests/test_inkling2*.py`: 23 passed, 3 skipped. - With `main`'s `loader.py`, the guard fails (both the direct write and the helper count). - Helper mapping checked directly: unset, `0`, `false` -> `partial`; `1`, `true` -> `1`; `partial` -> `partial`.
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
_set_partial_compile_disable()inunsloth/models/loader.pyand route all five model-specific"partial"compile-disable branches (gemma3on RDNA,deepseek_v41,csm,DISABLE_COMPILE_MODEL_NAMES, and transformers 4.x T5) through it.FastModel.from_pretrainedfrom downgrading an explicit full compile-disable (UNSLOTH_COMPILE_DISABLE=1, includingdevice_type.py's pre-Voltasetdefault) to"partial", which silently re-enabled compile paths that only guard against"1".tests/test_loader_compile_disable_preserve.pyand update the source-scan regex intests/test_deepseek_v41_lora_coverage.py.Verification
pytest tests/test_loader_compile_disable_preserve.py tests/test_deepseek_v41_lora_coverage.py tests/test_ci_repo_cpu_shards.py(32 passed, 2 skipped; 13/13 new tests failed pre-fix)pytest tests/test_compile_decode_selection.py tests/test_loader_glob_skip.py tests/test_pre_volta_compile_disable.py(all passed)ruff check,py_compile, andscripts/lint_duplicate_definitions.pyclean