quantprobe 1.13.1__tar.gz → 1.14.0__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 (33) hide show
  1. {quantprobe-1.13.1/quantprobe.egg-info → quantprobe-1.14.0}/PKG-INFO +1 -1
  2. {quantprobe-1.13.1 → quantprobe-1.14.0}/pyproject.toml +1 -1
  3. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/__init__.py +1 -1
  4. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/plan.py +45 -0
  5. {quantprobe-1.13.1 → quantprobe-1.14.0/quantprobe.egg-info}/PKG-INFO +1 -1
  6. {quantprobe-1.13.1 → quantprobe-1.14.0}/LICENSE +0 -0
  7. {quantprobe-1.13.1 → quantprobe-1.14.0}/README.md +0 -0
  8. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/__main__.py +0 -0
  9. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/auto.py +0 -0
  10. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/cli.py +0 -0
  11. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/dashboard.py +0 -0
  12. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/detect.py +0 -0
  13. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/fetch.py +0 -0
  14. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/optimize.py +0 -0
  15. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/probe.py +0 -0
  16. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/recipes/mistral-7b.json +0 -0
  17. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/recipes/qwen2.5-7b.json +0 -0
  18. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/recipes/qwen3-30b.json +0 -0
  19. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/recipes/qwen3.5-35b.json +0 -0
  20. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/recipes.py +0 -0
  21. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/runtime.py +0 -0
  22. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/spec.py +0 -0
  23. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe/target.py +0 -0
  24. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe.egg-info/SOURCES.txt +0 -0
  25. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe.egg-info/dependency_links.txt +0 -0
  26. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe.egg-info/entry_points.txt +0 -0
  27. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe.egg-info/requires.txt +0 -0
  28. {quantprobe-1.13.1 → quantprobe-1.14.0}/quantprobe.egg-info/top_level.txt +0 -0
  29. {quantprobe-1.13.1 → quantprobe-1.14.0}/setup.cfg +0 -0
  30. {quantprobe-1.13.1 → quantprobe-1.14.0}/tests/test_engine.py +0 -0
  31. {quantprobe-1.13.1 → quantprobe-1.14.0}/tests/test_evaluator.py +0 -0
  32. {quantprobe-1.13.1 → quantprobe-1.14.0}/tests/test_pipeline.py +0 -0
  33. {quantprobe-1.13.1 → quantprobe-1.14.0}/tests/test_transforms.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantprobe
3
- Version: 1.13.1
3
+ Version: 1.14.0
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.13.1"
7
+ version = "1.14.0"
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.13.1"
11
+ __version__ = "1.14.0"
@@ -134,6 +134,45 @@ def ubatch_flags(placement, vram_resident_gb, vc):
134
134
  return "-b 2048 -ub 2048"
135
135
 
136
136
 
137
+ # The measured Pareto frontier for a MoE whose experts do not fit VRAM, on the reference box
138
+ # (Qwen3-30B-A3B Q2_K, pre-registration #21, one session, r=3, -ub 2048). There is no single best
139
+ # placement: three configurations are Pareto-optimal and the right one depends on how many prompt
140
+ # tokens you read per token you generate.
141
+ #
142
+ # (label, pp2048, tg128, extra flags beyond the placement's own)
143
+ MOE_FRONTIER = [
144
+ ("keep KV in VRAM", 161.59, 20.14, ""),
145
+ ("evict KV to RAM (-nkvo 1)", 391.72, 16.54, "-nkvo 1"),
146
+ ("all experts to CPU, KV in VRAM", 345.41, 18.68, ""),
147
+ ]
148
+ # A fourth cell - all experts to CPU with KV evicted - measured 336.31/15.82 and is DOMINATED by
149
+ # the third on both axes. It is kept out of the frontier deliberately: never recommend it.
150
+
151
+
152
+ def workload_frontier(prompt_to_gen):
153
+ """Pick the frontier point that minimises total time at a given prompt:generation ratio.
154
+
155
+ Total time for P prompt tokens and G generated is `P/pp + G/tg`, so the optimum moves as the
156
+ ratio does. Measured crossovers on the reference box:
157
+
158
+ chat 0.5:1 -> keep KV in VRAM (decode dominates)
159
+ coding 10:1 -> all experts to CPU (balanced)
160
+ RAG 50:1 -> evict KV to RAM (prefill dominates, 1.9x)
161
+ document QA 200:1 -> evict KV to RAM (2.25x over the worst choice)
162
+
163
+ The spread between best and worst choice reaches **2.25x** at long prompts, which is why this
164
+ cannot be left as one command ranked by decode - the tool's historical default.
165
+ """
166
+ G = 1.0
167
+ P = max(prompt_to_gen, 0.0) * G
168
+ scored = [(P / pp + G / tg, lab, pp, tg, fl) for lab, pp, tg, fl in MOE_FRONTIER]
169
+ scored.sort()
170
+ best = scored[0]
171
+ worst = scored[-1]
172
+ return dict(label=best[1], pp=best[2], tg=best[3], flags=best[4],
173
+ speedup_vs_worst=worst[0] / best[0])
174
+
175
+
137
176
  def phase_advice(placement, rows):
138
177
  """Which phase does the recommended command actually optimise, and what does it cost?
139
178
 
@@ -493,6 +532,12 @@ def run(args):
493
532
  ph = phase_advice(best[0], cfgs)
494
533
  if ph:
495
534
  print(f"\n phase: {ph}")
535
+ chat, rag = workload_frontier(0.5), workload_frontier(200)
536
+ print("\n workload: there is no single best setup here. Three are Pareto-optimal, and the")
537
+ print(" right one depends on how much prompt you read per token you write (measured, #21):")
538
+ print(f" chat, short prompts -> {chat['label']:<26} {chat['pp']:>6.0f} pp / {chat['tg']:>5.1f} tg")
539
+ print(f" long prompts, RAG, docs -> {rag['label']:<26} {rag['pp']:>6.0f} pp / {rag['tg']:>5.1f} tg")
540
+ print(f" Choosing wrong costs up to {rag['speedup_vs_worst']:.2f}x on a long-prompt workload.")
496
541
  if ub:
497
542
  print(f"\n prompt speed: `{ub}` is worth **+73% prefill** on this placement (measured "
498
543
  f"199.9 -> 345.9 tok/s, pre-registration #19). It costs nothing on generation "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantprobe
3
- Version: 1.13.1
3
+ Version: 1.14.0
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