Skip to content

feat(bench): SPEED-Bench task splits + speculative spec/quant warnings (v0.28.0) - #19

Merged
wesleyscholl merged 1 commit into
mainfrom
claude/konjo-kairu-udsqrp
Jun 22, 2026
Merged

feat(bench): SPEED-Bench task splits + speculative spec/quant warnings (v0.28.0)#19
wesleyscholl merged 1 commit into
mainfrom
claude/konjo-kairu-udsqrp

Conversation

@konjoinfinity

Copy link
Copy Markdown
Contributor

Konjo sprint β€” v0.28.0

Fifth and final sprint from this session's Discovery sweep (#15 CyclicJudge, #16 reliability, #17 KV eviction/quant, #18 adaptive early exit β€” all merged). The Medium/Low closer.

Why

Speculative-decoding speedup and early-exit savings are strongly task-dependent β€” a model drafts structured code or repetitive text far more predictably than open-ended dialogue β€” so a single aggregate latency number hides the variance that actually matters at deploy time. Separately, AutoProfile happily recommended speculative decoding without flagging configurations (4-bit drafts, tree drafts) that quietly erode the very speedup it promises.

What

New kairu/speed_bench.py β€” SPEED-Bench semantic task splits (pure stdlib + kairu.bench):

  • run_speed_bench(model, splits=None, …) β†’ SpeedBenchReport runs the benchmark across named task splits and reports per-split throughput plus a throughput coefficient of variation β€” one number quantifying how task-sensitive the configuration is (0.0 β†’ uniform across tasks).
  • TaskSplit + six DEFAULT_SPLITS (translation, summarization, qa, code, dialogue, math), each with a deterministic integer prompt so MockModel runs fully offline; real tokenised prompts plug in behind the same contract.
  • SplitResult / SpeedBenchReport expose as_dict() for JSON transport.

kairu/bench.py β€” BenchmarkRunner gains an optional prompt arg (defaults to the fixed class prompt) so SPEED-Bench drives distinct splits through the same runner. Existing behaviour unchanged.

kairu/auto_profile.py β€” speculative spec/quant warnings:

  • DecoderProfile gains warnings: tuple[str, ...] = ().
  • recommend(…, quant=None, draft_kind=None) flags a 4-bit draft (int4/4bit/nf4/fp4 β€” tanks draft–target acceptance) and a tree-structured draft (the sequential verifier here cannot exploit it). Case-insensitive; empty unless the hints are supplied, so existing recommendations are byte-identical.

Quality gates

  • 746 passed, 4 HF-gated skipped (+14 new).
  • New tests/test_speed_bench.py (9 tests) at 100% module coverage; auto_profile.py stays 100% (+5 warning tests).
  • ruff lint + format clean; speed_bench.py 149 lines, bench.py 443 (both < 500); recommend stays grade C cc=15 (the warning helper added zero branches to it β€” all logic lives in _speculative_warnings).

Reuse note

run_speed_bench composes the existing BenchmarkRunner per split rather than duplicating the timing loop; the split logic lives in its own module to keep bench.py under the 500-line gate. No HF/torch β€” MockModel exercises every path offline.

Closes this session's researched Discovery sweep across both tracks: eval (CyclicJudge, reliability metrics) and inference-optimizer (KV eviction + quant tier, adaptive early exit, SPEED-Bench).

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01TmSqgYqcYfzPnkpDVR5vdw


Generated by Claude Code

…s (v0.28.0)

New kairu/speed_bench.py runs the benchmark across named semantic task splits
(SPEED-Bench methodology) because speculative speedup and early-exit savings
are strongly task-dependent. run_speed_bench -> SpeedBenchReport reports
per-split throughput plus a throughput coefficient of variation that quantifies
task-sensitivity (0 -> uniform). Six DEFAULT_SPLITS (translation, summarization,
qa, code, dialogue, math), each with a deterministic prompt so MockModel runs
offline. BenchmarkRunner gains an optional prompt arg to drive the splits.

auto_profile: DecoderProfile.warnings + recommend(quant=, draft_kind=) flag
speculative configs that erode the expected speedup -- a 4-bit draft (tanks
draft-target acceptance) and a tree-structured draft (the sequential verifier
cannot exploit it). Empty unless the hints are supplied, so existing
recommendations are unchanged.

New tests/test_speed_bench.py (100% module) + 5 warning tests. Suite: 746
passed, 4 HF-gated skipped. Version 0.27.0 -> 0.28.0. Closes the session's
Discovery sweep.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TmSqgYqcYfzPnkpDVR5vdw
@wesleyscholl
wesleyscholl marked this pull request as ready for review June 22, 2026 23:22
@wesleyscholl
wesleyscholl merged commit 5fc2f5a into main Jun 22, 2026
7 checks passed
@wesleyscholl
wesleyscholl deleted the claude/konjo-kairu-udsqrp branch June 22, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants