bench(perf-loop c1): G2 decode is not bandwidth-bound; the fixed cost is #90

Closed
Grok wants to merge 0 commits from perf-loop-c1 into master
Owner

Cycle 1 of the TT perf loop. No card was taken — all slots held by the deploy, MTP and tt-quant agents — so this is the off-card half of the cycle: re-deriving the decode weight-read roofline for G2, which the loop prompt makes cycle 1's blocking item because it re-ranks everything else.

Method is validated before it is extended. The per-matmul byte accounting in n1-matmul-read-compute-split-20260912T174500Z.jsonl is summed over 64/48/16 layers at production dtypes and reproduces that record's own 23.34 ms figure to 0.7%. Only then is it applied to G2.

traffic GB/card/tok weight read ms
production (bf8) 10.760 23.18 (recorded 23.34)
G2 (all-bf4) 7.522 16.52

G2 decode is not bandwidth-bound. At B=1 4k, TP=2: weight read 16.5 ms (32.5%), scaling non-read 13.6 ms (26.7%), fixed 20.7 ms (40.7%). The largest single component of the two-card step is the part that does not scale with device count, and it is bigger than the weight read.

Also supersedes the 287.9 GB/s bf4-saturation claim — marginal bf4 read in the same record is 454.2 GB/s.

Derived, not measured, and labelled so in the record. F = 20.7 ms comes from two points fitting a two-parameter model exactly, so it cannot separate fixed host cost from CCL growing with device count; that distinction decides where to attack. Next experiment is a per-op Tracy profile at TP=1 and TP=2 at the same shape, subtracted — needs a mesh window.

Cycle 1 of the TT perf loop. No card was taken — all slots held by the deploy, MTP and tt-quant agents — so this is the off-card half of the cycle: re-deriving the decode weight-read roofline for G2, which the loop prompt makes cycle 1's blocking item because it re-ranks everything else. **Method is validated before it is extended.** The per-matmul byte accounting in `n1-matmul-read-compute-split-20260912T174500Z.jsonl` is summed over 64/48/16 layers at production dtypes and reproduces that record's own 23.34 ms figure to 0.7%. Only then is it applied to G2. | | traffic GB/card/tok | weight read ms | |---|---:|---:| | production (bf8) | 10.760 | 23.18 (recorded 23.34) | | **G2 (all-bf4)** | **7.522** | **16.52** | **G2 decode is not bandwidth-bound.** At B=1 4k, TP=2: weight read 16.5 ms (32.5%), scaling non-read 13.6 ms (26.7%), **fixed 20.7 ms (40.7%)**. The largest single component of the two-card step is the part that does not scale with device count, and it is bigger than the weight read. Also supersedes the 287.9 GB/s bf4-saturation claim — marginal bf4 read in the same record is 454.2 GB/s. **Derived, not measured**, and labelled so in the record. F = 20.7 ms comes from two points fitting a two-parameter model exactly, so it cannot separate fixed host cost from CCL growing with device count; that distinction decides where to attack. Next experiment is a per-op Tracy profile at TP=1 and TP=2 at the same shape, subtracted — needs a mesh window.
bench(perf-loop c1): G2 decode is not bandwidth-bound; the fixed cost is
All checks were successful
tt-stack-ci / Report upstream drift (pull_request) Successful in 9s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 27s
d225e3590a
Believed: decode is weight-read bound at 23.34 ms, 37% of the step.

Evidence: that figure was measured at bf8 MLP. Reusing the same per-matmul byte
accounting (which reproduces the recorded 23.34 ms to 0.7%, so it is validated
before being extended) over the all-bf4 G2 checkpoint gives 7.522 GB/card/token
and a 16.52 ms read -- 30.1% less traffic, 6.66 ms saved, and only 32.5% of the
two-card step.

Decomposing that step against the TP fit (R=60.2, F=20.7): the largest single
component at TP=2 is the 20.7 ms that does NOT scale with device count, at 40.7%
-- bigger than the weight read. That re-ranks the decode inventory away from
bandwidth and onto the fixed per-step cost, which is also the only component that
pays on one card and two cards alike.

Also supersedes the 287.9 GB/s bf4 saturation claim: marginal bf4 read in the
same record is 454.2 GB/s.

Derived, not measured, and labelled so in the record: no card was taken, all
slots were held by other agents.
Owner

verdict: approve

tier: T0 (bench/analysis — no .nix, no code exec, no secrets)

rationale: Two-file change — a new jsonl record plus a STATUS.md section — re-deriving the G2 decode weight-read roofline from already-measured byte accounting. Arithmetic checks out: 10.760 / 468.7 GB/s = 22.96 ms vs recorded 23.34 (≈0.7%); G2 7.522 / 454.2 = 16.56 ms ≈ the 16.52 claimed. The fixed-vs-scaling decomposition (F=20.7ms from two points) is labelled derived-not-measured, and the caveats honestly state what the model cannot separate (fixed host cost vs CCL growing with device count).

concerns:

  • [nit] ...jsonl:10 — "23.18 ms" is inconsistent with the arithmetic: 10.760 / 468.7 = 22.96 ms, not 23.18. The cited 0.7% error compares 23.18 to the recorded 23.34; the honest derived value (22.96) is 1.6% off. Does not change the conclusion but worth tightening for traceability.
**verdict:** approve **tier:** T0 (bench/analysis — no .nix, no code exec, no secrets) **rationale:** Two-file change — a new jsonl record plus a STATUS.md section — re-deriving the G2 decode weight-read roofline from already-measured byte accounting. Arithmetic checks out: 10.760 / 468.7 GB/s = 22.96 ms vs recorded 23.34 (≈0.7%); G2 7.522 / 454.2 = 16.56 ms ≈ the 16.52 claimed. The fixed-vs-scaling decomposition (F=20.7ms from two points) is labelled derived-not-measured, and the caveats honestly state what the model cannot separate (fixed host cost vs CCL growing with device count). **concerns:** - [nit] `...jsonl:10` — "23.18 ms" is inconsistent with the arithmetic: 10.760 / 468.7 = 22.96 ms, not 23.18. The cited 0.7% error compares 23.18 to the recorded 23.34; the honest derived value (22.96) is 1.6% off. Does not change the conclusion but worth tightening for traceability.
bench(perf-loop c2): a stale slot lock idled both cards for 4h47m
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Has been cancelled
tt-stack-ci / Report upstream drift (pull_request) Has been cancelled
f8c3de2b9f
Believed: the cards were busy and the loop's mesh measurement was correctly
queued behind other agents' work.

Evidence: at 04:19 the lock read card0=deploy-pool,card1=deploy-pool with an
mtime of 23:32 -- 4h47m earlier -- while zero containers were up, load average
was 0.06, and no vllm/tt_metal/ttnn process existed. Two waiters were blocked,
including a mesh acquire owned by the same agent as the stale claim: a
self-deadlock whose 4 h budget was about to expire having done no work.

The owner file records no holder PID, so no waiter can distinguish a live claim
from a dead one, and correct cooperative behaviour becomes a deadlock. The
durable fix -- PID in the owner file, reclaim when it is gone, trap on release,
documented in the tt-card-slot skill -- is assigned to the ttx owner rather than
applied here, because a wrong reclaim rule is worse than the bug.

Cycle 2's Tracy profile did not run and carries forward.
bench(perf-loop c3): the per-op profiler cannot name ops; redesign before spending the window
All checks were successful
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 1m10s
tt-stack-ci / Report upstream drift (pull_request) Successful in 9s
5bc53ad449
Believed: the 20.7 ms fixed decode cost could be itemised with a per-op Tracy
profile at TP=1 and TP=2, subtracted.

Evidence: runtime_id_to_opname_ resolves nothing on vllm-tt:k2-tracy. op_name is
blank in 5,962/5,962 traced rows, 5,916/5,916 UNTRACED rows, and the 09-12 P0
CSVs -- three failures, two tracing modes, two dates. The untraced arm being
equally blank refutes the natural hypothesis that trace replay strips
attribution; this is a build defect, not a tracing-mode one, and it is a
different defect from the prefill marker-ring overflow, so a bigger ring does
not fix it.

The experiment is redesigned rather than abandoned: the same CSV reports
per-device kernel service time with no op names needed, which splits a step into
device-side and host-side and makes CCL growth visible as per-card device kernel
time rising from TP=1 to TP=2 while per-card weight bytes halve. The Tracy image
reproduces the production decode control to 0.26%, so it is comparable.

Caught off-card while card1 ran the MTP KL smoke, so no window was spent
discovering this on hardware.
bench(perf-loop c2): correct the slot-deadlock remediation -- PID liveness is the wrong test
All checks were successful
tt-stack-ci / Report upstream drift (pull_request) Successful in 6s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 25s
15b96d5f45
My cycle-2 record prescribed 'record the holder PID, reclaim when that PID is
gone'. That is wrong and would have been worse than the bug it fixes: a slot is
designed to outlive the ssh session that took it, so the recorded pid is dead
moments after a perfectly healthy acquisition, and reclaiming on pid liveness
would evict every live job on the box.

The measured cause was different too. ttx slot acquire polls ON the box over
ssh, so a local pkill does not kill an acquire already in flight: a driver killed
at 21:21 left its remote waiter alive, which won the mesh at 23:32 and had no
parent left to release it.

PR #91 reclaims only when all three hold -- owner-line container not running, no
container on the card's device node, and claim older than --max-idle. A claim
owns a container; age only guards the acquire-to-docker-run gap.

Also records the cost: both weight footprints lost, FP8 REFUSED after waiting its
full 4 h behind the stale claim.
Member

Grill sub-issues (2026-09-26, Tenstorrent)

Opened / linked as dependencies of this PR (parent blocked by these):

Lane Issue Call
perf-loop #93 Tracy-split fixed decode cost (host vs CCL) GO next
deploy #94 prefix cache ship (gates 2–4); also #48 GO
deploy #95 ThinkingCap-G2 default (token cut) GO
MTP #96 K/auto-K × prompt-class matrix (under #63) GO
KV #78 / #79 asymmetric K8/V4 GO
prefill #97 GDN out-proj colpar A/B on 2×p150a GO
spec #98 ngram-on-MTP host oracle (real edits) GO oracle

Already linked: #63 (MTP umbrella).

PARK / WATCH (not opened as deps): weight-read/bf4 until #93; Thatch pair/quad #66; AGMM widen #51; SDPA k_chunk; metal #55548 / vllm #131.

Simultaneous ownership: perf-loop → #93 then #97 · deploy → #94+#95 · MTP → #96 · KV → #79 · spec → #98.

## Grill sub-issues (2026-09-26, Tenstorrent) Opened / linked as dependencies of this PR (parent blocked by these): | Lane | Issue | Call | |---|---|---| | perf-loop | #93 Tracy-split fixed decode cost (host vs CCL) | **GO** next | | deploy | #94 prefix cache ship (gates 2–4); also #48 | **GO** | | deploy | #95 ThinkingCap-G2 default (token cut) | **GO** | | MTP | #96 K/auto-K × prompt-class matrix (under #63) | **GO** | | KV | #78 / #79 asymmetric K8/V4 | **GO** | | prefill | #97 GDN out-proj colpar A/B on 2×p150a | **GO** | | spec | #98 ngram-on-MTP host oracle (real edits) | **GO** oracle | Already linked: #63 (MTP umbrella). **PARK / WATCH** (not opened as deps): weight-read/bf4 until #93; Thatch pair/quad #66; AGMM widen #51; SDPA k_chunk; metal #55548 / vllm #131. Simultaneous ownership: perf-loop → #93 then #97 · deploy → #94+#95 · MTP → #96 · KV → #79 · spec → #98.
bench(perf-loop c4): the binding constraint is the host, not the model
All checks were successful
tt-stack-ci / Report upstream drift (pull_request) Successful in 11s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 52s
226d8ff46f
Believed: cycle 4 would measure the TP=1/TP=2 kernel-service split and start
attacking the 20.7 ms fixed decode cost.

Evidence: nothing can boot. MemAvailable is 3,979 MB against a 4,096 MB guard and
/var/lib/models has 20 G free against a 25 G precondition, so the perf loop's
measurement and the deploy agent's pool ladder are both refused by their own
guards -- correctly.

Quantified so the next window is not lost to it: 11,942 MB used against 896 MB of
total process RSS and a 4,096 MB hugepage reserve leaves ~7 GB with no owner,
the documented leaked-pinned-pages signature, and MemAvailable fell 6,151 ->
3,979 MB in one hour of loads. Only a reboot recovers it; a module reload
reclaimed 0 MB when measured.

On disk, tt-cache is 146 G of 415 G used, and 33 G of that is a P300 cache for a
board descriptor this cluster does not run. Not deleted here -- per-arm caches are
keyed by model+rev+env hash and belong to the ttx registry's gc, not to a
coordinator with rm.
bench(perf-loop c4): correct -- the boot refusal was transient, the memory risk is not
All checks were successful
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 23s
44d04460eb
My 05:19 reading was taken while a legitimate MTP container held memory. Minutes
later MTP released card1, MemAvailable recovered past the guard, and the deploy
pool ladder booted. So 'nothing can boot' was wrong as a standing claim.

The situation is worse than the original record implied, not better: during that
boot's weight load MemAvailable fell to 2,928 MB, below the ~3 GB level that
preceded two host freezes on 2026-09-14, and weight-cache load is the phase those
freezes occurred in.

That exposes a guard defect worth more than the incident: the 4 GB check is
evaluated at slot acquire, not during load, so it passes on a transient recovery
and then does not protect the phase that actually fails. Sample MemAvailable
during load.

The ~7 GB unaccounted and the 20 G disk headroom are unchanged and still want a
reboot plus a cache gc.
docs(ledger): withdraw the GDN-fix decode numbers -- they measured a loader bug
All checks were successful
tt-stack-ci / Report upstream drift (pull_request) Successful in 8s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 28s
1994c445d5
The 98.68 ms/token TG reading and the 'decode error 10.27% -> 3.87%' line are
withdrawn, not corrected. The research overlay's loader replaced tw['dt_bias']
and tw['neg_exp_A'] with fp32 IN PLACE; those feed gdn_decode_conv_gates and
fused_recurrent_gated_delta_rule_ttnn, which require bf16 and do not check, so
decode read fp32 bits as bf16 and returned nonsense rather than raising. Every
decode number from that arm measured the bug.

The anomaly flagged a day earlier -- decode improving although AB8 is
prefill-only -- was this, and it was the tell.

patches/prod-local-metal was never affected: the production port kept separate
*_f32 copies from the start. All prefill results stand; the prefill gate always
read the fp32 values it was meant to, so the L0-L31 sweep (GDN 8.97% -> 2.81%
mean, 19.13% -> 3.53% max, state 22.71% -> 5.25%) is unchanged. AB8=1 at
+7.7 ms/token stands, since that arm never set G_FP32.
bench(perf-loop c5): bfp4 serving had no arm; add g2-tp2-serve + 5-cycle synthesis
All checks were successful
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 27s
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
431c74aa25
Believed: the loop was card-blocked by other agents, and would measure a bfp4
bundle as soon as the mesh freed.

Evidence: when the mesh freed, the blocker turned out to be structural. The only
G2 TP=2 arm is g2-tp2-demo -- no vLLM, B=1 plain decode -- so batch makespan and
TTLT at B=4/8, the loop's primary metric, was not measurable on bfp4 by any
existing arm, and the bfp4 E2E figures we quote cannot be reproduced from the arm
set.

Adds g2-tp2-serve.toml, inheriting prod so the control is production-identical
except the checkpoint. The cache is the trap and the comment says so: prod pins
the shared legacy cache, tensorbins are named for tensor and dtype and never for
checkpoint, so a G2 arm pointed there would hit FP8 tensorbins and serve FP8
weights with every banner green. Keyed cache, and [expect] restates prod's list
in full because an arm replaces rather than extends it, plus min_counts 64 on the
bf4 loader banner -- the only runtime evidence separating this arm from prod.

Cycle-5 synthesis: cumulative measured gain is ZERO and the reason is the result.
Four closures with records (G2 is not bandwidth-bound; bf4 saturation superseded;
the per-op named table is dead on this binary; align mode and the TT plugin are
mutually incompatible), two reopenings (the GDN fix has no decode measurement
after the fp32-in-place withdrawal; ~7 GB of unowned host memory), and three
process findings that cost more card time than any lever would have won.
bench(perf-loop c6): boot the bfp4 serving arm; two of my own errors caught first
All checks were successful
tt-stack-ci / Report upstream drift (pull_request) Successful in 9s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 31s
147164ce3b
Believed (cycle 4): the 33 GB P300 tensor cache was reclaimable because P300 is a
board descriptor this cluster does not run.

Evidence: P300 is the MESH_DEVICE name our own TP=2 arms use, prod included. The
cache is reclaimable for a different reason -- its contents are bfp8 tensors for
the FP8 arm, which the owner dropped. Right conclusion, wrong reasoning, and an
inference from a directory name is not evidence. 20 -> 52 GB free.

Believed: omitting [cache] from g2-tp2-serve would give ttx's keyed default.

Evidence: ttx render showed TT_CACHE_PATH=/var/lib/models/tt-cache -- prod's
PINNED path, carried by inherits. Tensorbins are named for tensor and dtype and
never for checkpoint, so that arm would have served FP8 weights with all 64 bf4
banners green: exactly the failure the arm's own comment warns about, committed
while writing the comment. Fixed with an explicit mode = keyed, and the rule is
now in the file: always render an inheriting arm and read TT_CACHE_PATH.

ttx doctor independently reproduces this loop's ~7 GB pinned-leak figure at
6,789 MB by its own formula and rates REBOOT RECOMMENDED.

Arm is cold-booting; identity check pending, no number counts until it passes.
bench(perf-loop c7): the pinned leak blocks cold cache builds, and so blocks bfp4 work
All checks were successful
tt-stack-ci / Report upstream drift (pull_request) Successful in 9s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 28s
2d6790ef09
Two cold boots of g2-tp2-serve, both stopped by the in-load memory watchdog at
the same phase: MemAvailable 1275 MB then 1136 MB against a 1536 MB floor.

The identity refusal (QWEN36_ATTN_GDN_BF4 count 0) looked like a loader bug and
is not one. The keyed cache holds only 256 BFLOAT16 norm and embedding tensors;
the per-layer linear weights were never written, and that is exactly where the
bf4 banner fires. The arm is unproven, not disproven.

A cold tensor-cache build is far hungrier than a warm boot -- the deploy agent's
comfortable 3,786 MB low-water was a warm boot -- so with ~6.8 GB pinned and
leaked, no NEW arm can be brought up on this host at all. That blocks the owner's
stated priority, since the bfp4 serving arm is the instrument it needs. Seeding
does not avoid it: the existing G2 cache was built under a different
weight-affecting env and adopting it risks serving the wrong weights.

Kept from the second boot: num_gpu_blocks=16392, GPU KV cache size 1,049,088,
concurrency 4.00x at max_model_len 262,144 on bfp4 -- the 4x256k shape, reached
in a real vLLM boot and corroborating the capacity model from a different arm.
Recorded explicitly as NOT a pass; the server never became servable.

The watchdog's first real outing: fired twice, stopped gracefully both times,
cards usable and cache resumable. Without it these were the 09-14 host freezes.
bench(perf-loop c8): G2 cannot be served all-bf4 -- the flag is not in the production tree
All checks were successful
tt-stack-ci / Report upstream drift (pull_request) Successful in 6s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 25s
e894e95e72
Believed: g2-tp2-serve serves the all-bf4 G2 checkpoint, and cycle 1's 16.52 ms
weight read describes it.

Evidence: QWEN36_ATTN_GDN_BF4 does not occur anywhere in patches/. It lives only
in bench/mtp/overlay. ttx marks it required_env and refuses an arm without it, so
it IS set in the container env and the mounted production code simply does not
read it -- a flag no code reads is indistinguishable from one set correctly,
except in the dtypes on disk. The keyed cache settles it: across all 64 layer
directories, 256 BFLOAT4_B (the four MLP tensors) and 128 BFLOAT8_B (the two
attention/GDN projections).

So the arm is G2's re-rounded VALUES at the production dtype mix, not an all-bf4
arm. Re-deriving over the same validated byte accounting: 9.334 GB/card/token and
20.24 ms, so cycle 1's 6.66 ms saving is really 2.94 ms in the servable
configuration. The qualitative conclusion strengthens -- 39.8% of the step, still
not bandwidth-bound, and the 20.7 ms fixed term still dominates.

Two consequences flagged rather than resolved: every G2 serving number needs its
arm's dtypes checked, the B=8 sweep headline included; and the 11.27 GiB/card
footprint reported 64 bf4 banners that cannot come from patches/, so it did not
measure the servable tree.

The lever: porting the flag into prod-local-metal is worth 3.72 ms/token of
weight read and ~1.8 GiB/card.
bench(perf-loop c9): correct cycle 8 -- bfp4 all-bf4 is a merge gap, not an engineering gap
All checks were successful
tt-stack-ci / Report upstream drift (pull_request) Successful in 8s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 27s
dbea18f9f6
Cycle 8 concluded 'G2 cannot be served all-bf4' and proposed porting
QWEN36_ATTN_GDN_BF4 into patches/prod-local-metal as the highest-value lever.
The port already exists. git grep on origin/deploy/g2-prefix-0019 finds it four
times each in patches/prod-local-metal/.../attention/tp.py and .../gdn/tp.py,
plus QWEN36_BFP4_PACKED in weight_mapping.py; master has none of it.

What stands: the diagnosis of my own arm. g2-tp2-serve inherits master's
patches, so its attention/GDN weights stay bf8, and its tensor cache proves it
(256 BFLOAT4_B, 128 BFLOAT8_B). What does not: generalising from master to the
project.

Second error, also corrected: the deploy branch serves
thinkingcap-g2-bfp4-PACKED (4-bit on disk), not thinkingcap-g2-bfp4 (bf16
on-grid values the loader must pack). Different loader paths; I used the wrong
checkpoint.

The 64-banner contradiction is resolved and innocent: the 11.27 GiB probe
inherits prod-g2-prefix -> prod and did run the production tree, on the branch
where that tree has the flag; g2-tp1-probe gets its banners from the
mtp-thinkingcap overlay and the mtp2-triage image.

Action changes from 'scope a port' to 'land the deploy overlay and use
prod-g2-prefix'. 3.72 ms/token and ~1.8 GiB/card on merge.
bench(perf-loop c10): 10-cycle synthesis + tt-arm-hygiene skill
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 6s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 18s
ed3dc1fe1e
Cumulative measured speed gain across ten cycles: ZERO, and the synthesis records
that plainly with an empty attribution table rather than dressing derivations up
as results.

What the loop produced instead: seven closures with records (decode is not
bandwidth-bound for G2; bf4 saturation superseded at 454.2 GB/s marginal; the
per-op named table is dead on this binary and for a different reason than the
prefill one; align mode and the TT plugin are mutually incompatible;
--mamba-block-size is dead; the 287k KV shortfall withdrawn; master cannot serve
bfp4 all-bf4), and six corrections to my own earlier claims, each left legible
next to what it replaced.

Blockers ranked: (1) land deploy/g2-prefix-0019's overlay -- the all-bf4 serving
capability is written and tested and unmerged, worth 3.72 ms/token and ~1.8
GiB/card; (2) prod-g2-prefix is unrunnable as committed, its model is in no
models.toml and no packed checkpoint dir exists; (3) the ~7 GB pinned leak makes
cold cache builds impossible.

Adds .claude/skills/tt-arm-hygiene: render before boot and read TT_CACHE_PATH,
grep patches/ for the flag, verify dtypes in the tensor cache, absent-checks are
half of identity, slot claims own containers not pids, and a cold build is not a
warm boot. Every rule paid for by a failure in these ten cycles.
# Conflicts:
#	patches/prod-local-metal/models/demos/blackhole/qwen36/tt/attention/tp.py
#	patches/prod-local-metal/models/demos/blackhole/qwen36/tt/gdn/tp.py
A 40-line tail is exactly the wrong window for vLLM's EngineCore failure: the
message is 'See root cause above' and the child proc's traceback is thousands of
lines up. ttx then removes the container, so the evidence is gone for good --
this cost one full prod-g2-prefix boot cycle to learn.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bench(perf-loop c11): align + chunked prefill cannot coexist; leak now blocks every boot
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 8s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 20s
9044e00336
The all-bf4 serving arm loads all 64 layers at bf4 and then refuses to construct.
Not memory and not bfp4: vllm_tt_plugin/platform.py:207 sets disable_chunked_mm_input
unconditionally, and vLLM 0.26.0 asserts against exactly that in mamba_cache_mode=align.
Because validate_block_size runs after the weight load, the crash always presents at
40-64/64 banners with the host at its low-water mark, which is how two boots got read
as OOM. Fix is --no-enable-chunked-prefill and costs nothing, since
max-num-batched-tokens already equals max_model_len -- but it is UNVERIFIED: the
re-boot was refused by the slot guard, MemAvailable 3958 < 4096, with no process on
the box above 72 MB RSS. Filed as #101.

Also: ttx now keeps the whole container log when a boot crashes. A 40-line tail is
the wrong window for 'See root cause above'.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
On stock vllm-tt:k2 the align cache mode is UNREACHABLE, guarded from both sides by
vLLM 0.26.0: validate_block_size asserts `not disable_chunked_mm_input` in align mode,
and VllmConfig asserts chunked prefill IS enabled in align mode. The plugin sets the
former whenever the latter is on, so leaving chunked prefill on fires the first assert
and turning it off fires the second. Three boots of prod-g2-prefix to see it, two of
them wasted because the first assert runs in _initialize_kv_caches -- after the full
three-minute weight load, at the host's memory low-water mark, which reads exactly
like an OOM.

The flag protects a chunk boundary landing inside a multimodal item. The TT arms pass
--limit-mm-per-prompt {"image":0,"video":0} (QWEN36_SKIP_VISION=1 means the vision
tower is never built), so no such item can ever be scheduled and the flag is pure cost.
Guard it on the limits actually being zero, fail closed otherwise, and print
QWEN36_MM_CHUNK_GUARD so an arm can gate its identity on it -- without the banner an
arm is either not running this overlay or silently not in align mode, and both change
what the GDN state does under prefix caching.

Reading the limits is its own trap: model_config.limit_mm_per_prompt is init-only and
reads back empty, which made the first version of the guard fall open silently. The
live values are model_config.multimodal_config.limit_per_prompt, and they are
per-modality option objects, not ints.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bench(perf-loop c12): prefix caching is unreachable on this plugin, for a second reason
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 18s
8c5e07ecbb
Clearing the disable_chunked_mm_input deadlock got the boot past validate_block_size
and all the way to KV allocation -- 64/64 bf4 banners, pool delivered in full at 392
blocks / 766,869 tokens -- where it hits a capability gap rather than a config error:
in align mode vLLM emits a MambaSpec group for the 16 GDN linear_attn layers, and
model_runner.py:469 accepts only AttentionSpec/UniformTypeKVCacheSpecs, because the
GDN recurrent state is owned by the TT model and not by vLLM's KV manager.

So align + prefix caching has never run through this model_runner, and the -87.5%
makespan result on 4e91d87 needs reconciling against that before it is cited again.

Adds bench/arms/prod-g2.toml -- production + G2 packed + all-bf4 attention/GDN with
prefix caching OFF -- so the bfp4 control band is not blocked behind someone else's
feature. It is the honest control: it differs from prod in the checkpoint and the
weight dtype mix and nothing else.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Three levers, two bottlenecks, and every one of them verified to exist in
patches/prod-local-metal before being written down. That check matters here: of the
lever inventory's prefill entries, QWEN36_AGMM_PREFILL_GRID and the GDN gate-fp32 pair
are NOT in the served tree at all -- they live on unmerged branches, so setting them
would have produced a perfectly clean A/B between two identical arms.

L1 QWEN36_GDN_OUTPROJ_COLPAR (issue #97, grill GO) is the one expected to carry it:
prefill is 74-79% of wall at these shapes, and it changes all 48 GDN layers from
matmul+reduce-scatter to all-gather+matmul. L2 QWEN36_DEVICE_RESIDENT and L3
QWEN36_LM_HEAD_IN0_BLOCK_W=4 are decode-side and rank behind it.

Every lever gates its own banner in [expect], so the arm fails closed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
fix(arms): QWEN36_BFP4_PACKED cannot fire on an adopted cache -- stop gating identity on it
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 10s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 22s
58b330edf0
The bfp4 arms required a banner that is structurally impossible for them to print. It
comes from the unpack hook in weight_mapping.py, which runs only when the loader reads
the safetensors; these arms ADOPT a prebuilt tensor cache, so the checkpoint is never
opened. Four boots, zero occurrences, and the run refused on this banner alone with
everything else green: 64/64 bf4, served_root_ok, every other banner present.

Also corrects perf-loop-c12-align-mambaspec, which recorded the banner as observed. It
was not, in that boot or any other -- I wrote down what the arm asked for rather than
what the log said, which is the exact failure mode the counted-banner rule exists to
catch.

What witnesses the weights on a warm cache instead: the cache path, served_root_ok, and
the 64 counted bf4 banners. The arm comment says to re-add the packed banner for a cold
or keyed build, where the hook does run and a modelDir typo would serve FP8 in silence.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bench(perf-loop c12): first E2E number from an identity-gated all-bf4 arm
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 35s
tt-stack-ci / Report upstream drift (pull_request) Successful in 7s
47f1c03545
B=8, 4k in / 1k out, makespan 68.681 s, correctness pass, identity pass on 8 banners
with the served root matching the checkpoint and all 64 bf4 banners counted.

It reproduces the standing G2 B=8/4k makespan (67.10 s) to within 2.4%, which is the
main reason to trust the new arm rather than the other way round.

One rep, so not a band and nothing may be ranked against it yet -- ttx ab with
--repeats 2 against bundle A is running, which produces the band and the bundle
result interleaved in one go.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
fix(ttx): sweep32k threw away every TTFT and TG number it measured; ttx ab could not run it
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 7s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 18s
cc6dcf6a98
_cell_metrics looked for flat keys (ttft_p50_s, decode_ms_per_token_p50) while
serving-bench emits nested ttft{} and decode{} dicts. Not one key ever matched, so the
fallback kept wall_s alone and every sweep32k record lost the TTFT distribution, the
per-user ms/token, the aggregate tok/s and prefill_share_of_wall -- numbers the bench
had measured all along, and which the owner asks for in every status. The control run
this morning reported '68.681 s' when the same JSON also held TTFT p50 6.32 s, TG 50.812
ms/token and prefill share 64.17%.

That last one matters beyond reporting: 64.17% is measured, where the loop brief carries
74-79%. Prefill still dominates, but by less than assumed at B=8/4k.

Second fix: suites.run dispatched sweep32k WITHOUT passing attach, so  -- which
acquires the mesh slot itself and boots with no_slot=True -- had its suite acquire the
slot a second time and every cell refused with 'busy: card0 held by ...:ab'. The paired
A/B tool could not run its own default suite. sweep32k now accepts a handed-down session
(valid for one B only, since max_num_seqs is fixed at boot) and never tears it down.

Adds bench/arms/prod-g2-bundleB.toml: the decode half of bundle A. Colpar is split out
because it creates a NEW weight (tw['out_colpar']) that no warm cache holds, so it needs
a cold build -- a general rule worth keeping: a lever that adds a weight invalidates
every adopted cache.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bench(perf-loop c13): bundle B wins bfp4 B=8 makespan by 10.2%, attribution pending
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 11s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 22s
d71997eac7
QWEN36_DEVICE_RESIDENT + QWEN36_LM_HEAD_IN0_BLOCK_W=4 on the bfp4 G2 arm, TP=2, B=8,
4k in / 1k out: makespan 68.028 -> 61.066 s. Both bundle reps land 6.04 s below the
lower edge of a control band whose own spread is 1.31 s, so this is not boot noise.
TG 50.74 -> 44.56 ms/token, p99 -23%, aggregate +15.9%, and the one whole-batch stall
the control showed disappears.

TTFT splits and the record says so plainly: p50 regresses 26% while max is flat and
spread narrows 11.5%. The bundle does not delay the first agent, it levels the early
agents toward the late ones -- a win on time-to-last-token, not on TTFT p50.

Correctness: the suite gate passes on all four runs and that is explicitly not enough
to ship. Resident decode moves where the token is produced, so the near-tie greedy
check, GSM8K and retrieval are required first.

Two things this also settles. Measured prefill share at this shape is 64%, not the
74-79% the brief carries. And QWEN36_GDN_OUTPROJ_COLPAR cannot be A/B'd on an adopted
cache at all -- it adds a weight, so #97 needs a cold 23 GB build budgeted for it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bench(perf-loop c13): attribution -- QWEN36_DEVICE_RESIDENT carries the entire 10% win
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 16s
1624c18edf
Leave-one-out against the two-rep control band. L2 alone is -10.02% where the bundle is
-10.23%; L3 alone is -0.22%, inside the band on every metric. Interaction term -0.145 s,
one ninth of the band spread, so there is none -- the levers do not combine because only
one of them does anything.

Ship QWEN36_DEVICE_RESIDENT alone. Dropping the lm_head blocking change costs nothing
measurable and removes a lever that prints no banner and so can never fail closed.

Speed only. The resident-decode equivalence gate, falsifier rung included, is running.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bench(perf-loop c14): resident-decode gate is INCONCLUSIVE -- the falsifier did not fire
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 31s
87011dd909
R2 (resident) compared clean against the greedy reference and that proves nothing,
because R3 passed. R3 runs the same arm with QWEN36_RESIDENT_IGNORE_RELOAD=1 and should
diverge; it did not, so the join+condense schedule at B=8 never created a stale chain
and the test was never shown capable of failing. The driver says so in its own header
and printed it: 'this test cannot see the hazard at B=8'.

So QWEN36_DEVICE_RESIDENT is NOT correctness-cleared. The -10.02% makespan win stands
as a measurement; shipping is blocked until a gate that can fail passes.

Two scope problems to fix together: the run used the legacy FP8 goal1 profile rather
than the bfp4 arm the win was measured on, because vllm-tt-serve.sh is now a shim over
ttx serve-legacy and MODEL_DIR no longer retargets it. Porting the driver to ttx fixes
the dtype scope and the slot handling in one move.

Also records a hazard I walked into: the legacy profile cold-rebuilt the 28 GB FP8 P300
cache, which I had reclaimed earlier, taking /var/lib/models to 99% full with 5.9 GB
free on a shared volume. Nothing broke. The legacy path bypasses ttx's disk guard.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
docs(ledger): resident decode -10.02% scoped and cited, measured but not cleared
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 8s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 19s
e31c9ec36a
Three entries, each scoped to TP, B, context, dtype and pin with its record path:
the resident-decode win and why it may not ship yet; the measured 64% prefill share
that supersedes the 74-79% the planning docs carry at these shapes; and the rule that
a lever adding a weight invalidates every warm cache, which is what makes #97 an
hour of card time rather than a free env A/B.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
skills: falsifier-first gate reading, plus three arm-hygiene rules this session paid for
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 15s
70d0ad3417
tt-falsifier-first is new and is the one I most want future-me to read: a passing
equivalence rung means nothing until the fault-injected rung has been shown to fail.
It cost a -10.02% win being held back, correctly, and it would have been easy to report
R2's clean pass as a clearance.

tt-arm-hygiene gains three: a banner that cannot fire is worse than no banner (load-time
banners are impossible on an adopted cache, and requiring one refuses every run); a lever
that adds a weight invalidates every warm cache and so costs a cold build, not an env
A/B; and the legacy gate drivers bypass the ttx disk guard and cannot be retargeted off
the FP8 profile.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bench(perf-loop c15): the resident gate is unsound at this configuration, two defects
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 4s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 14s
19ab98689f
R5 -- the control self-check -- FAILED: the control arm does not reproduce the reference
the control itself captured. That is not evidence against resident decode, it means the
run had no working control, so nothing in it was anchored.

Likely mechanism, read from the driver plus two AGENTS traps and stated as such rather
than measured: R0 captures at --logprobs 5 (host sampling) while every compare rung runs
--logprobs 0, and the goal1 profile defaults TT_CFG_SAMPLE_ON_DEVICE=decode_only, so the
control -- which sets no QWEN36_DEVICE_ARGMAX -- samples on device against a host-captured
reference. R1/R2/R3 escaped it only because they all set device argmax, which is already
known to match host greedy.

Together with R3's blindness this hardens the cycle-14 verdict: the driver cannot gate
this lever as written. QWEN36_DEVICE_RESIDENT stays un-cleared. Neither defect says the
lever is wrong, and neither touches the -10.02% speed A/B, which stands on its own band.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gate(#52): R3 fault injection was vacuous; rebuild the falsifier on the decision site
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 20s
56ef74a01b
R3 (MUST FAIL) passed at B=4 and B=8 under every schedule, including a
deliberately harsh one. We believed the schedule was too gentle. It was not.

reload_inputs is an OR computed in generator.py:1826. The injection in
qwen36_vllm.py:639 popped kwargs["reload_inputs"] -- which line 1840 uses only
to ADD True -- and forced reset_batch=False, a disjunct dominated by
mode_switched, which fires on the same prefill->decode transitions. Both
suppressed terms were covered by surviving disjuncts, so the fault never
reached the chain. The c14/c15 R3 passes are withdrawn in BOTH directions:
they showed neither safety nor a defect. The rung measured nothing.

Same OR explains the R0/R5 asymmetry (inferred): 'not on_device_sampling' is a
disjunct, so an R0 captured at --logprobs 5 reloads every step while the
--logprobs 0 compares take trace replay.

Rebuild: QWEN36_RESIDENT_FORCE_NO_RELOAD overrides the OR's RESULT and logs a
running count of genuine reloads suppressed, so suppressed=0 reads as
INCONCLUSIVE rather than as a pass. New arm prod-g2-L2only-fault.toml moves the
gate onto the bfp4 G2 arm the -10.02% win was measured on. Written, not run.

The win is unchanged and still NOT correctness-cleared.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gate(#52): resident decode passes greedy equivalence 8/8; falsifier fails 0/8
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 17s
c636909427
First run in which the MUST-FAIL rung has ever failed, so this is the first
informative pass.

R1 prod-g2 (resident off, 0 DEVICE_RESIDENT banners) vs R2 prod-g2-L2only
(resident on): 8/8 byte-identical greedy completions across 8 concurrent
sequences. R3 prod-g2-L2only-fault (QWEN36_RESIDENT_FORCE_NO_RELOAD): 0/8
identical, 136 genuine reloads suppressed, output degenerates to pure newlines.

The -10.02% makespan win is correctness-cleared AT THIS SCOPE only: TP=2, bfp4
G2, B=8, greedy, 40-120 token outputs. Long-output, long-context, GSM8K,
retrieval, B=4 and TP=1 are NOT covered, and this repo's workload is
long-context, so this does not license a default.

Also fixed: both new banners passed lazy %-args, but this module logs through
loguru, which does not %-interpolate, so the suppressed count rendered as the
literal '%d'. The 136 figure survived only because it was recovered by counting
log lines. Now f-strings.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
fix(tree): restore master's tp_common.py and model.py -- my merge silently reverted them
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 18s
tt-stack-ci / Report upstream drift (pull_request) Successful in 9s
81712ec1e7
Found while re-checking the prefill lever inventory. I had claimed, twice, that
QWEN36_AGMM_PREFILL_GRID was 'not in the served tree (unmerged branches)'. That
was wrong. It is in origin/master. My own merge (0b4775d) resolved conflicts in
favour of the old branch side for two files and silently reverted them, while
merge-base still reported HEAD as containing master -- so the usual check did
not catch it.

Dropped by that merge and now restored:
- tp_common.py: _agmm_prefill_grid (QWEN36_AGMM_PREFILL_GRID override),
  agmm_gather_buffer (persistent CCL gather buffer) and the
  persistent_output_buffer plumbing through all_gather_matmul_prefill. Real
  prefill machinery, not just a lever knob.
- model.py: four Issue #47 guard asserts on the unqualified unaligned
  prefix-resume path.

The served tree is now origin/master plus exactly three intentional additions
(platform.py MM chunk guard, the generator.py falsifier, the qwen36_vllm.py
fault counter), all pure insertions.

Consequence for measurements: every hardware run in cycles 11-18 executed on the
degraded tree. The A/B conclusions survive -- both arms shared the defect, so the
-10.02% and the 8/8 vs 0/8 gate remain valid as RELATIVE results -- but the
absolute numbers are not master-tree numbers, and the 'control must be
production-identical' guard was violated for all of them. Re-confirmation on the
corrected tree is queued.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member

Decode advisory (post-c106 / R-2026-09-29-abso) — for the loop agent

Baseline: arm prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so, TP=2, G2 bfp4, bf8 KV. Makespan 92.99 / 39.64 / 59.81 / 32.79 / 28.13 s; TG 39.92 / 29.66 / 33.14 / 27.95 / 26.66 ms; vs prod-g2 −35.5…−41.1%. Gates: NEAR_TIE, GSM8K 290/300, retrieval 1.0. B=1 already clears 30 tok/s. Open decode problem: +10.26 ms TG from 4k→32k at B=8 (long-ctx), not more DRAM.

1. Immediate keep / kill

  1. Finish so-LOO first — additive at 4k, sub-additive at 32k (TG 39.92 vs ab-alone 39.71). Drop the so knob that taxes 32k decode; keep ab + the rest. Do not re-gate ab alone.
  2. c107 AGMM factorial — prefill-ranked, not decode. Only reopen with bf8-in0; alone knobs inert/dead in LEVERS.
  3. c108 SDPA×MR dual-NoC split-plot — highest decode EV in queue. Alone SDPA knobs inert; MR dual-NoC alone tiny. Promote only a combo win that moves the +10 ms 32k TG.
  4. Fast-boot / #113 — harness only; no TG claim until BIT_EXACT validate.
  5. Trust LEDGER over LEVERS Pending for ab/so/gf/w2/pf.

2. Highest-EV decode left on our cards

  1. c108 dual-NoC combo — only experiment aimed at long-ctx TG; SDPA ~12 ms of ~40 at 32k is one-NoC/read-bound.
  2. Tracy fixed-cost split (#93) — derived F≈20.7 ms (~41% of B=1 step) still unsplit host vs CCL. Do before more fidelity stacking (GSM8K already 295→290).
  3. Traffic leftovers — AR tiny 8×32 tiles; MR gate+up concat (not dead minimal_matmul); shard padding ~5.9% dead on w1/w3. Cheap after c108.
  4. GDN tile cost — per-tile FPU, not barriers. gf HiFi2 shipped; fuse/lead-in/batch dead. Next only if Tracy names tile-op time (fewer fp32 scratch / fidelity phases — not SFPLOADMACRO).
  5. Asym KV K8/V4 (#79) — code ready, no HW yet. Byte lever for 32k SDPA; gate after dual-NoC reader. Flipped K4/V8 is the falsifier.
  6. Dispatch — 0030 already won; don’t reopen CoreRange merges. Remaining ~1.2 ms is layout around MR — only if Tracy names it.
  7. DRAM prefetcher — blocked on pin header. Park.
  8. MTP at B≥4 — dead wall at B=4/8; leave to MTP track. Don’t steal mesh until c108 + Tracy land.

3. Newest techniques — what to lift

Technique Port? Action
metal MTP #55548 / #57890 QB2/WH demos; our TP=2 needs overlays Stay on mtp-thinkingcap; lift traced draft + on-device accept only — not a perf-loop arm
vllm device-owned drafter (#131) Serving contract yes Copy for MTP serving; skip GPU PaRD/self_draft
ngram-on-MTP (#98) Host oracle portable GO on real edits first; synth ladders lie
Prefix × decode Feature yes Owner deploy (#73/#94); loop only measures interaction
DSpark / SuffixDecoding Host first After MTP B=1 gap; SuffixDecoding host replay cheapest
Fused decode (norm+gate, SwiGLU) Idea yes After c108; SwiGLU only as MR-concat, not c38 form
Upstream SDPA V@NOC1 Already in c108 S Prefer our pk3r probe over wholesale cherry-pick

4. Do not chase

MTP at B=4/8 · SDPA knobs alone · AGMM alone · GDN fuse/lead-in/batch · own-core NoC loopback · MR retune beyond shipped · bf8 lm_head MR · FS8 · dispatch merges · prefetcher until pin · any LEVERS dead row without new scope.

5. Protocol

Must-fail + restart wb per variant · hang kernels one-card first · --ignore-eos / fixed 1024 out · interleaved ≥2 controls + Welch · log AICLK · tiers: bit-exact → near-tie → REAL only if ≥5% and quality · re-gate the stacked bundle · LEDGER closes, LEVERS indexes · no ttsim perf.

6. Standing orders

Decode loop on 2×p150a / ThinkingCap G2 / best prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so (R-2026-09-29-abso): finish so-LOO and drop the knob that taxes B8/32k TG; then run c108 (SDPA×MR dual-NoC) as the only experiment aimed at the +10 ms long-ctx TG — promote only a combo win. Keep fast-boot as harness. Next EV: Tracy #93, then traffic leftovers, then K8/V4 #79 behind a working dual-NoC reader. Hands off MTP-at-batch, prefetcher, GDN barrier tricks, FS8, LEVERS dead rows. Every kernel: must-fail + process restart + AICLK + ignore_eos + interleaved Welch + LEDGER/LEVERS grep before build; stack only under #110 tiers and re-gate the whole arm.

— Tenstorrent (grill-first decode advisory, 2026-09-29)

## Decode advisory (post-c106 / `R-2026-09-29-abso`) — for the loop agent **Baseline:** arm `prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so`, TP=2, G2 bfp4, bf8 KV. Makespan **92.99 / 39.64 / 59.81 / 32.79 / 28.13 s**; TG **39.92 / 29.66 / 33.14 / 27.95 / 26.66 ms**; vs `prod-g2` **−35.5…−41.1%**. Gates: NEAR_TIE, GSM8K **290/300**, retrieval **1.0**. B=1 already clears 30 tok/s. Open decode problem: **+10.26 ms TG from 4k→32k at B=8** (long-ctx), not more DRAM. ### 1. Immediate keep / kill 1. **Finish so-LOO first** — additive at 4k, sub-additive at 32k (TG 39.92 vs ab-alone 39.71). Drop the so knob that taxes 32k decode; keep ab + the rest. Do not re-gate ab alone. 2. **c107 AGMM factorial** — prefill-ranked, not decode. Only reopen with **bf8-in0**; alone knobs inert/dead in LEVERS. 3. **c108 SDPA×MR dual-NoC split-plot** — **highest decode EV in queue.** Alone SDPA knobs inert; MR dual-NoC alone tiny. **Promote only a combo win** that moves the +10 ms 32k TG. 4. **Fast-boot / #113** — harness only; no TG claim until BIT_EXACT validate. 5. Trust **LEDGER over LEVERS Pending** for ab/so/gf/w2/pf. ### 2. Highest-EV decode left on our cards 1. **c108 dual-NoC combo** — only experiment aimed at long-ctx TG; SDPA ~12 ms of ~40 at 32k is one-NoC/read-bound. 2. **Tracy fixed-cost split (#93)** — derived F≈20.7 ms (~41% of B=1 step) still unsplit host vs CCL. Do **before more fidelity stacking** (GSM8K already 295→290). 3. **Traffic leftovers** — AR tiny 8×32 tiles; MR gate+up concat (not dead `minimal_matmul`); shard padding ~5.9% dead on w1/w3. Cheap after c108. 4. **GDN tile cost** — per-tile FPU, not barriers. gf HiFi2 shipped; fuse/lead-in/batch dead. Next only if Tracy names tile-op time (fewer fp32 scratch / fidelity phases — not SFPLOADMACRO). 5. **Asym KV K8/V4 (#79)** — code ready, no HW yet. Byte lever for 32k SDPA; gate *after* dual-NoC reader. Flipped K4/V8 is the falsifier. 6. **Dispatch** — 0030 already won; don’t reopen CoreRange merges. Remaining ~1.2 ms is layout around MR — only if Tracy names it. 7. **DRAM prefetcher** — blocked on pin header. Park. 8. **MTP at B≥4** — dead wall at B=4/8; leave to MTP track. Don’t steal mesh until c108 + Tracy land. ### 3. Newest techniques — what to lift | Technique | Port? | Action | |---|---|---| | metal MTP #55548 / #57890 | QB2/WH demos; our TP=2 needs overlays | Stay on `mtp-thinkingcap`; lift **traced draft + on-device accept** only — not a perf-loop arm | | vllm device-owned drafter (#131) | Serving contract yes | Copy for MTP serving; skip GPU PaRD/self_draft | | ngram-on-MTP (#98) | Host oracle portable | GO on **real** edits first; synth ladders lie | | Prefix × decode | Feature yes | Owner deploy (#73/#94); loop only measures interaction | | DSpark / SuffixDecoding | Host first | After MTP B=1 gap; SuffixDecoding host replay cheapest | | Fused decode (norm+gate, SwiGLU) | Idea yes | After c108; SwiGLU only as MR-concat, not c38 form | | Upstream SDPA V@NOC1 | Already in c108 S | Prefer our pk3r probe over wholesale cherry-pick | ### 4. Do not chase MTP at B=4/8 · SDPA knobs alone · AGMM alone · GDN fuse/lead-in/batch · own-core NoC loopback · MR retune beyond shipped · bf8 lm_head MR · FS8 · dispatch merges · prefetcher until pin · any LEVERS dead row without new scope. ### 5. Protocol Must-fail + **restart wb per variant** · hang kernels one-card first · `--ignore-eos` / fixed 1024 out · interleaved ≥2 controls + Welch · log AICLK · tiers: bit-exact → near-tie → REAL only if ≥5% **and** quality · **re-gate the stacked bundle** · LEDGER closes, LEVERS indexes · no ttsim perf. ### 6. Standing orders > Decode loop on 2×p150a / ThinkingCap G2 / best `prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so` (`R-2026-09-29-abso`): finish **so-LOO** and drop the knob that taxes B8/32k TG; then run **c108** (SDPA×MR dual-NoC) as the only experiment aimed at the +10 ms long-ctx TG — promote only a combo win. Keep fast-boot as harness. Next EV: **Tracy #93**, then traffic leftovers, then **K8/V4 #79** behind a working dual-NoC reader. Hands off MTP-at-batch, prefetcher, GDN barrier tricks, FS8, LEVERS dead rows. Every kernel: must-fail + process restart + AICLK + ignore_eos + interleaved Welch + LEDGER/LEVERS grep before build; stack only under #110 tiers and re-gate the whole arm. — Tenstorrent (grill-first decode advisory, 2026-09-29)
Member

Grill sub-issues — amd-qwen / tinygrad borrow-adapt lane (2026-09-30, Tenstorrent)

Eval framing: portable wins first from jacobrosenthal amd-qwen-on-master / related AMD ROCm Qwen3.8 serving; reshape for TT/vllm-tt/ThinkingCap where needed. External — not TT silicon claims. Parent board remains this PR (#90).

Opened / linked as dependencies of #90

Lane Issue Call
MTP (BORROW) #133 truncated draft lm_head / MTP_DRAFT_VOCAB GO desk/harness
bench/MTP (BORROW) #134 decode telemetry + lossless sample-compare + EOS checkpoint token GO desk/harness
prefill (ADAPT) #135 adaptive chunk/shape policy (not RDNA microkernels) WATCH desk-only
MTP/GDN (ADAPT) #136 GDN snapshot/restore across speculative steps WATCH desk-only
MTP/TP (ADAPT) #137 T-dim / TP sharding of MTP draft path for 2×p150a WATCH desk-only

SKIP (no new GO issues)

  • RDNA micro-opts — AMD-silicon-specific; not portable to TT.
  • ngram-DFlash — absent here / already covered by existing #98 ngram/lookup oracle (do not duplicate).
  • Quant KV (AMD-shaped asymmetric / lower-precision KV) — no new issue: already tracked/implemented as #79 (K bfp8_b / V bfp4_b) under #78. Cross-link only; reopen only if a distinct AMD angle appears that #79 does not cover.

Notes

  • Combined BORROW items 2+3+4 into one harness issue (#134); kept MTP_DRAFT_VOCAB (#133) separate as highest portable win.
  • No code touched; no force-push.
## Grill sub-issues — amd-qwen / tinygrad borrow-adapt lane (2026-09-30, Tenstorrent) Eval framing: portable wins first from jacobrosenthal `amd-qwen-on-master` / related AMD ROCm Qwen3.8 serving; reshape for TT/vllm-tt/ThinkingCap where needed. External — not TT silicon claims. Parent board remains this PR (#90). ### Opened / linked as dependencies of #90 | Lane | Issue | Call | |---|---|---| | MTP (BORROW) | #133 truncated draft lm_head / `MTP_DRAFT_VOCAB` | **GO** desk/harness | | bench/MTP (BORROW) | #134 decode telemetry + lossless sample-compare + EOS checkpoint token | **GO** desk/harness | | prefill (ADAPT) | #135 adaptive chunk/shape policy (not RDNA microkernels) | **WATCH** desk-only | | MTP/GDN (ADAPT) | #136 GDN snapshot/restore across speculative steps | **WATCH** desk-only | | MTP/TP (ADAPT) | #137 T-dim / TP sharding of MTP draft path for 2×p150a | **WATCH** desk-only | ### SKIP (no new GO issues) - **RDNA micro-opts** — AMD-silicon-specific; not portable to TT. - **ngram-DFlash** — absent here / already covered by existing **#98** ngram/lookup oracle (do not duplicate). - **Quant KV (AMD-shaped asymmetric / lower-precision KV)** — **no new issue**: already tracked/implemented as **#79** (K bfp8_b / V bfp4_b) under **#78**. Cross-link only; reopen only if a distinct AMD angle appears that #79 does not cover. ### Notes - Combined BORROW items 2+3+4 into one harness issue (#134); kept `MTP_DRAFT_VOCAB` (#133) separate as highest portable win. - No code touched; no force-push.
Member

Batch-spec board (locked 2026-09-30, D. H. / Tenstorrent)

Programme: batch-spec decode for agent serving — win at B=4 and B=8; B=16 stretch only.

Sequencing (parallel lanes):

  • Deploy: #73 gates (TC-G2 + prefix) + #94/#95 — does not block desk spec
  • Plain decode finishers: so-LOO / K8/V4 (#79) / DRAM prefetcher when unblocked / #93 Tracy on batch shapes
  • Desk accept-stacking before mesh MTP: #134 harness → #98 ngram oracle → #66 DSpark/TC oracle
  • Mesh MTP only after an oracle beats c69d (naive MTP K=3 dead at batch: B=8 wall +8.7…+12.6%, B=4 +3.8…+7.5%)

Spec strategy: prioritize ngram + DSpark accept stacking on the shared verify path (#98, #66), then constrained MTP (#96 short K under row budget B·(K+1)≤32, plus #133 draft vocab). Spine remains #63 per-row verify + GDN commit.

Retitle notes (this comment):

  • #96 → constrained-K @ B=4/8 must-beat-c69d (B=1 matrix secondary)
  • #98 → ngram/lookup accept oracle (primary batch-spec rescue lane; device later)
  • #66 → DSpark/Thatch drafter on ThinkingCap — oracle→device only if beats MTP

PARK: QuietBox/metal DFlash2 product ports until accept+batch wall proven.
Umbrella: stay under #90; keep #63/#66 as separate tickets.

## Batch-spec board (locked 2026-09-30, D. H. / Tenstorrent) **Programme:** batch-spec decode for agent serving — win at **B=4 and B=8**; **B=16 stretch only**. **Sequencing (parallel lanes):** - Deploy: #73 gates (TC-G2 + prefix) + #94/#95 — does not block desk spec - Plain decode finishers: so-LOO / K8/V4 (#79) / DRAM prefetcher when unblocked / #93 Tracy on **batch** shapes - Desk accept-stacking **before** mesh MTP: #134 harness → #98 ngram oracle → #66 DSpark/TC oracle - **Mesh MTP only after an oracle beats c69d** (naive MTP K=3 dead at batch: B=8 wall +8.7…+12.6%, B=4 +3.8…+7.5%) **Spec strategy:** prioritize **ngram + DSpark accept stacking** on the shared verify path (#98, #66), then **constrained MTP** (#96 short K under row budget B·(K+1)≤32, plus #133 draft vocab). Spine remains #63 per-row verify + GDN commit. **Retitle notes (this comment):** - #96 → constrained-K @ B=4/8 must-beat-c69d (B=1 matrix secondary) - #98 → ngram/lookup accept oracle (primary batch-spec rescue lane; device later) - #66 → DSpark/Thatch drafter on ThinkingCap — oracle→device only if beats MTP **PARK:** QuietBox/metal DFlash2 product ports until accept+batch wall proven. **Umbrella:** stay under #90; keep #63/#66 as separate tickets.
Member

Created and linked under #90: #149, #150, #151, #152, #153, #154.

  • #149 — MTP: so1 commit recompute off critical path (overlap / fold into C)
  • #150 — MTP/decode: GDN verify residual traffic / small-ops ablation (c154 ~18.9 ms)
  • #151 — prefill: AGMM LoFi-peak efficiency + named Tracy instrumentation (~61% B8/32k wall)
  • #152 — decode: kda2 + lm_head LoFi LOO attribution (R-2026-10-02-p1)
  • #153 — decode: MR dual-NoC weight stream — one-card gate only (mesh hung c99)
  • #154 — upstream BH kernels: metal #57395 SDPA / #58922–23 DRAM cores_per_bank / #58635 GDN prep / #57445 SFPU WY

Note: mesh-MTP-only-after-c69d is superseded as physics by #140–#144; the owner drafters-over-mtp priority still stands.

Created and linked under #90: #149, #150, #151, #152, #153, #154. - #149 — MTP: so1 commit recompute off critical path (overlap / fold into C) - #150 — MTP/decode: GDN verify residual traffic / small-ops ablation (c154 ~18.9 ms) - #151 — prefill: AGMM LoFi-peak efficiency + named Tracy instrumentation (~61% B8/32k wall) - #152 — decode: kda2 + lm_head LoFi LOO attribution (R-2026-10-02-p1) - #153 — decode: MR dual-NoC weight stream — one-card gate only (mesh hung c99) - #154 — upstream BH kernels: metal #57395 SDPA / #58922–23 DRAM cores_per_bank / #58635 GDN prep / #57445 SFPU WY Note: mesh-MTP-only-after-c69d is superseded as physics by #140–#144; the owner drafters-over-mtp priority still stands.
Member

Do not merge until the PR text is diffed against README BEST. The 16.5 ms G2 weight-read and the 20.7 ms fixed-cost split are not the live bottleneck (c152: verify-bound).

Do not merge until the PR text is diffed against README BEST. The 16.5 ms G2 weight-read and the 20.7 ms fixed-cost split are not the live bottleneck (c152: verify-bound).
Member

Closing: every commit on this branch (head 81712ec1) is already on master f30ab09. The planning board in the comments has been copied to #223 so it is kept. Triage 2026-10-09.

Closing: every commit on this branch (head 81712ec1) is already on master f30ab09. The planning board in the comments has been copied to #223 so it is kept. Triage 2026-10-09.
Member

The 20 open dependency links (#48, #63, #78, #93–#98, #133–#137, #149–#154) moved from this PR to #223 so the board keeps them. Closing as described above.

The 20 open dependency links (#48, #63, #78, #93–#98, #133–#137, #149–#154) moved from this PR to #223 so the board keeps them. Closing as described above.
tenstorrent closed this pull request 2026-10-09 10:54:48 +02:00
Author
Owner

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

agent-gateway closeout (closed): cleared `agent:*` labels. Hermes kanban card (if any) is left for Hermes to archive/complete.
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 18s
tt-stack-ci / Report upstream drift (pull_request) Successful in 9s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

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