perf loop c79-c88: c78 + c86 bundles in LEDGER (B=8 -34%/-29% vs prod-g2), harness seed/lint/verdict fixes, dead levers mapped #118

Merged
Grok merged 32 commits from serving-throughput into master 2026-09-28 05:21:52 +02:00
Owner

This PR brings perf-loop cycles 79–88 to master: two proven bundles in the LEDGER, the arms, harness and skills behind them, and the dead levers mapped. Nothing here changes production. Every lever is behind a flag and defaults off, and redeploying is the owner's call.

Proven (LEDGER)

  • R-2026-09-27-c78-T2SA1: T2 + SA1. B=8 makespan −29.6% (4k) and −24.5% (32k) vs prod-g2.
  • R-2026-09-28-c86: c78 plus six levers:
    • K3 norm-gate and K5 attn prep;

    • MR SiLU unfused;

    • bf4 MR lm_head;

    • GDN a/b pad;

    • kda conv.

    • Confirmed in 2 rounds within 0.2%.

    • Results:

      B ctx makespan s Δ vs c78 TG ms/token PP tok/s
      8 4k 44.46 −6.3% 32.53 3,359
      8 32k 102.00 −6.2% 42.62 4,495
      1 4k 30.43 −6.7% 28.86 4,497
    • Cumulative vs prod-g2: −34.2% at 4k and −29.2% at 32k.

    • Gates on the exact combination:

      • equiv near-tie;
      • retrieval 1.0 on early and late halves at 16k and 32k;
      • GSM8K N=300: 291 vs 295 for the bit-exact c70 (−1.3 pp, McNemar p=0.125).
    • LOO: every new member carries weight. Removing one costs +0.5% to +4.0% makespan.

Inert / dead, with records (docs/LEVERS.md)

  • Prefill AGMM config knobs:
    • persistent buffer, l1acc, dest16;
    • buffers per channel;
    • M/N blocks.
  • The kda channel chunk.
  • The GDN decode recurrence fuse.
  • FS8, FAST_MUL and MLPSH (earlier cycles).

Harness

  • ttx run --seed: falls back to symlinks when protected_hardlinks refuses hardlinks. It seeds whenever the cache has no tensorbin, and du -L counts what is present. Tested.
  • Lint: warns on weight-affecting env set on an adopted cache.
  • wb kernels-reload: now flagged as not reaching the device. Kernel probes restart the workbench per variant, with a must-fail rung.
  • New per-call knobs: QWEN36_AGMM_CKC, QWEN36_AGMM_BUFS and QWEN36_GDN_CONV_KDA_CHUNK, all default-off and registered with the workbench.
  • tools/ttx/sweep-verdict.py: writes the control-band verdict, with --base for LOO.
  • Skill: tt-perf-lever-discovery gains a same-shape op comparison and the traps found in these cycles.

Checks: check-cited-records.py OK; tools/ttx/tests 221 passed.

🤖 Generated with Claude Code

This PR brings perf-loop cycles 79–88 to master: two proven bundles in the LEDGER, the arms, harness and skills behind them, and the dead levers mapped. Nothing here changes production. Every lever is behind a flag and defaults off, and redeploying is the owner's call. ## Proven (LEDGER) - **`R-2026-09-27-c78-T2SA1`:** T2 + SA1. B=8 makespan −29.6% (4k) and −24.5% (32k) vs `prod-g2`. - **`R-2026-09-28-c86`:** c78 plus six levers: - K3 norm-gate and K5 attn prep; - MR SiLU unfused; - bf4 MR lm_head; - GDN a/b pad; - kda conv. - Confirmed in 2 rounds within 0.2%. - Results: | B | ctx | makespan s | Δ vs c78 | TG ms/token | PP tok/s | |---|---|---|---|---|---| | 8 | 4k | 44.46 | −6.3% | 32.53 | 3,359 | | 8 | 32k | 102.00 | −6.2% | 42.62 | 4,495 | | 1 | 4k | 30.43 | −6.7% | 28.86 | 4,497 | - **Cumulative vs `prod-g2`:** −34.2% at 4k and −29.2% at 32k. - **Gates on the exact combination:** - equiv near-tie; - retrieval 1.0 on early and late halves at 16k and 32k; - GSM8K N=300: 291 vs 295 for the bit-exact c70 (−1.3 pp, McNemar p=0.125). - **LOO:** every new member carries weight. Removing one costs +0.5% to +4.0% makespan. ## Inert / dead, with records (docs/LEVERS.md) - Prefill AGMM config knobs: - persistent buffer, l1acc, dest16; - buffers per channel; - M/N blocks. - The kda channel chunk. - The GDN decode recurrence fuse. - FS8, FAST_MUL and MLPSH (earlier cycles). ## Harness - **`ttx run --seed`:** falls back to symlinks when `protected_hardlinks` refuses hardlinks. It seeds whenever the cache has no tensorbin, and `du -L` counts what is present. Tested. - **Lint:** warns on weight-affecting env set on an adopted cache. - **`wb kernels-reload`:** now flagged as not reaching the device. Kernel probes restart the workbench per variant, with a must-fail rung. - **New per-call knobs:** `QWEN36_AGMM_CKC`, `QWEN36_AGMM_BUFS` and `QWEN36_GDN_CONV_KDA_CHUNK`, all default-off and registered with the workbench. - **`tools/ttx/sweep-verdict.py`:** writes the control-band verdict, with `--base` for LOO. - **Skill:** `tt-perf-lever-discovery` gains a same-shape op comparison and the traps found in these cycles. Checks: `check-cited-records.py` OK; `tools/ttx/tests` 221 passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Grok added 32 commits 2026-09-28 05:21:47 +02:00
Believed: FS8's upstream 536 TF recipe would help our row-parallel prefill GEMMs. The workbench on/off check at a 2k
chunk says the opposite at bf16 activations, which matches the c78 gemm_claim finding (the claim held only with bf4
in/out). Lint now warns only for dead flags an arm sets itself; inherited inert production flags are info.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Believed: the 3.3 us SFPU muls would drop to the 0.9 us an FPU add costs. Measured: 2.6 us on the FPU, because
an M=32 eltwise over 272 interleaved L1 tiles is data-bound. That points at the sharded chain (mul on 34-core
shards, two copies fewer per layer) instead. The probe rsync drops -t too: the shared dir refuses dir mtimes (rc=23).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Believed (runbook 107): the GDN norm+gate kernel had to be written. It already ships in every pk image (grafted
with conv_gates and attn_prep), unwired because K3 waited on K2 packed qkv, which production now runs. It replaces
tilize + rms_norm + reshape_tiled + silu + multiply (~19 us/layer on T2). fp32 inside, so it is tier 2.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
T2 profile: 33 programs / 92 us per attention layer sit between the QKV matmul and SDPA (1.3 ms/step over 16
layers). The external project's op replaces the slices, head split, QK norms, partial rope and KV pad/reshard
with one program. It shipped in our images unwired. Our fused weight is already [q|k|v|gate], the op's layout.

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: the run-bd 2s arm (two RISCs on NOC0) would separate NoC from issue parallelism. It hangs the card in
dedicated NoC mode (smoke step 150, 25 min timeout). The 09-27 record already answers the question: one NoC
plateaus at ~310-347 GB/s from 32 to 110 cores, while two NoCs reach 420-454 at 32-64 cores.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Believed: K3 would save most of its 19 us/layer chain (~-0.7 ms). The fused op itself costs ~12 us/layer, so the
net is -0.21 ms. Believed: keeping MR gate/up sharded removes two copies per layer. It does, but the
sharded->sharded reshard into w2 costs more, net -0.02 ms.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
T2 decode: b = qkvzab[..., az+24 : az+48] starts mid-tile, so its slice untilizes (~7 us/layer x 48). With 8 zero
columns between a and b, b starts at column 8224 (tile 257). The flag is a weight env in ttx's wsig.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
c79 r1 lost 8 min of card time: its arm set QWEN36_LMHEAD_DTYPE=bf4 on the adopted prod cache, which never builds, so the boot refused on the one new tensor. The lint now flags that at queue time (negative-tested on c79 with mode flipped back to adopt). Failure record added.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The sharded MR MLP chain was expected to be data-movement-only and bit-equal; ttsim cannot run it, so that stays unshown. MLPSH is marginal (-0.02 ms wb) and in no arm, so no hardware equiv is spent on it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Round 1 alone could not rule out noise on a ~1% TG delta; r2, interleaved after c79, reproduces it (TG -1.1..-1.4% vs a 0.02% band), so the SA1 decode layout gain holds on top of MR.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The first try died on the cos/sin shape and on Q in L1; with those fixed, the grafted op replaces ~33 programs per attention layer, and K3+K5 are -0.83 ms at B=1 against off in the same session. That is 4x what K3 bought, so c82 goes ahead unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Every B=8 workbench profile since c77 (5 sessions) shows the MR w1 matmul at 76.6 us against 61.4 us for w3, with the same bytes and progcfg; the packer-fused SiLU is the only difference, ~1 ms/step over 64 layers. Upstream's llama32 mlp_1d runs SiLU as the mul's input_a activation instead. A workbench on/off screen is queued right after the c82 screen.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The T=1 recurrence is 4.0 ms/step at B=8 and moves only ~152 GB/s of state; the kernel is ~140 single-tile fp32 pack passes per (b,h) instance, so it is compute-bound. The edit folds the rank-1 outer product into the state add (matmul accumulating onto the copied decayed state, the bmm reload pattern) and packs the new state to the fp32 and io CBs at once, dropping ~32 passes. The runner refuses if the image kernel differs from the stock copy.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The K3/K5 grafted ops were in the image but unwired; served, they cut TG 0.64 ms at B=8 4k, about half the workbench delta, and a quarter of it at B=1, so workbench deltas rank levers but do not size them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The profile confirms the mechanism: w1 drops from 76.5 to 61.6 us, the mul grows from 3.8 to 7.3 us. Rather than screening AB_PAD and the bf4 head+kda pair one arm at a time (two boots), c86 stacks all four on c82 and is measured as a whole first; LOO follows a win.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
--seed from the prod cache was believed to hardlink it. On cfx-llm2 fs.protected_hardlinks=1 and the prod tensorbins are root-owned 644, so every ln failed and the seed silently linked 0 of 980; c86 r1 was then refused a 22.5 GB cold build on a 23 GB disk. The seed now falls back to absolute symlinks (same mount path in the container), the disk guard counts them as present, and a refused boot's empty tree no longer blocks the next seed.

