Skip to content

common: pin model resolution on real HF repo layouts - #30548

Merged
ServeurpersoCom merged 3 commits into
ggml-org:masterfrom
ServeurpersoCom:model-resolution-real-listings
Oct 26, 2026
Merged

ServeurpersoCom merged 3 commits into
ggml-org:masterfrom
ServeurpersoCom:model-resolution-real-listings

Conversation

@ServeurpersoCom

Copy link
Copy Markdown
Contributor

Overview

This PR is a study to let #29584 land without regressions: it pins model resolution on real Hugging Face repo layouts, and along the way it fixes the master bugs this corpus revealed, from imatrix files listed as models and missed split names to unpaired -vision mmproj, MTP heads in subfolders, _ separated quants and draft-only repos.

Additional information

I scanned the listings of 1237 GGUF repos from the major publishers on Hugging Face, ran the resolver on 7474 requests over them, and checked every pick against the file's actual GGUF header read with HTTP range requests. From that corpus, 63 real listings covering all 94 file naming patterns are pinned in test-model-resolution: master fails 25 of these checks, and the fix passes them all with no regression across the full corpus.

Requirements

@ServeurpersoCom
ServeurpersoCom requested review from a team and ggerganov as code owners October 14, 2026 20:37
@github-actions github-actions Bot added the testing Everything test related label Oct 14, 2026
@ServeurpersoCom
ServeurpersoCom requested a review from angt October 14, 2026 20:39
@angt

angt commented Oct 15, 2026

Copy link
Copy Markdown
Member

find_token() keeps only the leftmost token, so Vision masks a later mmproj:

before:

$ LLAMA_CACHE=$(mktemp -d) llama download -hf leafspark/Llama-3.2-11B-Vision-Instruct-GGUF:F16
Downloading Llama-3.2-11B-Vision-Instruct-mmproj.f1… ───              22%
Downloading Llama-3.2-11B-Vision-Instruct.f16.gguf                     0%
^C

after:

$ LLAMA_CACHE=$(mktemp -d) build/bin/llama download -hf leafspark/Llama-3.2-11B-Vision-Instruct-GGUF:F16
Downloading Llama-3.2-11B-Vision-Instruct-mmproj.f1… ─────────────── 100%

@angt

angt commented Oct 15, 2026

Copy link
Copy Markdown
Member

I still think it's the opportunity to follow the initial rules more strictly, like each component is delimitated by a -, etc.

Almost everything was specified here: https://github.com/ggml-org/ggml/blob/master/docs/gguf.md

@ServeurpersoCom

Copy link
Copy Markdown
Contributor Author

Thanks, that is exactly what this PR must not do. I'll rework it to pin master's current behavior only, known bugs included, so it changes nothing in the resolver and stays a pure test harness. Improvements can come later, one at a time, on top of it.

@angt

angt commented Oct 15, 2026

Copy link
Copy Markdown
Member

Thanks, that is exactly what this PR must not do. I'll rework it to pin master's current behavior only, known bugs included, so it changes nothing in the resolver and stays a pure test harness. Improvements can come later, one at a time, on top of it.

Okay, I agree

I was confused by the download.cpp patch that has been removed.

Extend test-model-resolution with 63 repo listings captured verbatim
from the HF API, chosen to cover every file naming pattern found across
1237 GGUF repos of the major publishers and pruned to whole quant groups.
Each repo pins its resolved plans and its cache listing.

The expectations follow what each file really is per its GGUF header,
not what the current resolver picks, so a mismatch is a resolution bug.
Mismatches are collected and reported together before the test fails.
Some real split names (DevQuasar's Model.Q2_K.gguf-00001-of-00012.gguf
under a quant folder) exceed MAX_PATH once materialized in the temporary
cache on Windows, so the listing of such a repo is skipped with a note
while its plans stay checked.
Replace the real repo table with 171 HF listings whose file names follow
the GGUF naming convention (lowercase sidecar prefix, - delimited
components, quant last), one per layout pattern found across 1174 GGUF
repos and pruned to whole quant groups. Repos outside the convention are
dropped. Each repo pins the plans and the cache listing master gives
today, so the test is a pure harness: any change in resolution shows up
here, and mismatches are reported together.
@ServeurpersoCom
ServeurpersoCom force-pushed the model-resolution-real-listings branch from 042f041 to 7bc53dd Compare October 26, 2026 08:40
@ServeurpersoCom

Copy link
Copy Markdown
Contributor Author

Rebased on master. This harness helped me spot a few resolution regressions in other PRs, so it might be worth having in the tree, no rush though.

@ServeurpersoCom
ServeurpersoCom merged commit 74b104c into ggml-org:master Oct 26, 2026
14 checks passed
auRose94 pushed a commit to auRose94/llama.cpp that referenced this pull request Oct 28, 2026
* tests: pin model resolution on real repo listings

Extend test-model-resolution with 63 repo listings captured verbatim
from the HF API, chosen to cover every file naming pattern found across
1237 GGUF repos of the major publishers and pruned to whole quant groups.
Each repo pins its resolved plans and its cache listing.

The expectations follow what each file really is per its GGUF header,
not what the current resolver picks, so a mismatch is a resolution bug.
Mismatches are collected and reported together before the test fails.

* tests: leave the listing unchecked on paths the filesystem refuses

Some real split names (DevQuasar's Model.Q2_K.gguf-00001-of-00012.gguf
under a quant folder) exceed MAX_PATH once materialized in the temporary
cache on Windows, so the listing of such a repo is skipped with a note
while its plans stay checked.

* tests: pin real listings to master on GGUF convention names only

Replace the real repo table with 171 HF listings whose file names follow
the GGUF naming convention (lowercase sidecar prefix, - delimited
components, quant last), one per layout pattern found across 1174 GGUF
repos and pruned to whole quant groups. Repos outside the convention are
dropped. Each repo pins the plans and the cache listing master gives
today, so the test is a pure harness: any change in resolution shows up
here, and mismatches are reported together.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants