specbench-cli 0.1.0__tar.gz → 0.1.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.
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/PKG-INFO +2 -3
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/README.md +1 -2
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/pyproject.toml +1 -1
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/src/speculation_benchmark/__init__.py +1 -1
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/src/speculation_benchmark/backends/base.py +37 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/src/speculation_benchmark/backends/llamacpp.py +492 -52
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/src/speculation_benchmark/config.py +50 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/src/speculation_benchmark/publisher.py +35 -2
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/src/speculation_benchmark/runner.py +389 -29
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/src/speculation_benchmark/visualize.py +361 -48
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/tests/test_llamacpp_backend.py +244 -1
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/tests/test_suites_and_runner.py +422 -6
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/tests/test_visualize.py +31 -2
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/.gitignore +0 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/LICENSE +0 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/config.example.yaml +0 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/src/speculation_benchmark/backends/__init__.py +0 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/src/speculation_benchmark/cli.py +0 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/src/speculation_benchmark/hf_jobs.py +0 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/src/speculation_benchmark/suites/__init__.py +0 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/src/speculation_benchmark/suites/base.py +0 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/src/speculation_benchmark/suites/loaders.py +0 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/suites/assets/sample_architecture.png +0 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/suites/assets/sample_bar_chart.png +0 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/suites/coding_smoke.jsonl +0 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/suites/multimodal_smoke.jsonl +0 -0
- {specbench_cli-0.1.0 → specbench_cli-0.1.1}/tests/test_hf_jobs.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: specbench-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Benchmark llama.cpp speculative decoding token acceptance rates, speedup, and memory overhead across draft lengths and task suites.
|
|
5
5
|
Project-URL: Homepage, https://github.com/merveenoyan/specbench
|
|
6
6
|
Project-URL: Repository, https://github.com/merveenoyan/specbench
|
|
@@ -35,8 +35,7 @@ Description-Content-Type: text/markdown
|
|
|
35
35
|
|
|
36
36
|
Benchmark **speculative decoding** in [`llama.cpp`](https://github.com/ggml-org/llama.cpp) across draft lengths and task domains, push results to Hugging Face Hub, and plot dashboards to find the fastest setup for your hardware.
|
|
37
37
|
|
|
38
|
-
https://github.com/user-attachments/assets/
|
|
39
|
-
|
|
38
|
+
https://github.com/user-attachments/assets/43c08a8e-29a5-46ff-8a32-92d078f5dd41
|
|
40
39
|
|
|
41
40
|

|
|
42
41
|
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Benchmark **speculative decoding** in [`llama.cpp`](https://github.com/ggml-org/llama.cpp) across draft lengths and task domains, push results to Hugging Face Hub, and plot dashboards to find the fastest setup for your hardware.
|
|
4
4
|
|
|
5
|
-
https://github.com/user-attachments/assets/
|
|
6
|
-
|
|
5
|
+
https://github.com/user-attachments/assets/43c08a8e-29a5-46ff-8a32-92d078f5dd41
|
|
7
6
|
|
|
8
7
|

|
|
9
8
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "specbench-cli"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.1"
|
|
8
8
|
description = "Benchmark llama.cpp speculative decoding token acceptance rates, speedup, and memory overhead across draft lengths and task suites."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -14,6 +14,7 @@ class CompletionTimings:
|
|
|
14
14
|
predicted_n: int = 0
|
|
15
15
|
draft_n: int = 0
|
|
16
16
|
draft_n_accepted: int = 0
|
|
17
|
+
cache_n: int = 0
|
|
17
18
|
prompt_ms: float | None = None
|
|
18
19
|
predicted_ms: float | None = None
|
|
19
20
|
prompt_per_second: float | None = None
|
|
@@ -26,6 +27,34 @@ class CompletionTimings:
|
|
|
26
27
|
return self.draft_n_accepted / self.draft_n
|
|
27
28
|
|
|
28
29
|
|
|
30
|
+
@dataclass
|
|
31
|
+
class SpeculationStatus:
|
|
32
|
+
"""Runtime verification report for a started backend sweep step."""
|
|
33
|
+
|
|
34
|
+
requested_spec_type: str
|
|
35
|
+
requested_draft_n_max: int
|
|
36
|
+
effective_draft_n_max: int
|
|
37
|
+
active_spec_types: list[str] = field(default_factory=list)
|
|
38
|
+
auto_detected_spec_type: str | None = None
|
|
39
|
+
loaded_draft_file: str | None = None
|
|
40
|
+
mtp_context_created: bool = False
|
|
41
|
+
detected_block_size: int | None = None
|
|
42
|
+
error_messages: list[str] = field(default_factory=list)
|
|
43
|
+
startup_logs_observed: bool = False
|
|
44
|
+
silent_fallback: bool = False
|
|
45
|
+
warnings: list[str] = field(default_factory=list)
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def effective_spec_type(self) -> str:
|
|
49
|
+
if self.requested_draft_n_max == 0:
|
|
50
|
+
return "none"
|
|
51
|
+
if self.active_spec_types:
|
|
52
|
+
return ",".join(self.active_spec_types)
|
|
53
|
+
if self.silent_fallback:
|
|
54
|
+
return "none"
|
|
55
|
+
return self.requested_spec_type
|
|
56
|
+
|
|
57
|
+
|
|
29
58
|
@dataclass
|
|
30
59
|
class CompletionResponse:
|
|
31
60
|
"""Normalized completion response from a speculative decoding backend."""
|
|
@@ -34,8 +63,16 @@ class CompletionResponse:
|
|
|
34
63
|
finish_reason: str | None
|
|
35
64
|
latency_s: float
|
|
36
65
|
timings: CompletionTimings
|
|
66
|
+
reasoning_content: str = ""
|
|
37
67
|
raw_usage: dict[str, Any] = field(default_factory=dict)
|
|
38
68
|
|
|
69
|
+
@property
|
|
70
|
+
def full_output(self) -> str:
|
|
71
|
+
"""Full generated text including any reasoning trace, for exact consistency comparison."""
|
|
72
|
+
if self.reasoning_content and self.content:
|
|
73
|
+
return f"{self.reasoning_content}\n{self.content}"
|
|
74
|
+
return self.content or self.reasoning_content
|
|
75
|
+
|
|
39
76
|
|
|
40
77
|
class SpeculationBackend(Protocol):
|
|
41
78
|
"""Protocol implemented by inference backends (local llama.cpp now, HF Jobs later)."""
|