[PR #911] [CLOSED] setup: --inspect, a GGUF's real quantization and whether Strata runs it, from its headers only #2912

Closed
opened 2026-11-04 02:04:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/911
Author: @star1872
Created: 10/5/2026
Status: ❌ Closed

Base: main ← Head: setup-inspect


📝 Commits (10+)

  • fa16567 setup: an earlier config that does not parse is skipped, not a crash; configs are written atomically (#459)
  • 749d957 setup (--backend hip): a system ROCm without the HIP development files falls back to the wheels (#446)
  • 5a30024 calibrate: the engine's arguments come from the server's engine_args; a failed tuning says why (#447)
  • 9f60d13 serve, setup: name the small split card that caps the prompt chunk; setup recommends the big card alone (#448)
  • eb8da1d /metrics: each request's speculative draft counts, and their sums in the totals (#457)
  • 6a09387 setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444)
  • d6a91e2 docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438)
  • d8d4ad3 Merge branch 'f-135-eng' into rel-0.1.35
  • 7b600d5 Merge branch 'f-135-small' into rel-0.1.35
  • d9ab843 Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it

📊 Changes

6 files changed (+1094 additions, -2 deletions)

View changed files

➕ data/gguf_fingerprints.json (+436 -0)
📝 docs/INSTALL.md (+7 -1)
📝 setup.py (+19 -1)
➕ tools/quantscope.py (+394 -0)
➕ tools/strata_inspect.py (+175 -0)
➕ tools/test_strata_inspect.py (+63 -0)

📄 Description

--inspect SOURCE [VARIANT] says what a GGUF really holds and whether Strata runs it, from its headers only (a few MB,
also over the network), before anyone downloads 70-110 GB. And the size menu shows each size's real routed-expert bits.

./setup.sh --inspect ms:unsloth/Qwen3.8-Flash-Next-GGUF UD-Q2_K_XL      # ModelScope (hf:owner/repo for Hugging Face)
./setup.sh --inspect /data/models/some-file-00001-of-00002.gguf          # a file or a folder; a URL works too

It prints every weight group's parameters, size, real bits per weight and storage types (shares of bytes), then one of:

  • known: the routed experts, the tensor count and the bytes match a file setup installs: "this is setup's
    --family qwen --model IQ3_XXS" (under any file name, e.g. a renamed or re-uploaded copy);
  • same layout: the routed experts are stored exactly as in a known file, the rest differs (a fine-tune with the
    same recipe): "may run as that size; not tested";
  • no: another architecture, or routed experts in a format no file Strata runs uses (e.g. Unsloth's UD-IQ1_S: IQ1_S);
  • untested: experts in known formats, but not a file setup installs; it names every tensor stored in a format no
    known file has for it.

The menu line becomes e.g. 1) Q2_0 2-bit, the fastest; download 66 GB, uses ~34 GB of RAM, experts 2.25 bits/weight
(IQ2_XS 2.35, IQ3_XXS 2.84, IQ3_S 3.33, Coder IQ1_M 3.33 over its kept experts, UD-IQ4_XS 3.94, UD-Q4_K_XL 5.10).

How

  • tools/quantscope.py: the header reader (GGUF, safetensors; ModelScope / Hugging Face / URL / local, HTTP range
    requests, standard library only), from https://github.com/1872183316/quantscope (dual-licensed MIT OR Apache-2.0,
    so it can be MIT here), with ggml type 42 named Q2_0.
  • tools/strata_inspect.py: the comparison, and --fingerprints OUT to rebuild the table.
  • data/gguf_fingerprints.json (8.6 KB): the 10 files setup installs, read from ModelScope's copies on 2026-10-05:
    architecture, tensor count, bytes, routed-expert bytes per type, and, per tensor role, the types any of them use.
  • setup.py: --inspect runs the tool and exits; expert_bits() for the menu (no network at install time).

One thing to confirm

SUPPORTED_GGUFS says Unsloth's UD-IQ3_XXS and UD-Q2_K_XL cannot be used. From the headers, their routed experts use
only formats the known files use (UD-Q2_K_XL: IQ2_XS, IQ3_XXS, IQ4_NL); what differs is output.weight (Q4_K) and
token_embd.weight (Q5_K; UD-IQ3_XXS: Q6_K). So --inspect says "untested" and names those two, rather than "no".
If the engine refuses those head / embedding formats, a line in strata_inspect.py can turn that into "no"; I did not
try to run either file.

Tests

tools/test_strata_inspect.py (5, offline, on the fingerprint table): every installed file is known, a changed size is
"same layout", another architecture and an unknown expert format are "no", and an untested file names exactly its new
tensors. All tools/test_setup_*.py pass (the menu line is printed by the golden tests).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/911 **Author:** [@star1872](https://github.com/star1872) **Created:** 10/5/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `setup-inspect` --- ### 📝 Commits (10+) - [`fa16567`](https://github.com/Niko1221/Strata/commit/fa165679f9860552ac97ebd07118bb8db286be4a) setup: an earlier config that does not parse is skipped, not a crash; configs are written atomically (#459) - [`749d957`](https://github.com/Niko1221/Strata/commit/749d957a1790b1a171dd4a01ab3e31b3882c9892) setup (--backend hip): a system ROCm without the HIP development files falls back to the wheels (#446) - [`5a30024`](https://github.com/Niko1221/Strata/commit/5a3002446dbb9dfcabb7d0bd9f113da90cc2f3c0) calibrate: the engine's arguments come from the server's engine_args; a failed tuning says why (#447) - [`9f60d13`](https://github.com/Niko1221/Strata/commit/9f60d13246e46b02b1dd0841980b4d18b0faaea7) serve, setup: name the small split card that caps the prompt chunk; setup recommends the big card alone (#448) - [`eb8da1d`](https://github.com/Niko1221/Strata/commit/eb8da1d8c26ec41e6ffb084fdf579dba7cad10bd) /metrics: each request's speculative draft counts, and their sums in the totals (#457) - [`6a09387`](https://github.com/Niko1221/Strata/commit/6a093874fe037020f49bd5cf053879ff6a133c21) setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444) - [`d6a91e2`](https://github.com/Niko1221/Strata/commit/d6a91e2d1770d0f469d6ec15890acc7ee93e764c) docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438) - [`d8d4ad3`](https://github.com/Niko1221/Strata/commit/d8d4ad337d3c98ba21d3bd0af1a16e9177e112b6) Merge branch 'f-135-eng' into rel-0.1.35 - [`7b600d5`](https://github.com/Niko1221/Strata/commit/7b600d55ff801caaaa11542af1523050992e049b) Merge branch 'f-135-small' into rel-0.1.35 - [`d9ab843`](https://github.com/Niko1221/Strata/commit/d9ab8435f654c368c586340d490915f6addf56a3) Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it ### 📊 Changes **6 files changed** (+1094 additions, -2 deletions) <details> <summary>View changed files</summary> ➕ `data/gguf_fingerprints.json` (+436 -0) 📝 `docs/INSTALL.md` (+7 -1) 📝 `setup.py` (+19 -1) ➕ `tools/quantscope.py` (+394 -0) ➕ `tools/strata_inspect.py` (+175 -0) ➕ `tools/test_strata_inspect.py` (+63 -0) </details> ### 📄 Description `--inspect SOURCE [VARIANT]` says what a GGUF really holds and whether Strata runs it, from its headers only (a few MB, also over the network), before anyone downloads 70-110 GB. And the size menu shows each size's real routed-expert bits. ``` ./setup.sh --inspect ms:unsloth/Qwen3.8-Flash-Next-GGUF UD-Q2_K_XL # ModelScope (hf:owner/repo for Hugging Face) ./setup.sh --inspect /data/models/some-file-00001-of-00002.gguf # a file or a folder; a URL works too ``` It prints every weight group's parameters, size, real bits per weight and storage types (shares of bytes), then one of: - **known**: the routed experts, the tensor count and the bytes match a file setup installs: "this is setup's --family qwen --model IQ3_XXS" (under any file name, e.g. a renamed or re-uploaded copy); - **same layout**: the routed experts are stored exactly as in a known file, the rest differs (a fine-tune with the same recipe): "may run as that size; not tested"; - **no**: another architecture, or routed experts in a format no file Strata runs uses (e.g. Unsloth's UD-IQ1_S: IQ1_S); - **untested**: experts in known formats, but not a file setup installs; it names every tensor stored in a format no known file has for it. The menu line becomes e.g. `1) Q2_0 2-bit, the fastest; download 66 GB, uses ~34 GB of RAM, experts 2.25 bits/weight` (IQ2_XS 2.35, IQ3_XXS 2.84, IQ3_S 3.33, Coder IQ1_M 3.33 over its kept experts, UD-IQ4_XS 3.94, UD-Q4_K_XL 5.10). ## How - `tools/quantscope.py`: the header reader (GGUF, safetensors; ModelScope / Hugging Face / URL / local, HTTP range requests, standard library only), from https://github.com/1872183316/quantscope (dual-licensed MIT OR Apache-2.0, so it can be MIT here), with ggml type 42 named Q2_0. - `tools/strata_inspect.py`: the comparison, and `--fingerprints OUT` to rebuild the table. - `data/gguf_fingerprints.json` (8.6 KB): the 10 files setup installs, read from ModelScope's copies on 2026-10-05: architecture, tensor count, bytes, routed-expert bytes per type, and, per tensor role, the types any of them use. - `setup.py`: `--inspect` runs the tool and exits; `expert_bits()` for the menu (no network at install time). ## One thing to confirm `SUPPORTED_GGUFS` says Unsloth's UD-IQ3_XXS and UD-Q2_K_XL cannot be used. From the headers, their routed experts use only formats the known files use (UD-Q2_K_XL: IQ2_XS, IQ3_XXS, IQ4_NL); what differs is `output.weight` (Q4_K) and `token_embd.weight` (Q5_K; UD-IQ3_XXS: Q6_K). So `--inspect` says "untested" and names those two, rather than "no". If the engine refuses those head / embedding formats, a line in `strata_inspect.py` can turn that into "no"; I did not try to run either file. ## Tests `tools/test_strata_inspect.py` (5, offline, on the fingerprint table): every installed file is known, a changed size is "same layout", another architecture and an unknown expert format are "no", and an untested file names exactly its new tensors. All `tools/test_setup_*.py` pass (the menu line is printed by the golden tests). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:04:06 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2912
No description provided.