Skip to content

Evidence audit of 1.7.109 claims: PhasePolicy 2.0x KV memory is analytic, 6.78x TTFT is a single-sample synthetic microbench; log release benchmarks to /v1/research #135

Open

Description

@zeekay

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)

  1. "PhasePolicy … 2.0× 32K KV memory savings" is arithmetic, not a measurement. hanzo-engine/src/kv_cache/phase_policy.rs computes bf16_kv_bytes = 2*H_kv*ctx*d*2 and fp8_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.

  2. The portable (non-CUDA) KV-phase path mislabels its fields. evaluate_single_kv_phase_point_portable sets bf16_prefill_us and phase_aware_prefill_us to bf16_decode_us, and fp8_always_prefill_us to fp8_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.

  3. "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.

  4. 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.

  5. 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 is pending with no contexts. Unverified: whether the forge ran tests on 8c5742a.

  6. 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.

  7. None of this is in the research ledger. hanzo-bench/src/board.rs posts kernel-perf evidence to /v1/research/experiments through its own client. The public /v1/research/runs has 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-server on one real hybrid model.
  • hanzo-bench uses the hanzo-research crate (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

  1. zeekay commented on Nov 23, 2026

    @zeekay
    MemberAuthor

    Addressed in #138 (2026-11-22):

    1. Release notes & 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 updated: Explicitly labeled 2.0x KV memory savings as analytic tensor payload ratio on v1.7.109 and 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 added analytic_kv_bytes_ratio vs measured_bf16_kv_alloc_bytes, measured_fp8_kv_plus_scale_bytes, and measured_kv_alloc_bytes_ratio (including per-layer FP8 scale tensors and 256-byte CUDA allocator rounding across 36 layers) to KvPhasePointMetrics.
    2. Portable CPU KV-phase path fixed: evaluate_single_kv_phase_point_portable now times genuine causal prefill (seq_q = prefill_seq_len > 1) separately from single-token decode (seq_q = 1) using 3 untimed warmup runs + median of 5 repetitions, and tags decode_speedup_is_native = false on non-CUDA backends (true on CUDA).
    3. Multi-turn hybrid prefix reuse warmed 10-rep 95% Student-$ CIs: Added 1 full untimed multi-turn warmup sequence + 10 timed sequences (SummaryStats with median, mean, sample SD, and two-sided 95% Student-$ CI) and is_synthetic_microbench = true. On dgx GB10 (sm_121, CUDA 13.4):
      • BF16 (10 reps): 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.0 ULP GDN/Conv1D error.
      • F32 (10 reps): median_cold = 3026.50 ms, median_warm = 385.40 ms, median_speedup = 7.55x (95% CI [6.66x, 9.61x]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions