c135: MTP-at-batch stack is the best arm (B8/32k -4.6%, B4/32k -8.2%; gates clean) #140

Merged
Grok merged 89 commits from serving-throughput into master 2026-10-01 02:43:57 +02:00
Owner

This merges the c135 MTP-at-batch bundle (LEDGER R-2026-10-01-mtp-stack) and makes it the best arm: prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack.

Members: MTP batch K=3, the per-row GDN state slot, overlap/async/early reseed, the NKV=2 SDPA spec-verify fold (tt-metal 0034 via overlay pk3r+0033+0034), and buckets 1,2,4,8.

Results (TP=2, G2 bfp4, K8/V4 KV, 1024 tokens out). The same-session best-arm band is ≤ 0.14%:

cell best arm stack Δ
B8/32k 81.61 s 77.88 s −4.6%
B4/32k 54.08 s 49.64 s −8.2%
B4/4k 31.63 s 29.59 s −6.5%
B8/4k 36.60 s 36.89 s +0.8%

Gates on the exact combination:

  • equiv NEAR_TIE (max gap 0.25);
  • the fold must-fail fails 8/8;
  • retrieval 1.0 in both the early and late halves at 16k and 32k;
  • GSM8K 292/300.

Attribution is pending. Deploying to production is the owner's call.

The record is bench/runs/perf-loop-c135-mtp-stack-verdict-20261001T0045Z.jsonl. The PR also carries the c133 verdict (multi-token GDN inert) and the queue and skill fixes.

🤖 Generated with Claude Code

This merges the c135 MTP-at-batch bundle (LEDGER `R-2026-10-01-mtp-stack`) and makes it the best arm: `prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack`. **Members:** MTP batch K=3, the per-row GDN state slot, overlap/async/early reseed, the NKV=2 SDPA spec-verify fold (tt-metal 0034 via overlay `pk3r+0033+0034`), and buckets 1,2,4,8. **Results** (TP=2, G2 bfp4, K8/V4 KV, 1024 tokens out). The same-session best-arm band is ≤ 0.14%: | cell | best arm | stack | Δ | |---|---|---|---| | B8/32k | 81.61 s | 77.88 s | −4.6% | | B4/32k | 54.08 s | 49.64 s | −8.2% | | B4/4k | 31.63 s | 29.59 s | −6.5% | | B8/4k | 36.60 s | 36.89 s | +0.8% | **Gates on the exact combination:** - equiv NEAR_TIE (max gap 0.25); - the fold must-fail fails 8/8; - retrieval 1.0 in both the early and late halves at 16k and 32k; - GSM8K 292/300. Attribution is pending. Deploying to production is the owner's call. The record is `bench/runs/perf-loop-c135-mtp-stack-verdict-20261001T0045Z.jsonl`. The PR also carries the c133 verdict (multi-token GDN inert) and the queue and skill fixes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Grok added 89 commits 2026-10-01 02:43:50 +02:00
Before: on the best arm (dn) plain decode runs gdn_decode_norm_gate and attn_decode_prep, but
the batched MTP verify (forward_verify, _forward_decode_grouped) still ran the composed
rms_norm/silu*z and head-split/qk-norm/rope chains. So the verify row 0 -- the token MTP emits
in place of plain decode's -- came from different kernels than plain decode, and the c69d
bit-exact result (older arm, no such kernels) could not carry over.

