quantprobe 1.27.0__tar.gz → 1.28.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {quantprobe-1.27.0 → quantprobe-1.28.1}/PKG-INFO +65 -5
- quantprobe-1.27.0/quantprobe.egg-info/PKG-INFO → quantprobe-1.28.1/README.md +334 -292
- {quantprobe-1.27.0 → quantprobe-1.28.1}/pyproject.toml +31 -31
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/__init__.py +11 -11
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/calibrate.py +33 -6
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/cli.py +12 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/detect.py +143 -27
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/ollama.py +337 -314
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/plan.py +110 -15
- quantprobe-1.28.1/quantprobe/recipes/qwen3.8-27b.json +52 -0
- quantprobe-1.28.1/quantprobe/report.py +924 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/spec.py +26 -2
- quantprobe-1.27.0/README.md → quantprobe-1.28.1/quantprobe.egg-info/PKG-INFO +82 -4
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe.egg-info/SOURCES.txt +2 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/LICENSE +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/__main__.py +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/auto.py +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/branding.py +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/dashboard.py +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/fetch.py +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/optimize.py +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/probe.py +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/recipes/mistral-7b.json +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/recipes/qwen2.5-7b.json +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/recipes/qwen3-30b.json +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/recipes/qwen3.5-35b.json +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/recipes.py +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/runtime.py +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe/target.py +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe.egg-info/dependency_links.txt +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe.egg-info/entry_points.txt +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe.egg-info/requires.txt +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/quantprobe.egg-info/top_level.txt +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/setup.cfg +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/tests/test_engine.py +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/tests/test_evaluator.py +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/tests/test_pipeline.py +0 -0
- {quantprobe-1.27.0 → quantprobe-1.28.1}/tests/test_transforms.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: quantprobe
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.28.1
|
|
4
4
|
Summary: Probe-then-quantize for LLMs: measure a model's fragility curve, plan bit/tier placement by the tiered decode law, and emit ready-to-run llama.cpp recipes.
|
|
5
5
|
Author: Federico Sciuca
|
|
6
6
|
License: MIT
|
|
@@ -24,7 +24,15 @@ Dynamic: license-file
|
|
|
24
24
|
|
|
25
25
|
<p align="center"><em>the bar is the probe: one column through the memory tiers it prices — VRAM, RAM, disk.</em></p>
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
### Will this model run on my machine, and how fast?
|
|
28
|
+
|
|
29
|
+
**Answered in one second, before you download anything — then rebuilt so it runs better.**
|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
<img src="media/pipeline.png" width="900" alt="Six stages: probe, rebuild, place, run, serve, prove — each with a measured number">
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
Most tools help you pick a quantization someone else built. This one **measures your model, then builds a file that exists only for your hardware** — it probes each layer to find where the model actually breaks, protects that band and crushes the rest, places the result across VRAM/RAM/disk, emits the exact llama.cpp command (or launches it for you with `quantprobe auto`), and then proves the result: speed re-measured on demand, quality scored by KL divergence, the config put through **40 machine-checked business tasks**, and every `bench --contribute` run feeding a public [validation atlas](docs/HARDWARE_TABLE.md). Because **every claim here was pre-registered before measurement, and the misses are published at the same size as the hits.**
|
|
28
36
|
|
|
29
37
|
[**Quickstart**](#quickstart) · [**Browser version**](https://federicots.github.io/quantprobe/) · [**What runs on what**](docs/MATRIX.md) · [**Commands**](#commands) · [**The laws**](LAWS.md) · [**When it won't help**](#when-quantprobe-wont-help-you)
|
|
30
38
|
|
|
@@ -32,6 +40,12 @@ Predicts how fast an LLM will run on your machine — **before you download it**
|
|
|
32
40
|
|
|
33
41
|
**Validated, not vibes.** 14-model ladder at **8.4% median error** on measured hardware · every printed all-in-VRAM number a documented **floor** (real speed ≥0.90× on 13/13 benchmarks, typically 1.1–1.8× higher) · retrodicts third-party results it never trained on ([airllm's 30× spread, DGX Spark reports, a 1.56 TB Kimi rig](docs/MATRIX.md)) · **every prediction staked before measuring, and the misses published at the same size as the hits.**
|
|
34
42
|
|
|
43
|
+
<p align="center">
|
|
44
|
+
<img src="media/prediction_vs_reality.png" width="820" alt="Predicted vs measured tok/s, log-log: the 14-model ladder, two out-of-sample external GPUs, and the -67% disk-tier miss plotted at full size">
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
The miss is on the chart at the same size as the hits, because that is the only version of this plot worth trusting.
|
|
48
|
+
|
|
35
49
|
## Quickstart
|
|
36
50
|
|
|
37
51
|
```bash
|
|
@@ -52,11 +66,12 @@ quantprobe plan - Qwen3-30B-A3B @ 2.5-bit on THIS machine [auto-detected]
|
|
|
52
66
|
13.2 tok/s pure CPU (GPU idle) [RAM boundary - expect bimodal speed]
|
|
53
67
|
|
|
54
68
|
binding constraint: BANDWIDTH-BOUND (system RAM bandwidth) - 51% of every decode token is spent there.
|
|
69
|
+
validation derived from the law, not confirmed by variance attribution (prereg #95 - …)
|
|
55
70
|
|
|
56
71
|
run it: llama-server -m model.gguf -ngl 99 -ot "blk\.(16|17|…|47)\.ffn_.*_exps\.=CPU" --no-mmap -b 1024 -ub 1024 --threads 4
|
|
57
72
|
```
|
|
58
73
|
|
|
59
|
-
The first line is what a fresh install prints. The `calibration applied` and `anchored:` lines appear after you run `quantprobe calibrate` once — measured constants and your own anchor runs, not spec sheets. The **binding constraint** line is the part most tools never tell you: *3 tok/s, disk-bound* means buy RAM; *3 tok/s, bandwidth-bound* means don't bother.
|
|
74
|
+
The first line is what a fresh install prints. The `calibration applied` and `anchored:` lines appear after you run `quantprobe calibrate` once — measured constants and your own anchor runs, not spec sheets. The **binding constraint** line is the part most tools never tell you: *3 tok/s, disk-bound* means buy RAM; *3 tok/s, bandwidth-bound* means don't bother. And it now carries its own scope label, because we tested it the hard way: [prereg #95](preregistrations/2026-08-07-doe-flag-screening.md)'s variance-attribution arm did **not** confirm the flag-level mapping (the placement lever carried the variance, decided 1000/1000) — so every classification prints *"derived from the law, not confirmed by variance attribution"* until a re-derivation earns the confirmation. The time decomposition itself is untouched arithmetic; the label prices exactly what isn't measured.
|
|
60
75
|
|
|
61
76
|
**Downloads nothing. Takes a second.** No hardware flags needed — it reads your machine. `--model` and `--bits` just say what you're considering; point it at a file you already have with `--gguf model.gguf` instead.
|
|
62
77
|
|
|
@@ -76,12 +91,28 @@ One pipeline, end to end — most tools ship the first line only:
|
|
|
76
91
|
- **Anchors predictions to *your* machine** — run `quantprobe calibrate` once and two benchmark runs on your own GGUF scale every prediction. That path passed the gate it pre-registered before any number existed (prereg #64): leave-one-out median error **19% → 5.8%** across 5 arms; ~12% median on the full ladder, misses erring low. `--no-anchors` restores the plain law.
|
|
77
92
|
- **Emits the exact command**, including the `-ot` regex most guides get wrong.
|
|
78
93
|
- **Finds free speed in what you already have** — [partial expert offload](#free-speed-you-probably-already-have) and [prompt-lookup speculation](#free-speed-part-two-if-you-write-code) need no new download.
|
|
79
|
-
- **Builds layer-aware quantizations** — measures which layers of *your* model break under compression, then protects them (−9% perplexity at the same file size).
|
|
94
|
+
- **Builds layer-aware quantizations** — measures which layers of *your* model break under compression, then protects them (−9% perplexity at the same file size). [Why a recipe cannot be reused ↓](#why-your-model-needs-its-own-recipe)
|
|
80
95
|
- **Audits a running Ollama install** — `quantprobe audit-ollama` reads the placement Ollama actually chose, prices it against the planner's, and refuses to compare while VRAM is contended (a measurement discipline most benchmarks skip).
|
|
81
96
|
- **Proves quality, not just speed** — perplexity *and* full-distribution KL divergence via llama.cpp's own `--kl-divergence`, because we measured perplexity moving 23% while the model changed its chosen token on 27% of positions.
|
|
82
97
|
- **Tells you when to stop** — it declines the expensive path on machines that don't need it.
|
|
83
98
|
- Runs on stock [llama.cpp](https://github.com/ggml-org/llama.cpp). No custom runtime, nothing to build.
|
|
84
99
|
|
|
100
|
+
## Why your model needs its own recipe
|
|
101
|
+
|
|
102
|
+
<p align="center">
|
|
103
|
+
<img src="media/fragility_fingerprint.png" width="860" alt="Perplexity cost of quantizing each band of layers: Mistral breaks at the front (27x), every Qwen breaks at the back">
|
|
104
|
+
</p>
|
|
105
|
+
|
|
106
|
+
The fragile layers **move between models**. Mistral-7B breaks at the *front* — its first eight layers cost **27× more** perplexity than its median band — while Qwen2.5-7B, Qwen3-30B and Qwen3.5-35B all break at the *back*. Architecture family does not predict it; weight statistics point the wrong way. Protect the wrong band and you spend bits where they buy nothing, which is why `quantprobe probe` measures **your** model before `quantprobe quantize` builds anything. Raw bands: [`quantprobe/recipes/`](quantprobe/recipes/).
|
|
107
|
+
|
|
108
|
+
And the payoff, at **equal file size** (+0.48%, inside the staked ±2% gate):
|
|
109
|
+
|
|
110
|
+
<p align="center">
|
|
111
|
+
<img src="media/depth_vs_uniform.png" width="860" alt="Same bytes, better model: perplexity -13.2%, KL divergence -39.6%, same-top-token +5.13 points, decode +6.6%">
|
|
112
|
+
</p>
|
|
113
|
+
|
|
114
|
+
Bytes are the budget; *where the protection goes* is the treatment. The speed panel carries a **staked miss** — we predicted decode would be unchanged (±3%) and it came in +6.6% faster, which is a good outcome and a failed prediction, published at the same size as the wins. Full stake and verdict: [prereg 2026-08-04](preregistrations/2026-08-04-a2a-depth-aware-vs-uniform.md).
|
|
115
|
+
|
|
85
116
|
## Does the cheap quant actually do the work?
|
|
86
117
|
|
|
87
118
|
Speed numbers are worthless if the model can't do the job. So we staked a bar **before generating a single output** — ≥80% of machine-checked tasks or the config is business-useful; under 60% and every tok/s figure we publish gets qualified — and ran the recommended 2.5-bit 30B through **40 auto-scored business tasks**: JSON extraction with exact values, arithmetic to the cent, single-label classification, code that must execute and pass assertions, summaries where **any number not present in the source fails a deterministic hallucination check**.
|
|
@@ -235,6 +266,7 @@ mechanisms we tested and the one that survived: [CHANGELOG](CHANGELOG.md).
|
|
|
235
266
|
```bash
|
|
236
267
|
quantprobe auto # interactive: detects, asks, decides, runs
|
|
237
268
|
quantprobe plan --gguf model.gguf # predicted tok/s + placement + launch command
|
|
269
|
+
quantprobe report --gguf model.gguf # one page to forward: verdict, what binds, quality - every number labeled
|
|
238
270
|
quantprobe hw # what the law sees on THIS machine
|
|
239
271
|
quantprobe calibrate # measure, don't assume: RAM stream, disk, GPU clocks; optional anchor runs
|
|
240
272
|
quantprobe run --gguf model.gguf # plan the placement, then launch chat
|
|
@@ -255,10 +287,33 @@ quantprobe dashboard --gguf 2bit.gguf # the law live, every r
|
|
|
255
287
|
```
|
|
256
288
|
</details>
|
|
257
289
|
|
|
258
|
-
`hw`/`plan`/`target`/`optimize` need nothing but Python. The weight-touching commands drive stock llama.cpp — point at it with `--llama-dir`, `QUANTPROBE_LLAMA_DIR`, or `PATH`, and preview anything with `--dry`. 17 machine presets ship in (`--machine`); multi-GPU and RAID aggregate with comma lists (`--vram 24,24`).
|
|
290
|
+
`hw`/`plan`/`report`/`target`/`optimize` need nothing but Python. The weight-touching commands drive stock llama.cpp — point at it with `--llama-dir`, `QUANTPROBE_LLAMA_DIR`, or `PATH`, and preview anything with `--dry`. 17 machine presets ship in (`--machine`); multi-GPU and RAID aggregate with comma lists (`--vram 24,24`).
|
|
259
291
|
|
|
260
292
|
> **Windows: `'quantprobe' is not recognized`?** pip put it in a folder that isn't on your PATH. Use `python -m quantprobe ...` — identical, always works.
|
|
261
293
|
|
|
294
|
+
### Reports
|
|
295
|
+
|
|
296
|
+
`plan` answers you at the terminal. `quantprobe report` writes that answer as **one Markdown file meant to be forwarded** — to the IT manager sizing a hardware buy, the consultant's client, the ISV writing hardware requirements. The reader it is built for will never run the tool, so the file carries what the terminal session would have told them: every number labeled **[measured]** / **[derived]** / **[est]** / **UNVALIDATED** on the line or block it qualifies — never only in a footnote — the verdict speeds spelled **PREDICTED** or **[measured]** in so many words, and a mandatory scope block, because the person who could explain the caveats is not in the room. It is a renderer over the same engine `plan` runs, so the two cannot disagree about the same file.
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
quantprobe report --gguf Qwen3.8-27B-Q4_K_M.gguf --machine 2016-xmp --bench-log qwen38_bench.log
|
|
300
|
+
# reads the GGUF header (~10 s on this 17 GB file), downloads nothing, launches nothing -
|
|
301
|
+
# prints the path of the file it wrote
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
`--bench-log` quotes a llama-bench run you already made next to the prediction. The file opens with the verdict:
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
## Verdict
|
|
308
|
+
|
|
309
|
+
PREDICTED decode speed, one user: 1.8 tok/s (band 1.4 - 2.3) [derived]
|
|
310
|
+
MEASURED on this machine: 2.04 +/- 0.02 tok/s (llama-bench) [measured]
|
|
311
|
+
The measurement is 1.11x the prediction - inside the +/-25% band, on the side
|
|
312
|
+
our misses err (low).
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
Then the placements, the binding constraint with its per-lever ceilings ("faster storage / NVMe: NO effect"), the exact llama.cpp command, and what the quant costs in quality — including UNVALIDATED said in exactly that word where no measurement covers the model's size. Full contract and a complete example report: [docs/DESIGN_REPORT_CMD.md](docs/DESIGN_REPORT_CMD.md).
|
|
316
|
+
|
|
262
317
|
## Contributing
|
|
263
318
|
|
|
264
319
|
`quantprobe bench --contribute` prints exactly what would be shared plus a pre-filled issue link — **you review and submit; nothing is ever sent automatically.** Points that land *outside* the predicted bands are the most valuable ones, and there are [open predictions](preregistrations/) anyone can settle.
|
|
@@ -273,11 +328,14 @@ quantprobe dashboard --gguf 2bit.gguf # the law live, every r
|
|
|
273
328
|
| [docs/ATLAS.md](docs/ATLAS.md) | **every machine the law has been scored on** — and the one command that adds yours |
|
|
274
329
|
| [docs/EXAMPLES.md](docs/EXAMPLES.md) | worked examples with real output, including the ×5.4 optimizer A/B |
|
|
275
330
|
| [docs/HARDWARE.md](docs/HARDWARE.md) | the 2016 box: exact specs, measured bandwidths, what the next euro buys |
|
|
331
|
+
| [docs/HARDWARE_TABLE.md](docs/HARDWARE_TABLE.md) | every GPU the tool can name, with its validation status: measured / external / spec-only |
|
|
276
332
|
| [preregistrations/](preregistrations/) | every staked prediction with its verdict — hits **and** misses |
|
|
277
333
|
| [MACHINE_LADDER.md](MACHINE_LADDER.md) | every model four ways — naive default / informed llama.cpp / quantprobe / staked prediction — including the v1.20.2 accuracy correction |
|
|
278
334
|
| [weights/business_tasks.py](weights/business_tasks.py) | the 52-task suite: 40 staked + T3/T4 ladder, every check executable, self-testing |
|
|
279
335
|
| [CONTRIBUTING.md](CONTRIBUTING.md) | the method: stake, measure, score *and wire*, audit |
|
|
280
336
|
| [docs/DEEP-DIVE.md](docs/DEEP-DIVE.md) | what's new vs. built-on, parity tables, and the repository map |
|
|
337
|
+
| [docs/QUANT_QUALITY.md](docs/QUANT_QUALITY.md) | **does the recipe preserve capability, not just perplexity?** — naive vs recipe vs original on MATH-500/GSM8K/IFEval; the size-dependence law; fragility survives hybrid linear attention |
|
|
338
|
+
| [docs/DESIGN_REPORT_CMD.md](docs/DESIGN_REPORT_CMD.md) | **the `report` file's contract** — the four labels every number must carry, the two ways a forwarded page misleads a decision-maker and the exact wording that prevents them, a complete worked report |
|
|
281
339
|
| [papers/arxiv/](papers/arxiv/) | the paper (submission-ready LaTeX) |
|
|
282
340
|
| [CHANGELOG.md](CHANGELOG.md) | every release, including corrections to numbers published here |
|
|
283
341
|
|
|
@@ -285,6 +343,8 @@ quantprobe dashboard --gguf 2bit.gguf # the law live, every r
|
|
|
285
343
|
|
|
286
344
|
[colibri](https://github.com/JustVugg/colibri) (744B on 25 GB, pure C) inspired the tier-streaming exploration. The quantization stack builds on [llama.cpp](https://github.com/ggml-org/llama.cpp) and the QTIP/QuIP# incoherence codecs — whose central tool our first law bounds. Independent research by Federico Sciuca, AI-supported, on one desktop.
|
|
287
345
|
|
|
346
|
+
**[bigattichouse](https://github.com/bigattichouse)** builds [llama-optimize](https://github.com/bigattichouse/llama-optimize) and [robust](https://github.com/bigattichouse/robust) — llama.cpp flag tuning by Design of Experiments, on a general Morris/Sobol/Taguchi toolkit written in C and released to the public domain. Two things came from reading them (register E-16, prereg #95): independent convergence on machine-state hygiene — their runner settles GPU temperature between runs and records it, which is the same conclusion our stuck-boost result reached the hard way — and a method we did not have. Morris screening ranks which knobs actually matter and flags which interact; Sobol variance attribution will check our binding-constraint classifier against measured variance for the first time. Their tool searches because it knows nothing about the machine in advance; ours predicts. The two compose.
|
|
347
|
+
|
|
288
348
|
Two community contributors changed the tool measurably: **u/RogerAI--fyi** (Reddit) observed that the Law 4 formulation omitted per-token KV reads — measured, confirmed, shipped within a day. **u/MoneroApe** pointed me at [apex-quant](https://github.com/localai-org/apex-quant) and TurboQuant, and testing against **mudler's APEX** exposed two real gaps in my recipe: unprotected always-active tensors (their kurtosis argument, adopted here) and no importance-matrix calibration at all. MoneroApe then ran the first external replication (RTX 3090 + a 117.6B MoE, register E-06): it exposed five real defects in the shipped tool — the 2× channel-count error, the ubatch cap, a missing pinned-memory warning, a missing `--threads`, the buried speculation note — all fixed in v1.19 with tests named after the report, and `quantprobe calibrate` exists because of it.
|
|
289
349
|
|
|
290
350
|
## License
|