Repository navigation
Studio: keep different GGUF quants of the same repo alongside (#19072) - #19122
Open
indrajeetapache wants to merge 1 commit into
Open
indrajeetapache wants to merge 1 commit into
indrajeetapache wants to merge 1 commit into
Conversation
…hai#19072) Multi-model alongside previously forced another quant of the same HF repo onto the existing slot (bare-repo match), so UD-Q4 then UD-Q5 replaced instead of loading on a second GPU. Route by repo:QUANT for loads; bare-repo chat still prefers the primary.
danielhanchen
added a commit
that referenced
this pull request
Nov 23, 2026
…og (#19125) ## Problem `studio/backend/tests/test_diffusion_backend.py::test_family_render_cudnn_scope_overrides_an_inherited_benchmark` is red on `main` in Backend CI `(Python 3.13, diffusion)`. It fails for every PR based on `main` since #19077, for example #19122: ``` with family_render_cudnn_scope(detect_family("krea/Krea-2-Turbo"), "cuda"): assert cudnn.benchmark is True # a family that keeps the benchmark is left alone AssertionError: assert False is True ``` ## Cause #19077 is correct. It sets `cudnn_benchmark = False` on Krea-2 on purpose: the per-process VAE conv pick decoded one fixed latent three different ways across three fresh L4 homes. The test is wrong. It used Krea-2 as its hard-coded example of a family that keeps `cudnn.benchmark` on, so pinning Krea-2 broke it. The same would happen whenever another family gets pinned. ## Fix Tests only. The test now reads both lists from `_FAMILIES` instead of naming a family: - for every family with `cudnn_benchmark = False`, the scope holds the flag off inside and restores it after; - for every family that keeps it, the scope leaves the flag alone; - the FLUX.2 Klein case and the CPU-device case are unchanged; - it asserts that both lists are non-empty, so it cannot pass vacuously. ## Verification - The test passes; the whole file passes serially (694). - Sabotage A: make `family_render_cudnn_scope` ignore the family flag. The test fails, naming `qwen-image-2.1`, a family that keeps the benchmark. - Sabotage B: make the scope never hold the flag off. The test fails on the first opt-out.
danielhanchen
added a commit
that referenced
this pull request
Nov 23, 2026
…le helper (#19133) ## Problem Two tests are broken on `main`. 1. **`tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding`** is red in `Repo tests (CPU, rest-2)` for every PR based on `main`, for example #19122: ``` Left contains one more item: 'tests/test_inkling2_support.py:633: read_text()' ``` #19016 added `(_ROOT / "unsloth" / "save.py").read_text()`. It reads a checked-in file with the platform default encoding, which breaks on Windows as soon as `save.py` gains a non-ASCII byte. The guard is right and the new line is wrong. 2. **`tests/test_inkling2_support.py::test_fastmodel_keeps_inkling2_eager_unless_told_otherwise`** fails wherever the file runs: ``` assert re.search('if os\\.environ\\.get\\("UNSLOTH_COMPILE_DISABLE", "0"\\) == "0": ...', body) AssertionError: None ``` It still pins the inline assignment that #19073 replaced with the shared `_set_partial_compile_disable()` helper. CI does not show it yet: the file skips below transformers 5.24, and the HF=latest legs are held below 5.24. It fails locally on 5.24.0, so it would turn red as soon as that cap lifts. ## Fix Tests only, in `tests/test_inkling2_support.py`: - Both reads of checked-in source pass `encoding = "utf-8"`: - the `save.py` read the guard flags; - the loader source read through `__file__`, which the guard does not see. - The eager-compile test now pins the current shape: - the Inkling 2 branch calls `_set_partial_compile_disable()`; - the helper sets `partial` from unset, `0` or `partial`; - the helper keeps a full disable (`1`, `true`) as `1`, so an explicit user choice is still left alone. ## Verification | Check | Result | | --- | --- | | `test_source_read_encoding.py`, `main` | 1 failed | | `test_source_read_encoding.py`, this branch | 16 passed | | `test_inkling2_support.py`, transformers 5.24.0, `main` | 1 failed, 41 passed | | `test_inkling2_support.py`, transformers 5.24.0, this branch | 42 passed | | `test_inkling2_support.py`, transformers 5.17 | module skipped as before | Sabotage, each with only the product line changed: - Drop the helper call from the Inkling 2 branch in `loader.py`: the test fails on the call check. - Make the helper always set `partial`: the test fails with `assert 'partial' == '1'` for a full disable.
danielhanchen
added a commit
that referenced
this pull request
Nov 23, 2026
…19135) ## Problem `tests/test_runtime_text_encoding.py::test_shipping_code_names_an_encoding` is red on `main` in `Repo tests (CPU, rest)`, for example on #19122 and #19127: ``` 4 text read/write call sites in shipping code let the operator's locale decide the encoding 'unsloth/models/inkling2.py:364: open()' 'unsloth/models/inkling2.py:532: open()' 'unsloth/models/inkling2.py:537: open()' 'unsloth/models/inkling2.py:545: open()' ``` ## Cause The guard is right; the new code is wrong. #19016 (Inkling 2 merged 16-bit save and GGUF export) added four text-mode `open()` calls with no encoding: - reading `model.safetensors.index.json` (`index_path`); - writing the merged index; - reading `config.json`; - writing `config.json`. On Windows, Python uses the locale code page there. A config or index with a non-ASCII byte then fails to load, or is written in a codec the next reader does not expect. The guard has been in the repo since October; the lines all come from `c69ffd79be`. ## Fix Pass `encoding = "utf-8"` on all four calls in `unsloth/models/inkling2.py`. Nothing else changes: the JSON written is the same on a UTF-8 host. ## Verification - `tests/test_runtime_text_encoding.py`: 9 passed (`main`: 1 failed, listing exactly these four sites). - `tests/test_inkling2_support.py` on transformers 5.24.0, including the merged-save tests: 42 passed.
This branch has not been deployed
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
UD-Q4_K_XLthenUD-Q5_K_S) replaced the first in place — even when pinned to different GPUs._select_load_slottreated a bare-repo match as “already serving,” so another quant reused that slot. Routing already supportedrepo:QUANT(seetest_request_model_name_picks_the_backend); only load selection was wrong.repo:QUANT/gguf_variantopens a second slot; bare-repo chat still prefers the primary; a load without alongside still switches the primary.Test plan
alongside=Truepicks a new slot; without alongside still returns primaryorg/A:Q8_0on a slot next to primaryorg/A:Q4still routes by explicit quantcc @NilayYadav @danielhanchen