Skip to content

Commit c6e698f

Browse files
author
cloudforge1
committed
fix: rename benchmark for CI discovery, bump to 10k iterations
- Renamed benchmark_ngram_kernel.py → test_benchmark_ngram_kernel.py so pytest discovers it (test_*.py pattern) - Bumped NUM_ITERS 10→10000, WARMUP 2→5 for noise-free profiling - Gated benchmark class with RUN_NGRAM_BENCHMARKS=1 (won't bloat CI)
1 parent 65f609b commit c6e698f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/spec_decode/benchmark_ngram_kernel.py renamed to tests/spec_decode/test_benchmark_ngram_kernel.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040

4141
MAX_NGRAM_SIZE = 3
4242
MAX_DRAFT_TOKENS = 10
43-
NUM_ITERS = 10
44-
WARMUP = 2
43+
NUM_ITERS = 10000
44+
WARMUP = 5
4545

4646

4747
def _build_data(batch_size, seq_len, hit_type="low_input", seed=42):
@@ -206,6 +206,10 @@ def _print_table(title, header, rows):
206206
print(f"{'=' * 80}")
207207

208208

209+
@unittest.skipUnless(
210+
os.environ.get("RUN_NGRAM_BENCHMARKS", "0") == "1",
211+
"Set RUN_NGRAM_BENCHMARKS=1 to run multi-group profiling (slow)",
212+
)
209213
class TestNgramBenchmarkGroups(unittest.TestCase):
210214
"""Multi-dimension benchmark matching NKNaN's 5-group methodology."""
211215

0 commit comments

Comments
 (0)