Repository navigation
[Bug] Unsloth Studio / Desktop: Q4NX source picker lists every GGUF in the repo and calls a local Qwen3.5 Q4_0 "packs directly" - #18522
Conversation
…GGUF's layout from its name
|
Codex reviewed this branch on a mirror (LeoBorcherding/unsloth#978) at |
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: Didn't find any major issues. 🎉 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". |
…18657) ## Summary `Frontend unit tests` fail on `main` (seen on #18522, reproduced on current `main`): ``` not ok - the backend refuses an image generate while a load is in flight location: studio/frontend/tests/images-generate-during-switch.test.ts:77 The input did not match the regular expression /if await asyncio\.to_thread\(_image_load_in_flight\):\s*raise HTTPException\(\s*status_code = 409/ ``` ## Cause #18420 added this source check: a generate that arrives while a model load is in flight was refused straight away with 409. Then #18626 deliberately changed that branch in `routes/inference.py`: - a generate during a load whose pipeline is already published now waits out the load's tail (encoder pins); - a generate that cannot wait (pipeline not published yet, or the tail outlasts the cap) is still refused with the in-flight 409. #18626 covered the new behaviour with backend tests (`test_images_generate_load_tail.py`), but this frontend check still expected the 409 on the line right after the `if`. The product change is right; the check is out of date. ## Change `images-generate-during-switch.test.ts` now asserts the invariant both PRs share, that no image run starts while a load is in flight. It finds the in-flight branch before a run is admitted and requires both: - that it waits out the tail (`await _wait_image_load_tail(`); - that it still raises `HTTPException(status_code = 409, detail = IMAGE_LOAD_IN_FLIGHT_MSG)` when it cannot. ## Testing - On `main` the file fails 1 of 7. With this change: 7 passed. - Sabotage on `routes/inference.py`, each of which fails the new check: - removing the in-flight 409; - replacing the tail wait.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c05c267e15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| export function q4nxArchitecture(architecture?: string | null, name?: string | null): string | null { | ||
| const arch = architecture?.trim().toLowerCase(); | ||
| if (arch) return arch; | ||
| return NAME_ARCHITECTURES.find(([re]) => re.test(name ?? ""))?.[1] ?? null; |
There was a problem hiding this comment.
Exclude unrelated ancestors from architecture inference
When a local GGUF is selected by an absolute path, name is selectedRow.id, so it includes every ancestor directory. For example, /models/Qwen3.5-comparisons/Qwen2.5-3B-Instruct-Q4_0.gguf matches the Qwen3.5 rule in the parent directory instead of the file's Qwen2.5 family. Consequently, q4nxPacking now returns mismatch and the export summary says Convertible: No for a valid Qwen2.5 Q4_0 source; the parent commit reports it as direct. Infer the family from the actual model/file identity or trusted metadata rather than allowing unrelated path components to override it.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c026309: the name fallback now reads only the last path segment, so a parent folder never names the family; added the Qwen2.5-under-a-Qwen3.5-folder case to the test.
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c026309562
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| /** The quant that packs directly for an architecture, or null when it is not known. */ | ||
| export function q4nxFitQuant(architecture?: string | null, name?: string | null): string | null { | ||
| const arch = architecture?.trim().toLowerCase(); | ||
| const arch = q4nxArchitecture(architecture, name); |
There was a problem hiding this comment.
Normalize the model name for the Omni override too
For an On Device source such as /models/omni/Qwen3.5-4B-Q4_K_M.gguf, the new fallback infers qwen35, but q4nxFitQuant then checks the entire path for omni. A normal Qwen3.5 model consequently reports mismatch and Convertible: No, and the settings recommend Q4_1, which the backend rejects for that model. Unlike the fixed family-name regex, this separate Omni override still searches ancestor directories; apply the same basename normalization to that decision.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 4b3955c: the Omni override now reads the same last path segment as the family fallback; added the /models/omni/ Qwen3.5 case and a real Omni name to the test.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 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". |

The Q4NX source picker on the Export page lists every GGUF file a repo ships. For
unsloth/Qwen3.5-4B-GGUFthat is 22 files, and only one, Q4_K_M, packs as is; the other 21 are dequantized and rounded to 4-bit again, or refused, so the list buries the one file you want.Separately, an On Device GGUF never has its architecture read before conversion, so a local Qwen3.5 Q4_0 is labeled "packs directly". That is the file #18064 refuses, because it answers with repeated slashes.
What changes
q4nxArchitecturefalls back to the model name when the architecture is unknown, for the families whose layout isn't the Q4_1 default: Qwen3.5/3.6 (Q4_K), Qwen2.5 (Q4_0, not VL) and LFM2 (Q4_0). A local Qwen3.5 Q4_0 now reads "won't convert", Q4_K_M "packs directly".Tests:
export-q4nx-source.test.tscovers the name fallback and the short list. Frontend suite and typecheck pass.Before / after on AMD DevLab gfx1151 (Radeon 8060S, XDNA2 NPU), Ubuntu 24.04, kernel 7.0.0-43, FastFlowLM 1.0.12 / Lemonade 2026.44.1, measured at
6eb70fdvs main33c6179(run 44425657543). Export > Convert to Q4NX,unsloth/Qwen3.5-4B-GGUFwith Q4_K_M picked.Not run: the On Device path on a real local Qwen3.5 Q4_0 file; that half is covered by the unit test, not a screenshot.
Maintainer changes
/models/Qwen3.5-comparisons/Qwen2.5-3B-Instruct-Q4_0.ggufstays Qwen2.5 and packs directly)./models/omni/Qwen3.5-4B-Q4_K_M.ggufis not treated as Omni.Before / after at the current head
Export > Convert to Q4NX,
unsloth/Qwen3.5-4B-GGUF, two isolated Studio installs built from the merge base and from this branch (f71fdf825). The NPU status is answered as ready in the browser so the tab renders; the file listing and packing tags are each build's own.Opening the fold lists the same 22 files as before.