Repository navigation
Description
Scope
This is an independent evidence review of the performance claims in hanzo-engine 1.7.109 (#134, merged 2026-11-22). It covers the method behind each number. Correctness work and the isolation tests are strong, and they're noted below.
Findings (from code at 8c5742a)
-
"PhasePolicy … 2.0× 32K KV memory savings" is arithmetic, not a measurement.
hanzo-engine/src/kv_cache/phase_policy.rscomputesbf16_kv_bytes = 2*H_kv*ctx*d*2andfp8_kv_bytes = 2*H_kv*ctx*d. The ratio is exactly 2.0 by construction. It leaves out FP8 scale metadata and allocator or block overhead, and it ignores that phase-aware mode keeps BF16 during prefill. Resident memory on a served model was never measured. -
The portable (non-CUDA) KV-phase path mislabels its fields.
evaluate_single_kv_phase_point_portablesetsbf16_prefill_usandphase_aware_prefill_ustobf16_decode_us, andfp8_always_prefill_ustofp8_decode_us, each from a single un-warmed timing. Its prefill fields aren't prefill measurements. The CUDA path does use warm-up plus the median of 5 batches. -
"6.78× 5-turn TTFT speedup" comes from a synthetic micro-benchmark,
evaluate_multiturn_hybrid_prefix_reuse, not from served TTFT:- The stack is synthetic: 6 GDN + 2 attention layers (
HybridEvalConfig::default) on seeded random tensors. - Each turn's cold and warm path is timed once with
Instant::now(), with no warm-up and no repetition. - The warm path re-prefills only the 256-token suffix, while the cold path re-prefills the whole growing history (about 3.3K to 4.4K tokens). The cumulative token ratio is therefore about 15× by design.
The result shows that reuse works (numerical parity is excellent: GDN/attention rel < 1e-5, conv 0.0). It isn't evidence of end-to-end TTFT on a real model.
- The stack is synthetic: 6 GDN + 2 attention layers (
-
Isolation evidence is strong. 0 cross-tenant, cross-model, cross-adapter or boundary hits, and a post-mutation checkpoint relative error of 0.0. Keep it as a regression gate.
-
CI isn't visible. release(engine): hanzo-engine 1.7.109 (hanzo-ml 0.11.124, Bonsai-2 ternary/AFQ/DFlash2/GDN, Vulkan 27B fix, ReplayGDN, PhasePolicy, ENGINE_* env) #134's only GitHub check was GitGuardian. GitHub Actions last ran on 2026-09-09; CI moved to
.hanzo/workflows(ci: run the CI/CD caller from .hanzo/workflows so the forge sees it #124), and the merge commit's combined status ispendingwith no contexts. Unverified: whether the forge ran tests on8c5742a. -
Not reviewed in depth (raw data isn't in the repo or the ledger): DFlash2 "2.84×, 6.22 tok/round", the "+8–44% vs Prism llama.cpp" ternary gains, and ReplayGDN performance. To be checkable, each needs workload, llama.cpp commit, model hash, repetitions and CI.
-
None of this is in the research ledger.
hanzo-bench/src/board.rspostskernel-perfevidence to/v1/research/experimentsthrough its own client. The public/v1/research/runshas no engine performance runs.
Acceptance criteria
- Release notes say "analytic" next to the 2.0× KV figure until E1 (below) measures it on a served model.
- Fix the portable path: measure prefill separately with warm-up and repetitions, or drop those fields.
- Multi-turn reuse: report the median and a 95% CI over at least 10 repetitions after warm-up, and add a served-model end-to-end TTFT benchmark through
hanzo-serveron one real hybrid model. -
hanzo-benchuses thehanzo-researchcrate (hanzoai/ml) instead of its own HTTP client (hanzo-research: one automatic, durable, queryable research ledger for Kai/ML/Engine (WAL verify+lock+idempotency, spooler, HIP-1403 records) ml#77), and every release benchmark is logged with commit, model hash, hardware and CI. - Make the forge CI result for release merges visible on the GitHub PR (a status check), or link it from the release PR.
Related: #63 (roadmap) · #134 · pre-registered experiment E1 (issue below)
Activity
zeekay commentedon Nov 23, 2026
Addressed in #138 (
2026-11-22):2.0xKV memory savings as analytic tensor payload ratio onv1.7.109and release(engine): hanzo-engine 1.7.109 (hanzo-ml 0.11.124, Bonsai-2 ternary/AFQ/DFlash2/GDN, Vulkan 27B fix, ReplayGDN, PhasePolicy, ENGINE_* env) #134, and addedanalytic_kv_bytes_ratiovsmeasured_bf16_kv_alloc_bytes,measured_fp8_kv_plus_scale_bytes, andmeasured_kv_alloc_bytes_ratio(including per-layer FP8 scale tensors and 256-byte CUDA allocator rounding across 36 layers) toKvPhasePointMetrics.evaluate_single_kv_phase_point_portablenow times genuine causal prefill (seq_q = prefill_seq_len > 1) separately from single-token decode (seq_q = 1) using3untimed warmup runs + median of5repetitions, and tagsdecode_speedup_is_native = falseon non-CUDA backends (trueon CUDA).1full untimed multi-turn warmup sequence +10timed sequences (SummaryStatswith median, mean, sample SD, and two-sided 95% Student-$ CI) andis_synthetic_microbench = true. OndgxGB10 (sm_121, CUDA 13.4):median_cold = 2588.48 ms(95% CI [2446.54, 2816.26] ms),median_warm = 383.43 ms(95% CI [304.60, 429.54] ms),median_speedup = 6.73x(mean = 7.88x,SD = 3.52x,95% CI [5.36x, 10.40x]),0.0ULP GDN/Conv1D error.median_cold = 3026.50 ms,median_warm = 385.40 ms,median_speedup = 7.55x(95% CI [6.66x, 9.61x]).fix(kv-cache): audit KV phase policy & multi-turn prefix reuse metrics (