Repository navigation
Studio: list imatrix-weighted quants named <model>-<QUANT>-imatrix.gguf - #14931
Conversation
|
@codex review |
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. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca6e4f60da
ℹ️ 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".
| # llama.cpp reads an imatrix only to quantize, so a quant label before a trailing token marks imatrix-weighted | ||
| # weights (Lewdiculous `<model>-Q4_K_M-imatrix.gguf`), not the calibration file. Float labels do not count. | ||
| _IMATRIX_WEIGHTED_RE = re.compile( | ||
| r"[._\-](?:I?Q[0-9]+_|P?TQ[0-9]+_|(?:MX|NV)FP[0-9])[^/]*[._\-]imatrix$", re.IGNORECASE |
There was a problem hiding this comment.
Require a complete quant token before exempting imatrix files
When a calibration filename contains a token that merely starts like a quant, such as model-Q4_calibration-imatrix.gguf, this pattern matches because I?Q[0-9]+_ is followed by unrestricted [^/]*. is_imatrix_filename consequently treats the file as model weights even though the existing _GGUF_QUANT_RE does not recognize Q4_calibration as a quant, causing variant discovery and loading to surface a calibration GGUF that llama-server cannot load. Constrain this exemption to the complete supported quant grammar rather than a quant-like prefix.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
No published file is named like this: across 1,146 imatrix-named GGUFs in 1,463 Hub repos, every name the exemption admits is real weights (smallest 516 MB), so tightening it guards an input no repo ships.
| # llama.cpp reads an imatrix only to quantize, so a quant label before a trailing token marks imatrix-weighted | ||
| # weights (Lewdiculous `<model>-Q4_K_M-imatrix.gguf`), not the calibration file. Float labels do not count. | ||
| _IMATRIX_WEIGHTED_RE = re.compile( | ||
| r"[._\-](?:I?Q[0-9]+_|P?TQ[0-9]+_|(?:MX|NV)FP[0-9])[^/]*[._\-]imatrix$", re.IGNORECASE |
There was a problem hiding this comment.
Accept a quant token at the start of the stem
For an imatrix-weighted file named Q4_K_M-imatrix.gguf, the new expression cannot match because it requires [._-] before the quant token. The existing quant extraction and variant machinery support bare quant basenames such as Q4_K_M.gguf, but the trailing-token check therefore still classifies this corresponding weighted form as calibration data, causing every remote and local listing and loader path to discard it. Accept the start of the stem as a valid quant boundary.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
No repo ships a bare -imatrix.gguf: none of the 1,146 imatrix-named GGUFs surveyed across 1,463 Hub repos starts with a quant token, while the --imatrix form covers all 98 affected files.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. 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". |
|
pre-commit.ci run |
Fixes #14695 (the part of it Studio controls).
Problem
Since #9409, Studio treats any GGUF whose name ends in
-imatrixas a llama-quantize calibration file and drops it from the variant menu, download plan and loader. That rule also matches a common naming convention for imatrix-weighted quants,<model>-<QUANT>-imatrix.gguf, so whole repos lose their real weights:elvezjp/DeepSeek-V4.1-Flash-1017-ELVEZ-Q2-gguf(#14695)DSpark7.9 GB,Vision1.0 GB (main 366 GB weight hidden)IQ2_XXS365.7 GB,DSpark,VisionLewdiculous/Kunocchini-7b-128k-test-GGUF-ImatrixF16onlyF16,Q8_0,Q6_K, ... (13)FadedRedStar/Qwen3.5-4B-heretic-imatrix-GGUFQ5_K_M,Q4_K_M,IQ4_NLjashepp/Ornith-1.5-35B-A3B-MXFP4_MOE_Hybrid-Imatrix-GGUFIn #14695 this hid the real model and left the 7.9 GB DSpark draft head as the only variant that fits a 32 GB Mac, which is what the reporter ended up loading.
Fix
llama.cpp only uses an imatrix while quantizing, so a quantized type label (
Q4_K_M,IQ2_XXS,Q8_0,MXFP4,TQ1_0, ...) before the trailingimatrixtoken means imatrix-weighted weights, not calibration data. The trailing-token rule now skips such names. Float labels do not count (there is no imatrix-weighted F16), and the leading form (imatrix.gguf,imatrix_unsloth.gguf,imatrix-fp16.gguf) and.imatrixare unchanged. The canonical predicate and both mirrors (utils/models/model_config.py,core/inference/llama_cpp.py) change together; the existing three-copies agreement test covers the new names.Still recognised as an imatrix:
imatrix_unsloth.gguf,imatrix.gguf,imatrix-fp16.gguf,z-combined-imatrix.gguf,<model>.imatrix.gguf(mradermacher),<model>-BF16-imatrix.gguf.Tests
tests/test_imatrix_gguf_filtering.py: new model and imatrix names, plus a remote-listing test for an imatrix-weighted repo. With the functional change reverted, 5 of the new cases fail; with it, all 56 pass.ggufpackage and an unreleased diffusers pin in this environment).Before / after
Model hub,
Lewdiculous/Kunocchini-7b-128k-test-GGUF-Imatrixquant list (merge base 2eb94bc vs this PR, two fresh Studio installs). Before: only the F16 file (1 row). After: F16 plus the Q8_0 ... IQ4_XS imatrix-weighted quants (13 rows).