quantprobe 1.6.2__tar.gz → 1.6.3__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 (28) hide show
  1. {quantprobe-1.6.2/quantprobe.egg-info → quantprobe-1.6.3}/PKG-INFO +1 -1
  2. {quantprobe-1.6.2 → quantprobe-1.6.3}/pyproject.toml +1 -1
  3. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe/__init__.py +1 -1
  4. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe/probe.py +18 -4
  5. {quantprobe-1.6.2 → quantprobe-1.6.3/quantprobe.egg-info}/PKG-INFO +1 -1
  6. {quantprobe-1.6.2 → quantprobe-1.6.3}/LICENSE +0 -0
  7. {quantprobe-1.6.2 → quantprobe-1.6.3}/README.md +0 -0
  8. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe/__main__.py +0 -0
  9. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe/auto.py +0 -0
  10. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe/cli.py +0 -0
  11. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe/dashboard.py +0 -0
  12. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe/detect.py +0 -0
  13. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe/fetch.py +0 -0
  14. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe/optimize.py +0 -0
  15. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe/plan.py +0 -0
  16. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe/runtime.py +0 -0
  17. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe/spec.py +0 -0
  18. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe/target.py +0 -0
  19. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe.egg-info/SOURCES.txt +0 -0
  20. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe.egg-info/dependency_links.txt +0 -0
  21. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe.egg-info/entry_points.txt +0 -0
  22. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe.egg-info/requires.txt +0 -0
  23. {quantprobe-1.6.2 → quantprobe-1.6.3}/quantprobe.egg-info/top_level.txt +0 -0
  24. {quantprobe-1.6.2 → quantprobe-1.6.3}/setup.cfg +0 -0
  25. {quantprobe-1.6.2 → quantprobe-1.6.3}/tests/test_engine.py +0 -0
  26. {quantprobe-1.6.2 → quantprobe-1.6.3}/tests/test_evaluator.py +0 -0
  27. {quantprobe-1.6.2 → quantprobe-1.6.3}/tests/test_pipeline.py +0 -0
  28. {quantprobe-1.6.2 → quantprobe-1.6.3}/tests/test_transforms.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantprobe
3
- Version: 1.6.2
3
+ Version: 1.6.3
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "quantprobe"
7
- version = "1.6.2"
7
+ version = "1.6.3"
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.6.2"
11
+ __version__ = "1.6.3"
@@ -45,14 +45,28 @@ def sh(cmd, dry, capture=False):
45
45
  return ""
46
46
 
47
47
 
48
+ def _ppl_once(perp, gguf, eval_file, chunks, ngl):
49
+ p = subprocess.run([perp, "-m", gguf, "-f", eval_file, "--chunks", str(chunks), "-ngl", str(ngl)],
50
+ capture_output=True, text=True, errors="replace")
51
+ out = p.stdout + p.stderr
52
+ m = re.search(r"Final estimate: PPL = ([0-9.]+)", out)
53
+ return (float(m.group(1)) if m else None), out
54
+
55
+
48
56
  def ppl(perp, gguf, eval_file, chunks, ngl, dry):
49
57
  print(f" measuring perplexity on {chunks} chunks (this can take 1-3 min; llama.cpp is quiet while it works)...", flush=True)
50
58
  if dry:
51
59
  return None
52
- p = subprocess.run([perp, "-m", gguf, "-f", eval_file, "--chunks", str(chunks), "-ngl", str(ngl)],
53
- capture_output=True, text=True, errors="replace")
54
- m = re.search(r"Final estimate: PPL = ([0-9.]+)", p.stdout + p.stderr)
55
- return float(m.group(1)) if m else None
60
+ val, out = _ppl_once(perp, gguf, eval_file, chunks, ngl)
61
+ if val is None and ngl != 0 and ("out of memory" in out.lower() or "failed to" in out.lower()):
62
+ # a probe intermediate (Q6_K reference, or a band left at Q6_K) can be far bigger
63
+ # than the source's final compressed size — retry CPU-only before giving up.
64
+ print(" GPU offload failed to fit (likely VRAM); retrying at -ngl 0 (CPU, slower)...", flush=True)
65
+ val, out = _ppl_once(perp, gguf, eval_file, chunks, 0)
66
+ if val is None:
67
+ tail = "\n".join(out.strip().splitlines()[-12:])
68
+ print(f" perplexity produced no parseable result. Last output lines:\n{tail}", flush=True)
69
+ return val
56
70
 
57
71
 
58
72
  def run(a):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantprobe
3
- Version: 1.6.2
3
+ Version: 1.6.3
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
File without changes
File without changes
File without changes
File without changes