Repository navigation
Studio: load the selected GGUF quant, not a cached sibling (Q6_K loaded UD-Q6_K_XL) - #18006
Conversation
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 |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
llama.cpp has no _XL quant type, so a bare selector such as Q4_K_XL (the spelling used in repo:TAG references) can only name the UD-Q4_K_XL build; the sibling-quant filter now accepts that alias while still refusing UD- builds of real llama.cpp types such as Q4_K_M.
|
Pushed e6c8016 on top of this PR:
Checked against the real file lists of 19 GGUF repos. Every variant the UI lists resolves to exactly its own files, with nothing else cached and with only sibling quants cached. All 93 |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! 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". |
|
Codex review and CI check are done for head
|
Lyxot
left a comment
There was a problem hiding this comment.
LGTM. Verified against the real file lists of 19 GGUF repos: every quant now resolves to its own files, including bare *_XL names.
… fixed 0.1 s sleep (#18103) `studio/backend/tests/test_anthropic_admission.py` fails intermittently in the Studio `a-f` shard on unrelated PRs (#18045, #18006, #18069, #18075): ``` test_non_streaming_queued_then_admitted E AssertionError: assert 0 == 1 E + where 0 = LlamaAdmissionSnapshot(..., capacity=1, active=1, queued=0, ...).queued test_capacity_enforced_from_effective_parallel_slots E AssertionError: assert (3 == 3 and 3 == 3 and 0 == 1) ``` ## Cause Each of these tests occupies every slot, starts a request as a task, sleeps a fixed 0.1 s and then expects the request to be in the admission queue. On a loaded runner the handler sometimes has not reached the queue within 0.1 s, so the snapshot still shows `queued=0`. The admission code is not at fault; the test raced it. ## Fix `_until_queued(task)` polls the queue snapshot every 10 ms until the request is queued, for up to 5 s. It still fails if the request finishes without ever queueing (`task.done()`) or never queues within the deadline, so a request that skips admission is still caught. It replaces the fixed sleep at all five sites that assert `queued == 1` right after starting the task. The assertions themselves are unchanged. ## Verification - `tests/test_anthropic_admission.py`: 39 passed, twice. - Slow handler simulated locally (`await asyncio.sleep(0.25)` at the top of `anthropic_messages`, not committed): - main: the five queued checks fail (plus `test_uncontended_hot_path_is_fast`, which is meant to catch a slow handler). - this branch: only `test_uncontended_hot_path_is_fast` fails.
Selecting a GGUF quant can load a different quant that is already in the cache. With
UD-Q6_K_XLdownloaded, selectingQ6_Kloads theUD-Q6_K_XLfile and downloads nothing, while the UI still showsQ6_K. The same happens forQ2_K(loadsQ2_K_LorUD-Q2_K_XL) andQ4_K_M(loadsUD-Q4_K_M)._gguf_files_for_variantpicks the file for a quant. It looks for an exact name match first. If none is found, it tries a looser match, and that one also acceptsUD-Q6_K_XLforQ6_K.Before downloading, Studio checks the local cache with this function. If the cache only has
UD-Q6_K_XL, there is no exact match forQ6_K, so the loose match returnsUD-Q6_K_XLand Studio loads it.With this PR, the loose match skips files whose quant is different from the one requested. So
Q6_Kno longer matchesUD-Q6_K_XL, and Studio downloads the realQ6_K. Requests that are not quant names, such as a folder path, still use the loose match. When offline, selecting a quant that is not cached now shows the normal download error instead of loading a different quant.Verification
Studio before and after the fix, with
unsloth/Qwen3-0.6B-GGUF:UD-Q6_K_XLQ6_KUD-Q6_K_XL, no downloadQ6_KUD-Q6_K_XL,UD-Q2_K_XLQ2_KUD-Q2_K_XL, no downloadQ2_KQuants that are already cached still load from the cache.
New tests in
tests/test_offline_gguf_cache_fallback.pycover these cases; six of the seven fail without the fix. All backend tests that use the matcher or the cache check pass (1646 passed, 1 skipped).