Now, under the same flags, forward_verify keeps each sub-step's o ROW_MAJOR, concatenates them
along the batch dim (row u = j*Bw + b, z's order) and runs ONE norm_gate at batch=M; the grouped
pass runs ONE attn_decode_prep at width G*Bw and reshards each group's padded k/v at width Bw
for its paged_update_cache. New banners "... engaged in MTP verify". Flags unset: the code path
is the old one, unchanged. Unverified on hardware or ttsim (shapes of the RM o and of the
prep k/v shard are taken from the plain-decode call sites).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
c69d measured MTP at batch as a 8.7-12.6% loss at B=8 but not why; the per-phase split
(GDN sub-steps, commit where-chain, T SDPA calls, MTP head, host round trips) was an analyst
estimate. TIMING=1 measures it: the C trace is captured as commit + reseed/draft, each phase
is closed by ttnn.synchronize_device, and one line per bucket every 64 steps logs the window
and running means (prep, verify, rb_verify, accept, commit, draft, rb_draft, total). The syncs
serialise host and device, so it is a diagnostic, never a speed number.

The existing rungs (PLAIN_ONLY, FORCE_REJECT, K) could only pass; nothing showed the equiv gate
can see a wrong commit. MUSTFAIL=commit_plus1 commits the GDN state at min(m+1, K) while the
emitted tokens stay m+1; an unknown value refuses. Both flags log "<FLAG> engaged" and are inert
unset (the unsplit C trace and the old step path are what runs). Host tests: must-fail breaks
the toy equivalence, moves only the commit one-hot, PhaseTimer windows (27 tests pass).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
MTP at batch was last measured on EF-gdnfused (c69d); the best arm is now dn, with ~20 decode
levers since. The -mtp arm inherits dn with the c69d MTP config (K<=3, buckets 4,8, head from
the ThinkingCap FP8 snapshot), QWEN36_DEVICE_RESIDENT=0 and --no-async-scheduling; banners move
RESIDENT / async-enabled to absent and require the MTP and "engaged in MTP verify" banners. The
rungs -plain, -frej, -k1, -mf, -tm each assert their own banner (lists replace on inherit, so
each repeats the full lists). Queue: PLAIN_ONLY capture (--logprobs 0: logprobs force host
sampling, which makes MTP fall back) + sweep, FORCE_REJECT compare (must BIT_EXACT) + sweep,
must-fail equiv (must FAIL), K=3 and K=1 sweeps, the TIMING sweep, then K=3/K=1 equiv. ttx lint
OK on all six. No hardware run here; no speed number.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Before this, c115's -mtp-tm phase split would only have landed in a server log: ttx had no parser for it,
and the lines held 64-step window means with no per-step spread, no clock and no row counts. Windows could
also span two bench cells. Stops inside a draft block were covered only for max_tokens. No on-card MTP run
had ended on EOS, and the host tokens/row-step counter was suspected of counting trimmed post-EOS tokens.

- PhaseTimer lines now carry t=, flush=periodic|idle, the window's rows/emitted/accepted/drafted and
  per-step samples_ms, every 16 steps and when the batch drains, so a window never spans two bursts.
  Stats lines carry t= and burst_end=. Existing banner and "stats: steps=" prefixes are unchanged.
- ttxlib/mtplog.py assigns lines to cells by the container clock (ttx measures the host offset) and writes
  mtp_batch.per_ctx.<ctx>.{timing.<bw>: per-phase mean/p50/p90 ms per step + tokens/row-step, stats: host
  counter delta} into every sweep32k record of a QWEN36_MTP_BATCH=1 arm. Plain arms are untouched, and a
  parse error never fails a record.
- SchedulerSim now models upstream check_stop and trim, min_tokens, ignore_eos, stop_token_ids and
  stop sequences with a delayed abort, plus slot reuse. TestStopInBlock covers EOS at the first, middle and
  bonus token of a block, max_tokens mid-block, and a random mix. The must-fail rungs are no-trim and an n
  (not n-1) advance. No bug was found in the scheduler or accept path. The counter bias is confirmed and
  exact: host emitted = delivered + trimmed, so it over-counts by <= K per finished request. It is recorded
  as a caveat.
- equiv records equiv.eos (finish_reason counts), and --require-eos fails a run with no EOS stop. The
  to-EOS c115 rung is documented in MTP-BATCH.md §8a; the queue file is left for the owner to extend.

Tests: tools/ttx/tests + tests/test_mtp_batch_host.py, 298 passed (pytest). ttx lint is OK on the -mtp,
-mtp-tm and -mtp-plain arms. No hardware run and no speed number.

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 p7 report ranked the prefetcher as the top decode-floor lever (est -1.5..-4 ms).
Even its compute floor with the GCB pre-filled is 0.81x the MR matmul, so there is
not enough left to overlap.

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>
Belief before: the per-row GDN commit (where-chain over T candidate states, then a copy) was
estimated at 7-13 ms/step (MTP-BATCH.md 2b) and assumed to need a C++ commit kernel (p5 lever 2).
c115's synced timing measured it at 16.04 ms/step at B=8 K=3, flat at 4k and 32k, and 11.79 ms at
Bw=4: about 7.5 ms is per-program cost of the ~770 small programs, the rest is bytes.

This adds the commit as two index-driven programs per GDN layer (96 per step): the host writes one
uint32 page (entry b = accepted depth m_b, SKIP past the bucket) and JIT dataflow kernels, run through
ttnn.generic_op, read only the selected candidate per row and write it straight into the persistent
rec/conv state. No ttnn C++ rebuild or image change: the image's generic_op + SOURCE_CODE kernels
suffice, so the Nix incremental path is not needed for this lever. Addresses are runtime args (trace-stable:
the candidates are the verify trace's outputs), idx is read at run time. Whole-page / whole-face-row
moves only, dtype/shape/placement checked: bit-exact by construction.

Behind QWEN36_MTP_STATE_SLOT=1 (banner "QWEN36_MTP_STATE_SLOT engaged" on the first commit, plus a
fail-closed warmup self-test with a shifted-page must-fail); unset leaves the where path and its
mask inputs byte-for-byte as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The kernels only earn a card run if they are bit-identical to the path they replace. Host tests
(tests/test_mtp_state_slot.py, 10) run a buffer engine where the toy LM's GDN state lives in per-slot
rec/conv buffers and commit either way side by side: identical buffers after every step and the
greedy stream, for random acceptance incl. m=0 and m=K on every row, plain-fallback buckets, slot reuse
after a finish, EOS/stop/max_tokens mid-block through the scheduler simulation; a page one depth off
breaks the stream 10/10. ttsim (bench/probes/sim_mtp_state_slot.py) runs the real JIT kernels through
generic_op: bitwise equal to a torch gather and to the where-chain op for op, fp32 rec + bf16 conv,
Bw 4/8, T 2/4, the served TP=2 shape, 4 reuse rounds on one idx page, both off-by-one pages caught.
Trace replay is untested (the simulator's slow dispatch has no trace). Correctness only, no timing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The slot commit needs a served gate before any number: -dn-mtp-slot (claim), -slot-tm (TIMING: the
commit phase should drop from 16.04 ms), -slot-mf (commit_plus1 on the slot page: equiv must FAIL).
The controls (-dn-mtp, -dn-mtp-plain) now require the slot banner absent, so an arm cannot silently
run the other commit. The queue re-captures PLAIN_ONLY on this tree because merging serving-throughput
changed code under plain decode. Estimate (not measured): commit ~3-5 ms, B8 TG ~27.9 ms/token at 4k and
~41.4 at 32k vs c115 K=3 32.4 / 46.0, so 32k still needs lever 1. No arm on the K8/V4 best base: no MTP
arm exists there yet; the note lists what is missing.

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 state-slot MTP work sat on the dn base while the best arm moved to d8k16-nhp-tail-k8v4 (c124-c127).
The MTP-at-batch arm has to be rebuilt on that base, so the branch takes its tree first. Clean merge.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Before: the MTP head KV followed the KV resolver but no card had run it asymmetric. The comment said it was
'off in every serving arm', which stopped being true once k8v4 became the best base. Nothing stopped a head KV
whose dtype differed from the main caches. The MTP capture logged no TRACE bytes, although the tail's
520 MiB of bucket and slot-copy traces now share the region.
Changes:
- allocate_kv refuses a split policy vs the main caches.
- set_paged_kv_cache refuses any cache that is not the resolver's dtype. paged_fill_cache would TT_FATAL
  after a cold build.
- The grouped decode SDPA refuses a non-bf16 q (c119: bf8 Q into the GQA decode SDPA failed).
- The capture logs per-bucket TRACE deltas and a used/free/total line. It refuses bucket 8 before its
  capture when less than 1.5x bucket 4's bytes are free, instead of the late mesh_trace.cpp:82 TT_FATAL
  that needs SIGKILL.
Evidence:
- ttsim (sim_mtp_batch_mechanics.py --kv bf8/bf4): grouped paged_update_cache + grouped paged SDPA are
  bitwise equal to plain per-step decode with K bf8 / V bf4 caches, and the -1 skip holds on both caches.
  Record written from the dirty tree at the merge commit.
- Host tests: tests/test_mtp_k8v4_budget.py (5).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The c128 slot test and c115 K=3 ran on dn, and the best base is now k8v4, where the TG to beat is 35.28 ms at
B8/32k. So the MTP arms move onto that base.
- trace_region_size is 1.25 GiB. The upper bound is 226.0 + 294.4 MiB of tail traces (measured) plus <= 512 MiB
  for chunk + decode + MTP, from the c115 boot. That is 1032.4 MiB, over the tail's 1 GiB.
- Sync/non-resident moves 'QWEN36_DEVICE_RESIDENT engaged' and 'Asynchronous scheduling is enabled' to absent.
- The TRACE budget line is a required banner, so the first boot is the measurement.
- All four arms pass ttx lint --seqs 8.
- Queue: ABCCBA sweeps, with equivalence on the shared boots, then retrieval and GSM8K on slot. Estimate
  ~150 card-min.

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>
A --logprobs 0 reference fell through to the per-chunk rule, which misplaces the first
divergence under MTP (1..K+1 tokens per SSE chunk): c115 to-EOS reported token 2 for three
streams whose texts agree well past 128 tokens (the 128-token K=3 equiv was bit-exact).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A --logprobs 0 reference fell through to the per-chunk rule, which misplaces the first
divergence under MTP (1..K+1 tokens per SSE chunk): c115 to-EOS reported token 2 for three
streams whose texts agree well past 128 tokens (the 128-token K=3 equiv was bit-exact).

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>
Believed: mounting a patched kernel file under /opt/tt-metal-src is enough for the JIT. Evidence (0034 on ttsim,
2026-09-30): kernels include headers as "ttnn/operations/...", which resolves through -I<wheel>/ttnn/cpp, so the
patched .cpp compiled against the stock rt_args_common.hpp and failed. Headers under ttnn/cpp/ now also land at
the wheel path (0033 never hit this: it patched no absolute-included header).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Believed: upstream #55548 spec_multi_pos_tiles needs num_kv_heads==1, so the fold could not serve our 12q/2kv TP=2
cards, and the MTP verify keeps paying T KV reads per attention layer (c115: verify 56 ms @4k, 90 ms @32k, B=8 K=3).
Change: one row-tile per candidate plus a per-candidate GQA partial-row writer lifts it; shape-triggered (Q batch =
T x page-table rows), both the stock and 0033 dual-NoC kernel sets, K/V dtypes independent.
Evidence (ttsim, correctness only, no speed number): 35 cases T=2,3,4,8, ctx 128/2k, B=2/3/8, -1 skips, bf8/bf8 and
bf8/bf4, dual NoC on/off: every candidate bitwise or PCC>=0.99997 vs the T legacy calls (386/480 bitwise; the rest
are past a chunk boundary, as designed); mustfail (bound+1) fails every case (PCC <= 0.14); env off refuses the
fold shape. Fold CB at B=8: T=4 714 KB, T=8 1.21 MB of 1.46 MB L1.
Record: bench/runs/sdpa-spec-fold-ttsim-20260930T150749Z.jsonl. Design: docs/analysis/sdpa-spec-fold.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Believed: the verify's T per-group SDPA calls were structural (one cur_pos per call). The verify q rows are already
candidate-major (u = j*Bw + b), which is 0034's fold layout, so one call with a host-built candidate-major cur_pos
(v_posf, a persistent v_* trace input) replaces the T calls when all groups share the page table. The flag maps to
TT_SDPA_DEC_SPEC_FOLD at import (the op reads it once) and logs 'QWEN36_SDPA_SPEC_FOLD engaged mode=<m>'.
Not measured on the cards: arms -dn-mtp-slot-fold{,-plain,-mf,-tm} (k2-mr-pk3q + pk3q+0033+0034 overlay) and
bench/queues/c130-sdpa-fold.txt (PLAIN_ONLY capture, fold equiv, must-fail, timing, sweep32k 4k/32k) are queued work.

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>
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>
We believed the 0034 SDPA fold could not reach T=10-16, because its L1 at T=8 was already 1.21 of 1.46 MB.
Thatch-cloud's T16 verify packs (candidate x GQA head) densely into the Q rows, and that fits T=16 into 3 row-tiles
per KV head instead of 16. The scout ranks 8 techniques to port, with path@sha and THIRD-PARTY numbers: the dense
Q packing, the chained KV write and packed conv windows (-17.2 ms), the multi-token GDN with commit-only, adaptive K
from the confidence head, the fused Markov score, the fused drafter commit, shared Q/K norm, and the exact prefill conv.
It also records what contradicts the 9-15 plan at B=8: real-text acceptance is 4.4-5.3 per T16 round, T32 was
rejected, and the GDN verify cost grows per row.

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>
MTP at batch with async scheduling builds on the c129 slot arm (k8v4-mtp +
QWEN36_MTP_STATE_SLOT). c129 measured it as the fastest MTP arm but 9% behind
the best non-MTP arm at 32k. The overlap work needs both the k8v4 base and the
slot commit, so the branch starts from their merge.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
We assumed MTP at batch needed sync scheduling: the platform turned async off
because only the resident chain declares supports_async_decode, and the runner
refused it. c129 measured the cost. The synced step is 71.2 ms, and a large
part of it is host time the device idles through. That leaves the slot arm at
39.85 s against 36.58 s for the best arm at B=8/4k.

Async scheduling alone buys nothing: the speculative step blocks on its
readbacks. So the overlap is inside the step, behind its own flags:
- QWEN36_MTP_OVERLAP: the commit + draft trace is non-blocking, and its
  readback is deferred to the next entry (drain() at every boundary; the host
  refuses plan/reset/remap while a step is pending).
- QWEN36_MTP_ASYNC: vLLM async with variable tokens per row. The lookahead is
  2K because the scheduler lags by up to K. A LagBook lets the prefill test
  allow the lag. A preempted row is not advanced.
- QWEN36_MTP_EARLY_RESEED: the reseed is plan-only, so its own trace runs
  before the host accept.
- QWEN36_MTP_OVERLAP_TIMING: host clocks without device syncs.
Each prints a banner, and unset every path is the c129 code.

tests/test_mtp_async.py simulates the batch-queue loop, including EOS, stops
and preemption mid-block. Its must-fail cases catch each of the three lag
bugs. Nothing has run on the cards yet: the gain is an estimate of 3-8% wall.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The overlap and async flags need an on-card gate before any speed claim. The
arms mirror the c129 slot arm with fail-closed banners (every MTP arm lists the
other flags as absent):
- ovl, async, async-er;
- async-plain, the async-mode plain path;
- async-mf, commit_plus1, which must FAIL;
- async-tm.
The queue fragment runs:
- the PLAIN_ONLY capture;
- equiv + sweep32k on each rung, r1 then reversed r2;
- the must-fail rung and the to-EOS pair;
- retrieval and GSM8K on the final arm;
- the tm diagnostic.
Section 12 records why async alone gives no overlap, the vLLM 0.26 file:line
evidence that variable tokens per row is feasible, and why the resident
compatibility and device-side accept are deferred.

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>
Believed: wait_ready's exited-container path keeping the log on the box was enough. Evidence (c130, 2026-09-30): a
fatal-log-line refusal (engine-init-failed, EngineCore -11) goes through up()'s except -> down(), which removes the
container, and four fold boots left no server log at all. up() now saves docker logs (stdout, never an ssh arg) to
bench/runs/<log_stem>.server.log before down(), never masking the failure; the suite callers pass their stem and the
record's session fields carry server_log. Tests: tests/test_boot_log.py (the 3 other failures predate this).

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>
Believed: ttnn.slice(q, full range) makes a copy, so q could be freed before the SDPA call. Evidence (ttsim,
2026-09-30): a full-range slice returns q's own buffer; deallocate(q) left the folded call a deallocated Q and the
host dereferenced a null buffer, which was the EngineCore -11 of every c130 fold boot. Reproduced: ttsim_alias_repro.py
--bug exits 139 at the SDPA call; the fixed wiring (q as is when already interleaved DRAM [1,B,NH,HD], free after
the call) returns finite output. The op itself is clear at the exact boot shapes, on a 1x2 mesh, fast dispatch and
trace replay (bench/runs/sdpa-spec-fold-segv-ttsim-20260930T182732Z.jsonl).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Believed: the per-op ttsim cases covered the served call. They did not cover the boot's shapes (page table [Bw,4096],
positions 0..3, 11x10 grid), a 1x2 mesh, fast dispatch, trace replay or cache hits; all now pass (--mesh --trace, boot_*
cases), which is how the c130 crash was pinned on the Python wiring instead. -fold-dbg is the fold arm plus
PYTHONFAULTHANDLER=1 for a boot-only rung, so a next native crash leaves a Python stack in the saved server log.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Believed: wait_ready's exited-container path keeping the log on the box was enough. Evidence (c130, 2026-09-30): a
fatal-log-line refusal (engine-init-failed, EngineCore -11) goes through up()'s except -> down(), which removes the
container, and four fold boots left no server log at all. up() now saves docker logs (stdout, never an ssh arg) to
bench/runs/<log_stem>.server.log before down(), never masking the failure; the suite callers pass their stem and the
record's session fields carry server_log. Tests: tests/test_boot_log.py (the 3 other failures predate this).

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 expected 'buckets [4, 8] K=[3, 3] (cap 3)' only appears when both buckets exist, so every
B=4 boot of an MTP arm failed identity (c132 20260930T18xx: slot, bundle, plain B=4 cells lost).
Expect '(cap K), greedy exact acceptance' instead, which every bucket set prints.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The expected 'buckets [4, 8] K=[3, 3] (cap 3)' only appears when both buckets exist, so every
B=4 boot of an MTP arm failed identity (c132 20260930T18xx: slot, bundle, plain B=4 cells lost).
Expect '(cap K), greedy exact acceptance' instead, which every bucket set prints.

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>
Before: the MTP bundle (slot + overlap + async + early reseed, k8v4) lived on mtp-async and the 0034 spec-verify fold
(verify 90 -> 60 ms at B8/32k, c130r2) on sdpa-spec-fold, on a different image (pk3q) and base (bf8 KV, dn slot arm),
so nobody had run them together. The merge is clean: mtp_batch.py takes both the slot/async edits and the fold's
FoldGroupIO/v_posf wiring, tp.py gets the fold branch (with the a178720 use-after-free fix), and ttx keeps the boot-log
fix. No conflicting hunks; INDEX.tsv rows from both sides kept.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The fold overlay was built for vllm-tt:k2-mr-pk3q, and ttx refuses a manifest on another image, while every k8v4 arm
runs on pk3r. pk3r is pk3q + 0033 and nothing else (Dockerfile.vllm-tt-k2-mr-pk3r), so a new ttnn-incr tree pk3r was
initialised from ttbuild-pk3r (0033 recorded as applied after a clean reverse dry-run), then built with 0033+0034.
The _ttnncpp.so is byte-identical to pk3q+0033+0034's (same store paths), _ttnn.so stays the image's, and the manifest
now names pk3r (build-host id acef273b; the box's pk3r has the same _ttnn.so bytes). Paths GC-rooted and shipped.

k8v4 has no tt-metal patch: bf4 V goes through the sdpa_decode kernels the overlay carries. c130's ttsim ran only
bf8/bf8 and Bw 4/8, so the probe gains Bw 1/2 boot cases (new with buckets 1,2,4,8) and a stack mode: at K bf8 / V bf4
with dual NoC, all 8 boot shapes pass the gate (bitwise or PCC >= 0.99999), program-cache repeats are bitwise, the
must-fail rung fails (PCC 0.05-0.08) and the unset flag refuses. ttsim only: no speed number.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
c132 left the bundle +2.4%/+7.4% behind the best arm with verify as the big phase, and c130r2 showed the fold cuts
verify by a third on a bf8 base, so the stack is the combination to screen (combine levers, do not kill in isolation).
Four arms on pk3r + pk3r+0033+0034: -stack (bundle + fold + buckets 1,2,4,8), -stack-b48 (without b1248), -stack-plain
(PLAIN_ONLY, same image/overlay, fold unset: the equiv reference) and -stack-mf (fold must-fail). Banners fail closed on
both fold banners, the B-independent "(cap 3), greedy exact acceptance" and the store overlay; lint OK. The queue brackets
the best-arm reference with two stack sweeps; GSM8K/retrieval run only if the stack wins.

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>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
b48 beat the same-day best arm at B8/32k -3.4%, B4/4k -2.8%, B4/32k -5.4% (B8/4k +1.4%) in one run; the headline needs a second run and the exact-combination gates.

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>
c135: MTP stack is the best arm (README best column, LEVERS current best, STATUS final)
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 9s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 1m26s
tt-stack-ci / Build simulators and check the host module (push) Failing after 1m19s
tt-stack-ci / Report upstream drift (push) Successful in 6s
580e520715
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Grok merged commit 580e520715 into master 2026-10-01 02:43:57 +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!140
No description provided.