quantprobe 1.5.0__tar.gz → 1.5.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.
Files changed (27) hide show
  1. {quantprobe-1.5.0/quantprobe.egg-info → quantprobe-1.5.1}/PKG-INFO +2 -1
  2. {quantprobe-1.5.0 → quantprobe-1.5.1}/README.md +1 -0
  3. {quantprobe-1.5.0 → quantprobe-1.5.1}/pyproject.toml +1 -1
  4. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe/__init__.py +1 -1
  5. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe/auto.py +67 -2
  6. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe/cli.py +1 -0
  7. {quantprobe-1.5.0 → quantprobe-1.5.1/quantprobe.egg-info}/PKG-INFO +2 -1
  8. {quantprobe-1.5.0 → quantprobe-1.5.1}/LICENSE +0 -0
  9. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe/dashboard.py +0 -0
  10. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe/detect.py +0 -0
  11. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe/fetch.py +0 -0
  12. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe/optimize.py +0 -0
  13. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe/plan.py +0 -0
  14. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe/probe.py +0 -0
  15. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe/runtime.py +0 -0
  16. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe/spec.py +0 -0
  17. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe/target.py +0 -0
  18. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe.egg-info/SOURCES.txt +0 -0
  19. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe.egg-info/dependency_links.txt +0 -0
  20. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe.egg-info/entry_points.txt +0 -0
  21. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe.egg-info/requires.txt +0 -0
  22. {quantprobe-1.5.0 → quantprobe-1.5.1}/quantprobe.egg-info/top_level.txt +0 -0
  23. {quantprobe-1.5.0 → quantprobe-1.5.1}/setup.cfg +0 -0
  24. {quantprobe-1.5.0 → quantprobe-1.5.1}/tests/test_engine.py +0 -0
  25. {quantprobe-1.5.0 → quantprobe-1.5.1}/tests/test_evaluator.py +0 -0
  26. {quantprobe-1.5.0 → quantprobe-1.5.1}/tests/test_pipeline.py +0 -0
  27. {quantprobe-1.5.0 → quantprobe-1.5.1}/tests/test_transforms.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantprobe
3
- Version: 1.5.0
3
+ Version: 1.5.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
@@ -96,6 +96,7 @@ quantprobe auto qwen3-coder --tps 15 --run # empty machine -> optimal quant ch
96
96
 
97
97
  ```bash
98
98
  quantprobe auto qwen3-30b --tps 15 # ONE command: optimizer picks bits, closest quant fetched, run command printed
99
+ quantprobe auto qwen3-30b --custom # THE PRODUCT: probe YOUR model, build its personalized depth-aware GGUF
99
100
  quantprobe hw # what the law sees on THIS machine (every value source-tagged)
100
101
  quantprobe plan --gguf model.gguf # zero-config prediction: placement + tok/s + the launch command
101
102
  quantprobe optimize --tps 20 # CHEAPEST PATH to a target: bits x placement x hardware, Pareto-ranked
@@ -78,6 +78,7 @@ quantprobe auto qwen3-coder --tps 15 --run # empty machine -> optimal quant ch
78
78
 
79
79
  ```bash
80
80
  quantprobe auto qwen3-30b --tps 15 # ONE command: optimizer picks bits, closest quant fetched, run command printed
81
+ quantprobe auto qwen3-30b --custom # THE PRODUCT: probe YOUR model, build its personalized depth-aware GGUF
81
82
  quantprobe hw # what the law sees on THIS machine (every value source-tagged)
82
83
  quantprobe plan --gguf model.gguf # zero-config prediction: placement + tok/s + the launch command
83
84
  quantprobe optimize --tps 20 # CHEAPEST PATH to a target: bits x placement x hardware, Pareto-ranked
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "quantprobe"
7
- version = "1.5.0"
7
+ version = "1.5.1"
8
8
  description = "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."
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -8,4 +8,4 @@ Three commands, all grounded in measured laws (see LAWS.md in the repo):
8
8
  Every constant in `plan` is fitted from measurements published in the repo, including two
9
9
  pre-registered hardware predictions confirmed within 8%.
