K8/V4 paged KV on nhp-tail: B8/32k -3.68%, TG -7.2% (R-2026-09-30-k8v4) #138

Merged
Grok merged 22 commits from serving-throughput into master 2026-09-30 12:15:43 +02:00
Owner

K8/V4 paged KV ships on the best arm (LEDGER R-2026-09-30-k8v4).

  • Arm prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4 (QWEN36_KV_DTYPE=bf8/bf4, PR #79 port).
  • c125 served ABCABC vs nhp-tail: B8/32k 81.39 s (−3.68%), B4/32k 54.03 s (−2.45%), B8/4k −0.82%, B4/4k −0.32%; TG B8/32k 35.28 ms (−7.2%); PP 5,839 tok/s.
  • Gates: equiv NEAR_TIE (1.50/1.94), retrieval 1.0 early/late 16k/32k, GSM8K 291/300 (shipped band 290-295).
  • K4/V4 parked (owner D-2026-09-30-correctness-over-mild-speed); SiLU appx rejected (c124b, 32k retrieval miss reproduces).
  • Also: BLACKHOLE-PERF §13-15 playbook, testing review, #133-137 evaluation, c119 grid record.
  • Record: bench/runs/perf-loop-c125-kv-k8v4-verdict-20260930T1015Z.jsonl

🤖 Generated with Claude Code

K8/V4 paged KV ships on the best arm (LEDGER R-2026-09-30-k8v4). - Arm `prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4` (`QWEN36_KV_DTYPE=bf8/bf4`, PR #79 port). - c125 served ABCABC vs nhp-tail: B8/32k 81.39 s (−3.68%), B4/32k 54.03 s (−2.45%), B8/4k −0.82%, B4/4k −0.32%; TG B8/32k 35.28 ms (−7.2%); PP 5,839 tok/s. - Gates: equiv NEAR_TIE (1.50/1.94), retrieval 1.0 early/late 16k/32k, GSM8K 291/300 (shipped band 290-295). - K4/V4 parked (owner D-2026-09-30-correctness-over-mild-speed); SiLU appx rejected (c124b, 32k retrieval miss reproduces). - Also: BLACKHOLE-PERF §13-15 playbook, testing review, #133-137 evaluation, c119 grid record. - Record: bench/runs/perf-loop-c125-kv-k8v4-verdict-20260930T1015Z.jsonl 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Grok added 22 commits 2026-09-30 12:15:37 +02:00
Believed before: the paged KV cache has one dtype, the symmetric bf8/bf8 switch
(QWEN_SDPA_BF8), and PR #79's K8/V4 work only applied to its 665-commits-stale base.

What the evidence changed: D-2026-09-29-tp2-own-1-7 point 6 takes ownership of
decode KV bytes; after R-2026-09-29-dn the decode SDPA KV read sits at the
measured DRAM ceiling, so fewer bytes is the lever, and K8/V4 is row 1 of the
analyst's ranking (23.5% fewer KV bytes). PR #79 never ran on hardware, and its
base (3c1ddc4) predates the whole c86..dn stack, so its four-file diff does not
apply to this tree.

Ported (per the analyst keep/drop list):
- tp_common.resolve_kv_dtypes + log_kv_dtype_banner: K and V independently over
  {bf16,bf8,bf4}; the flag wins over QWEN_SDPA_BF8, which keeps its exact old
  meaning (bf8/bf8) so every historical arm and record stays comparable.
  Byte-identical logs when the flag is unset: default and legacy-bf8 branches
  reproduce the pre-port lines verbatim; the KV line and the attention module's
  own line print only when the flag is set (once per process/role).
- attention/tp.py: per-cache prefill fill casts (K and V to their own cache
  dtype; paged_fill_cache asserts dtype equality and does not cast), explicit
  Q->bf8 cast when K is quantized (never bf4), banner.
- model.py: allocate_kv_caches resolves the pair (TP and single-device paths);
  the missed sites the PR's own base lacked are covered: _warmup_paged_fill_widths
  builds a separate v_full when V's dtype differs (it used to fill v_cache with
  K's dtype: TT_FATAL at bf4 V), and _fill_paged_cache_from_prefill casts per cache.
- mtp_batch.allocate_kv uses the same resolver (the PR's base had no MTP at all).
- qwen36_vllm.py: the prefix-caching guard accepts QWEN36_KV_DTYPE (any quantized
  pair), not just QWEN_SDPA_BF8=1.
- verify-arm-banners.sh: the PR's final semantics (the flag OVERRIDES the legacy
  switch; banner must name both dtypes; no KV banner on an arm that did not set
  the flag). The PR's own inconsistency is fixed: its attention banner fired for
  legacy bf8 arms too, which its own verifier refused.
- Dropped per the plan: the TP=1 vendored ttnn_gated_attention.py and goal4, the
  PR's vllm-tt-serve.sh changes (the script is now a ttx shim), and the docs
  (LEDGER/STATUS stay owned by the measurement loop; nothing here is measured).

One-card grid, one invocation: bench/probes/sdpa_dec_dual_noc/grid.sh runs
KV {bf8/bf8, bf8/bf4, bf4/bf8, bf4/bf4} x dn {off,on,mustfail} at B8/32k, B4/32k,
B8/4k in one container, fresh process per pair; ttsim_equiv.py gained --kv-dtype
(upload bf16, typecast on device, reference on the cache as stored) and the two
new grid cases. hw1card.sh gained an optional KV_DTYPE passthrough (default
bf8/bf8 changes nothing about it; its record schema, consumed by run.sh's gate,
is untouched).

Probes and gates ported from the PR: kv_mixed_dtype_probe.py (one-card op
contract, PCC ordering K8/V8 > K8/V4 > K4/V4), kv-dtype-accuracy.sh (Gate A
generalised: interleaved <K>/<V> arms, depth split, banner read back; docker
stop-then-wait instead of the PR's docker rm -f), kv_dtype_offline_study.py plus
its 9B-proxy record (the 27B's offline answer does not exist on any host: it is
a CPU-only study that cannot run on this machine), the kv-dtype skill, and
tests/kv-dtype-banner-patterns.sh.

Served arm: bench/arms/prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-kv84.toml
inherits the dn arm (LEDGER best), sets QWEN36_KV_DTYPE=bf8/bf4, unsets
QWEN_SDPA_BF8; full banner/absent lists copied and the KV banner added.
ttx lint passes; the only warning (0033 banner image-sourced) is the same one
the parent arm carries.

Unit tests (pure Python, ttnn stubbed): tests/test_kv_dtype_resolver.py --
grammar, single-token, precedence, aliases, raise-on-typo, and the exact banner
lines incl. byte-identity of the unset/legacy branches.

No hardware has run any of this. No speed or accuracy claim is made: the
promote/kill rungs are the grid's gates (bitwise equal, mustfail slower, K4/V8
times equal to K8/V4, PCC ordering) and, for the served arm, the ABAB + tier-3
quality suites per the analyst plan.
Believed before: #53827-style constant hoisting (-10% cycles, third-party) would cut the SwiGLU epilogue stall. Fewer
SFPU instructions did not move wall; only the LUT sigmoid does, at a numerics cost, so it is gated on correctness first.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The guide described the prefetcher as never run, GDN decode fidelity as
unmeasured and host time as removed; records say otherwise (c99/c116,
R-2026-09-29-gf, c117 tail). LEVERS gains the current-best line, and the
w2/gf/traced-bucket/prefetcher rows now say shipped or superseded. The tail arms'
comments now say 1 GiB, matching their trace_region_size.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The standing belief was that workbench prefill gains halve when served and that
GSM8K/retrieval gate numerics. The logs say: prefill levers transfer ~0.85 against
TTFT, GSM8K N=300 cannot resolve <7-11 items, retrieval is saturated at 1.0 in
16/16 records. Circuit breaker after a hang and one-boot gates are the top savings.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The workbench -3% predicted a small served win and it held (0.45x). What was not
expected: the first retrieval miss in the recent records, at 32k late half. With
GSM8K 291 vs 295 this is a trade-off, not a pass, so it waits for a repeat on arm
and control.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The c124 miss was believed to be possibly noise (one needle). The repeat shows the
same needle lost again under greedy decoding while the control holds 1.0, so the
LUT sigmoid costs real 32k accuracy for a -1.36% B8/32k gain.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Before: K8/V4 was a conditional go on an offline study (attention rel err 9.5x
K8/V8). The c119 grid showed V bytes bind decode SDPA; served, the TG drop at
32k matched that (2.7 ms/step) and every gate passed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merge remote-tracking branch 'origin/kv-k8v4-dn' into serving-throughput
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 17s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 2m58s
tt-stack-ci / Build simulators and check the host module (push) Failing after 2m39s
tt-stack-ci / Report upstream drift (push) Successful in 7s
b276ab42d0
Grok merged commit b276ab42d0 into master 2026-09-30 12:15:43 +02:00
Author
Owner

agent-gateway closeout (merged): cleared agent:* labels.
Hermes kanban card (if any) is left for Hermes to archive/complete.

agent-gateway closeout (merged): cleared `agent:*` labels. Hermes kanban card (if any) is left for Hermes to archive/complete.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitpartner/tt-stack!138
No description provided.