The c85 fused recurrence kernel measured identical to stock, but without a must-fail rung that does not show the edit ran; c85b adds one (4 redundant 16-tile passes that must slow the step).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
kda is read once at init, so the T2 workbench cannot show the prefill after it; a workbench arm inheriting c86 resolves to the same wsig and cache path, so it costs no second build.

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>
One boot measured all four levers against a 3-rep c78 band: TG -5.2..-6.7%, TTFT -5..-7%. Gates on the exact combination, round 2 and leave-one-out are queued before anything goes to LEDGER.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The must-fail rung (+45% compute passes in the GDN recurrence) left the step unchanged. llrt::get_risc_binary caches loaded ELFs by path for the process lifetime and the JIT hash dir does not depend on the kernel source, so the rebuilt ELF on disk (the evidence c72 relied on) is never loaded. Kernel-edit probes now restart the workbench per variant; kernels_reload records effective=false with a caveat; the GDN fuse test re-runs that way (c85c).

Also from this session: post-kda prefill at 30k is device-bound (idle is a fixed ~235 ms per request); per chunk, AG+matmul 123 ms, row-par matmul 49, RS 40, SDPA 36, GDN scan 36, kda conv 25.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Post-kda, the fused conv is 0.52 ms per GDN layer per chunk (25 ms of a 382 ms chunk at 30k), 3.5x the old depthwise conv alone; its only tiling knob had never been swept.

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>
c86 enters LEDGER as a bundle: 2 rounds, equiv/retrieval/GSM8K N=300 pass (-1.3pp vs bit-exact, p=0.125), LOO shows all four new members carry weight; AGMM knobs, kda chunk and GDN fuse are inert
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 1m36s
tt-stack-ci / Report upstream drift (pull_request) Successful in 7s
tt-stack-ci / Report upstream drift (push) Successful in 7s
tt-stack-ci / Build simulators and check the host module (push) Failing after 1m5s
89e814df93
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Grok merged commit 89e814df93 into master 2026-09-28 05:21:52 +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.
Owner

verdict: approve
tier: T1

rationale: PR touches only bench config (1 new arm TOML + 2 queue lines), no production code. New env vars (QWEN36_LMHEAD_DTYPE, QWEN36_DECODE_MR_LMHEAD, QWEN36_MR_SILU_UNFUSED) are all default-off (= "0"/bf8) and gated behind flags; every lever defaults off per the PR's own claim. The referenced c86 LOO record exists in-repo and corroborates the numbers.

concerns:

  • [warn] scope underreport: PR title/desc promise "cycles 79–88... harness and skills behind them" but the actual diff is just the c89 2x2 corner arm + 2 queue lines. The harness/skills/LEVERS.md changes referenced are not in this diff (likely landed in sibling cycles). Verdict covers what's actually here — review the other files if that scope was intended for this PR.
  • [warn] the new arm claims a keyed cache seeded from /var/lib/models/tt-cache/bfpq-PK — a host-local symlink path baked into a repo file. Fine for local bench, but anyone cloning loses the seed; worth a note in the arm or a check that the path is gitignored/expected.

All clean on the secret/vuln catalogue: no hardcoded creds, no shell interpolation of controlled input, no config/nix changes.

**verdict:** approve **tier:** T1 **rationale:** PR touches only bench config (1 new arm TOML + 2 queue lines), no production code. New env vars (QWEN36_LMHEAD_DTYPE, QWEN36_DECODE_MR_LMHEAD, QWEN36_MR_SILU_UNFUSED) are all default-off (`= "0"`/`bf8`) and gated behind flags; every lever defaults off per the PR's own claim. The referenced c86 LOO record exists in-repo and corroborates the numbers. **concerns:** - [warn] scope underreport: PR title/desc promise "cycles 79–88... harness and skills behind them" but the actual diff is just the c89 2x2 corner arm + 2 queue lines. The harness/skills/LEVERS.md changes referenced are not in this diff (likely landed in sibling cycles). Verdict covers what's actually here — review the other files if that scope was intended for this PR. - [warn] the new arm claims a keyed cache seeded from `/var/lib/models/tt-cache/bfpq-PK` — a host-local symlink path baked into a repo file. Fine for local bench, but anyone cloning loses the seed; worth a note in the arm or a check that the path is gitignored/expected. All clean on the secret/vuln catalogue: no hardcoded creds, no shell interpolation of controlled input, no config/nix changes.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!118
No description provided.