10
10
  """
11
- __version__ = "1.5.0"
11
+ __version__ = "1.5.1"
@@ -37,6 +37,37 @@ def list_ggufs(repo):
37
37
  and "mmproj" not in f["path"].lower() and "draft" not in f["path"].lower()]
38
38
 
39
39
 
40
+ WIKI_URL = "https://huggingface.co/datasets/ggml-org/ci/resolve/main/wikitext-2-raw-v1.zip"
41
+
42
+
43
+ def ensure_eval(dest_dir):
44
+ """The held-out corpus for probing, fetched once (1.3 MB)."""
45
+ import os, zipfile, io
46
+ path = os.path.join(dest_dir, "wiki.test.raw")
47
+ if os.path.isfile(path):
48
+ return path
49
+ print("[quantprobe auto] fetching the WikiText-2 eval corpus (1.3 MB, one time)...")
50
+ with urllib.request.urlopen(WIKI_URL, timeout=60) as r:
51
+ z = zipfile.ZipFile(io.BytesIO(r.read()))
52
+ with z.open("wikitext-2-raw/wiki.test.raw") as f, open(path, "wb") as out:
53
+ out.write(f.read())
54
+ return path
55
+
56
+
57
+ def pick_source(files, t):
58
+ """High-precision source for the custom build: prefer Q8-class (smallest requantizable), else max bits."""
59
+ cands = []
60
+ for path, size in files:
61
+ if "-of-" in path.lower():
62
+ continue # split multi-part files: out of scope for v1
63
+ bits = size * 8 / (t * 1e9)
64
+ cands.append((bits, size, path))
65
+ if not cands:
66
+ return None
67
+ hi = sorted([c for c in cands if c[0] >= 7.5], key=lambda c: c[1])
68
+ return hi[0] if hi else max(cands)
69
+
70
+
40
71
  def run(a):
41
72
  target = a.target
42
73
  if target in MODEL_REPOS:
@@ -79,6 +110,40 @@ def run(a):
79
110
  raise SystemExit("no usable quant in that repo for this machine")
80
111
  scored.sort()
81
112
  _, _, path, size, bits, best = scored[0]
113
+
114
+ if getattr(a, "custom", False):
115
+ src = pick_source(files, t)
116
+ if not src:
117
+ raise SystemExit("no usable high-precision source in that repo (split files unsupported)")
118
+ sbits, ssize, spath = src
119
+ import os
120
+ dest = getattr(a, "dir", None) or "./models"
121
+ os.makedirs(dest, exist_ok=True)
122
+ print("\n[quantprobe auto --custom] source: " + spath + f" ({ssize/1e9:.1f} GB, {sbits:.1f}-bit)")
123
+ print(" pipeline: fetch source -> probe the fragile band (~30-60 min) -> build the")
124
+ print(" depth-aware GGUF. Interrupt anytime; the fetch resumes.")
125
+ if getattr(a, "dry", False):
126
+ print(" (--dry: nothing downloaded)")
127
+ return spath
128
+ from . import fetch as fetchmod
129
+ if not fetchmod.fetch(repo, dest, spath, fetchmod.token()):
130
+ raise SystemExit("source download failed (re-run: it resumes)")
131
+ srcfull = os.path.join(dest, os.path.basename(spath))
132
+ evalf = ensure_eval(dest)
133
+ from . import probe as probemod
134
+ import argparse
135
+ out = os.path.join(dest, os.path.basename(spath).rsplit(".gguf", 1)[0] + "-depthaware.gguf")
136
+ pa = argparse.Namespace(gguf=srcfull, bands=4, chunks=32, eval=evalf, ngl=99,
137
+ workdir=dest, llama_dir=getattr(a, "llama_dir", None),
138
+ apply=True, out=out, dry_run=False)
139
+ probemod.run(pa)
140
+ print("\n[quantprobe auto --custom] your personalized model:")
141
+ print(" quantprobe run --gguf " + out)
142
+ if getattr(a, "run", False):
143
+ from . import runtime
144
+ a.gguf = out; a.bits = None
145
+ runtime.run(a)
146
+ return out
82
147
  print(f"\n[quantprobe auto] optimizer wants ~{want_bits:g}-bit; closest file in {repo}:")
83
148
  print(f" {path} ({size/1e9:.1f} GB, {bits:.2f} effective bits)")
84
149
  print(f" predicted on this machine: {best[1]:.1f} tok/s ({best[0]})")
@@ -96,8 +161,8 @@ def run(a):
96
161
  full = os.path.join(dest, os.path.basename(path))
97
162
  print(f"\n[quantprobe auto] ready. Run it:")
98
163
  print(f" quantprobe run --gguf {full}")
99
- print(f"\n Want better quality at the SAME size? That's the custom path (the actual product):")
100
- print(f" fetch the f16, then: quantprobe probe --gguf <f16>.gguf --eval wiki.test.raw --apply")
164
+ print("\n Better quality at the SAME size: rerun with --custom - it probes YOUR model's")
165
+ print(" fragile band (~30-60 min) and builds a depth-aware GGUF personalized to it.")
101
166
  if getattr(a, "run", False):
102
167
  from . import runtime
103
168
  a.gguf = full
@@ -99,6 +99,7 @@ def main():
99
99
  au.add_argument("--tps", type=float, default=None, help="target tok/s for the optimizer")
100
100
  au.add_argument("--max-quality", type=float, default=None)
101
101
  au.add_argument("--allow-prune", action="store_true"); au.add_argument("--any-runtime", action="store_true")
102
+ au.add_argument("--custom", action="store_true", help="THE PRODUCT: fetch a high-precision source, probe YOUR model (~30-60 min), build a depth-aware GGUF personalized to it")
102
103
  au.add_argument("--serve", action="store_true", help="with --run: llama-server instead of chat")
103
104
  au.add_argument("--extra", default=None)
104
105
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantprobe
3
- Version: 1.5.0
3
+ Version: 1.5.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
@@ -96,6 +96,7 @@ quantprobe auto qwen3-coder --tps 15 --run # empty machine -> optimal quant ch
96
96
 
97
97
  ```bash
98
98
  quantprobe auto qwen3-30b --tps 15 # ONE command: optimizer picks bits, closest quant fetched, run command printed
99
+ quantprobe auto qwen3-30b --custom # THE PRODUCT: probe YOUR model, build its personalized depth-aware GGUF
99
100
  quantprobe hw # what the law sees on THIS machine (every value source-tagged)
100
101
  quantprobe plan --gguf model.gguf # zero-config prediction: placement + tok/s + the launch command
101
102
  quantprobe optimize --tps 20 # CHEAPEST PATH to a target: bits x placement x hardware, Pareto-ranked
File without changes
File without changes