quantprobe 1.13.0__tar.gz → 1.13.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 (33) hide show
  1. {quantprobe-1.13.0/quantprobe.egg-info → quantprobe-1.13.1}/PKG-INFO +1 -1
  2. {quantprobe-1.13.0 → quantprobe-1.13.1}/pyproject.toml +1 -1
  3. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/__init__.py +1 -1
  4. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/plan.py +51 -2
  5. {quantprobe-1.13.0 → quantprobe-1.13.1/quantprobe.egg-info}/PKG-INFO +1 -1
  6. {quantprobe-1.13.0 → quantprobe-1.13.1}/LICENSE +0 -0
  7. {quantprobe-1.13.0 → quantprobe-1.13.1}/README.md +0 -0
  8. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/__main__.py +0 -0
  9. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/auto.py +0 -0
  10. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/cli.py +0 -0
  11. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/dashboard.py +0 -0
  12. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/detect.py +0 -0
  13. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/fetch.py +0 -0
  14. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/optimize.py +0 -0
  15. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/probe.py +0 -0
  16. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/recipes/mistral-7b.json +0 -0
  17. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/recipes/qwen2.5-7b.json +0 -0
  18. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/recipes/qwen3-30b.json +0 -0
  19. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/recipes/qwen3.5-35b.json +0 -0
  20. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/recipes.py +0 -0
  21. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/runtime.py +0 -0
  22. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/spec.py +0 -0
  23. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe/target.py +0 -0
  24. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe.egg-info/SOURCES.txt +0 -0
  25. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe.egg-info/dependency_links.txt +0 -0
  26. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe.egg-info/entry_points.txt +0 -0
  27. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe.egg-info/requires.txt +0 -0
  28. {quantprobe-1.13.0 → quantprobe-1.13.1}/quantprobe.egg-info/top_level.txt +0 -0
  29. {quantprobe-1.13.0 → quantprobe-1.13.1}/setup.cfg +0 -0
  30. {quantprobe-1.13.0 → quantprobe-1.13.1}/tests/test_engine.py +0 -0
  31. {quantprobe-1.13.0 → quantprobe-1.13.1}/tests/test_evaluator.py +0 -0
  32. {quantprobe-1.13.0 → quantprobe-1.13.1}/tests/test_pipeline.py +0 -0
  33. {quantprobe-1.13.0 → quantprobe-1.13.1}/tests/test_transforms.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantprobe
3
- Version: 1.13.0
3
+ Version: 1.13.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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "quantprobe"
7
- version = "1.13.0"
7
+ version = "1.13.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.13.0"
11
+ __version__ = "1.13.1"
@@ -110,14 +110,60 @@ def ubatch_flags(placement, vram_resident_gb, vc):
110
110
  card costs more than it saves. Decode is unaffected either way (18.46 -> 18.76), because a
111
111
  ubatch cannot be filled one token at a time.
112
112
  """
113
- host_resident = any(k in placement for k in ("->RAM", "CPU", "disk"))
114
- if not host_resident or vc <= 0:
113
+ # The SPLIT placement is excluded even though it is partly host-resident, and this correction
114
+ # comes from measurement (pre-registration #20) after v1.13.0 shipped the wrong gate:
115
+ #
116
+ # placement pp2048 @ub512 pp2048 @ub2048
117
+ # all experts -> CPU 199.90 349.59 (+75%)
118
+ # split, K=16 experts -> VRAM 279.07 161.87 (-42%)
119
+ #
120
+ # The split exists to fill spare VRAM with experts - so by construction it consumes the very
121
+ # headroom the larger compute buffer needs, and the flag that pays 75% on one placement costs
122
+ # 42% on the other. v1.13.0 gated on "is anything host-resident", which is true for the split
123
+ # ("...->VRAM, rest->RAM"), and so recommended it there. Wrong, and measured wrong.
124
+ #
125
+ # Note this also INVERTS which placement is fastest at prefill: at the default ub the split
126
+ # wins (279 vs 200), at ub 2048 the all-CPU placement wins (350 vs 162). Placement and batch
127
+ # are not independent dimensions - they compete for the same VRAM.
128
+ if "split experts" in placement or vc <= 0:
115
129
  return None
130
+ if not any(k in placement for k in ("->RAM", "CPU", "disk")):
131
+ return None # nothing host-resident: no transfer to amortise
116
132
  if vc * 0.90 - vram_resident_gb < UBATCH_HEADROOM_GB:
117
133
  return None # no room for the bigger compute buffer; the -39% case
118
134
  return "-b 2048 -ub 2048"
119
135
 
120
136
 
137
+ def phase_advice(placement, rows):
138
+ """Which phase does the recommended command actually optimise, and what does it cost?
139
+
140
+ `plan` prints ONE command, and the placement that maximises generation is not the placement
141
+ that maximises prompt processing. Measured on the reference box (pre-registration #20,
142
+ Qwen3-30B-A3B, one session, r=3):
143
+
144
+ placement pp2048 @ub2048 tg128
145
+ all experts -> CPU 349.59 18.54
146
+ split, K=16 -> VRAM 161.87 20.16
147
+
148
+ The split wins generation by 9% and loses prompt processing by 2.16x. Ranking by decode - which
149
+ is what this tool does - silently hands long-prompt users the worse configuration by a factor
150
+ of two, so it has to say so.
151
+
152
+ Not a law change and not a second command: llama.cpp is started once, with one placement. This
153
+ tells the user which one they are getting and what the other is worth.
154
+ """
155
+ if "split experts" not in placement:
156
+ return None
157
+ alt = next((r for r in rows if r[0].startswith("hybrid")), None)
158
+ if not alt:
159
+ return None
160
+ return ("this command is tuned for GENERATION. If your prompts are long - agent transcripts, "
161
+ "RAG context, whole files - the other placement is far better at reading them: "
162
+ "measured 349.6 vs 161.9 tok/s prompt processing (2.2x), for 8% less generation. "
163
+ f"Use `{alt[3]} -b 2048 -ub 2048` instead. Prompt processing and generation genuinely "
164
+ "want different placements here, and one command cannot serve both.")
165
+
166
+
121
167
  def effective_n_layer(args=None, model=None):
122
168
  """THE resolver for "how many layers does this model have". Do not hand-write this again.
123
169
 
@@ -444,6 +490,9 @@ def run(args):
444
490
  ub = ubatch_flags(best[0], ne * max(args.bits, 4.5) / 8 * 1.08 if moe else 0.0, vc)
445
491
  run_flags = f"{best[3]} {ub}" if ub else best[3]
446
492
  print(f"\n run it: llama-server -m model.gguf {run_flags}")
493
+ ph = phase_advice(best[0], cfgs)
494
+ if ph:
495
+ print(f"\n phase: {ph}")
447
496
  if ub:
448
497
  print(f"\n prompt speed: `{ub}` is worth **+73% prefill** on this placement (measured "
449
498
  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.0
3
+ Version: 1.13.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
File without changes
File without changes
File without changes