pp/warm: MTP warm-pass K/V-only projection (INERT on PP, tier 1) + warm fc LoFi (NOGO); lever-off records #267

Closed
Grok wants to merge 16 commits from pp/warm into master
Owner

LEDGER R-2026-10-19-wkv. This branch is built on pp/host2 (#264), so its diff includes #264 until that merges. Both levers are off by default.

Attribution (in-boot self-test on both chips, one 2048-row MTP warm pass): the pass takes 3.39 ms, not the ~2 ms estimated. Per op: fc 0.96, QKV AGMM 0.78, q+k RoPE 0.77, enorm 0.65, hnorm 0.63, final norm 0.32, attn norm 0.31 ms.

Levers:

  • QWEN36_MTP_WARM_KVPROJ=1 projects only the k|v columns and skips q, gate, q-norm and q-RoPE. The pass drops 3.39 → 2.87 ms. K/V are bitwise equal to the stock pass in every boot and in ttsim (bench/runs/pp-warm-sim-20261019.jsonl). The _MUSTFAIL arm is refused.
  • QWEN36_MTP_WARM_LOFI=1 runs the warm fc at LoFi. The fc goes 0.96 → 0.94 ms and drafter acceptance drops by 0.004 at B1. NOGO.

Card verdict (ttx ab n=2, S2-hg-fe → wkv; PP tok/s, TG tok/s/user):

cell PP TG/user
B1/4k 7105 → 7080 (−0.35%) 73.00 → 73.03
B1/32k 6640 → 6643 65.31 → 65.25
B4/4k 6544 → 6546 76.52 → 76.73
B4/32k 6552 → 6566 (+0.22%) 62.05 → 61.98
B8/4k 6187 → 6196 (+0.14%) 65.04 → 64.87
B8/32k 6554 → 6548 52.08 → 52.03

Why it's INERT: since hg's DEFER_FINISH, the warm passes are off the B=1 TTFT path. At B>1 they sit behind the next user's replay, so the PP exposure is at most 0.13%.

Records: bench/runs/pp-warm-verdict-20261019.jsonl, bench/runs/pp-warm-analysis-20261019.jsonl.

🤖 Generated with Claude Code

LEDGER `R-2026-10-19-wkv`. This branch is built on pp/host2 (#264), so its diff includes #264 until that merges. Both levers are off by default. **Attribution** (in-boot self-test on both chips, one 2048-row MTP warm pass): the pass takes 3.39 ms, not the ~2 ms estimated. Per op: fc 0.96, QKV AGMM 0.78, q+k RoPE 0.77, enorm 0.65, hnorm 0.63, final norm 0.32, attn norm 0.31 ms. **Levers:** - `QWEN36_MTP_WARM_KVPROJ=1` projects only the k|v columns and skips q, gate, q-norm and q-RoPE. The pass drops 3.39 → 2.87 ms. K/V are bitwise equal to the stock pass in every boot and in ttsim (`bench/runs/pp-warm-sim-20261019.jsonl`). The `_MUSTFAIL` arm is refused. - `QWEN36_MTP_WARM_LOFI=1` runs the warm fc at LoFi. The fc goes 0.96 → 0.94 ms and drafter acceptance drops by 0.004 at B1. NOGO. **Card verdict** (ttx ab n=2, S2-hg-fe → wkv; PP tok/s, TG tok/s/user): | cell | PP | TG/user | |---|---|---| | B1/4k | 7105 → 7080 (−0.35%) | 73.00 → 73.03 | | B1/32k | 6640 → 6643 | 65.31 → 65.25 | | B4/4k | 6544 → 6546 | 76.52 → 76.73 | | B4/32k | 6552 → 6566 (+0.22%) | 62.05 → 61.98 | | B8/4k | 6187 → 6196 (+0.14%) | 65.04 → 64.87 | | B8/32k | 6554 → 6548 | 52.08 → 52.03 | **Why it's INERT:** since hg's DEFER_FINISH, the warm passes are off the B=1 TTFT path. At B>1 they sit behind the next user's replay, so the PP exposure is at most 0.13%. Records: `bench/runs/pp-warm-verdict-20261019.jsonl`, `bench/runs/pp-warm-analysis-20261019.jsonl`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Grok added 16 commits 2026-10-19 22:07:57 +02:00
R-2026-10-19-hg left client->runner at 18 ms (4k) / 83 ms (32k) and runner->client at 6-33 ms,
all outside the model and all inside TTFT, hence inside PP. Nothing in the logs splits it.

vllm_tt_plugin.front_latency wraps (class level, host clocks only) the chat handler, render
(template + tokenize), AsyncLLM.add_request/_add_request, OutputProcessor.process_outputs and the
SSE stream in the API server, and preprocess_add_request / add_request / schedule in the engine
core. Installed from the plugin's general-plugin entry point (entrypoints.py now vendored), which
returns at once with the flag unset. All 8 hook targets checked present in vllm-tt:k2-mr-pk3r
(vLLM 0.26.0) by an import-only container (no devices).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
First S2-hg-ft boot (11:50Z, records added): 37 engine-core lines and no api lines. vLLM runs the
route handler in its own task (with_cancellation) and the StreamingResponse iterates the generator
(where generate() -> add_request() runs) in another, so the ContextVar set in the handler was
invisible at add_request. Stamps now travel by request-object id to the stream wrapper, which sets
the ContextVar in the task that calls add_request; a g0 stamp splits handler return from the
stream start. tests/test_front_latency.py reproduces the two-task structure on fake vLLM classes
(4/4; the first version fails it). No speed number from that boot (diagnostic, attribution only).

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 S2-hg-ft boot (12:11Z) splits B1 TTFT outside the runner (26 / 64 / 120 ms at 4k / 16k / 32k):
render (chat template + tokenize) 11 / 37 / 71 and api_out (first output -> first SSE chunk)
5 / 16 / 34 scale with the prompt; IPC, engine-core add/schedule, the client and the rest are ~10 ms.
Believed before: ZMQ/msgpack of the prompt ids or scheduler overhead. Both are under 2 ms.

- TOKSPLIT: long prompts are cut only after a newline run and before a letter/digit (a Qwen
  pre-token boundary) and encoded with one encode_batch (parallel, GIL released). cfx-llm2
  (Ryzen 3 1200, 4 cores), vLLM's process: 32k-token prompt 62-64 ms -> 20-25 ms.
- DETOK_WINDOW: vLLM primes DecodeStream with every prompt id, so the first step decodes the
  whole prompt (13.8 ms at 32k in the image). Primed with the shortest clean (no U+FFFD)
  8..16-id suffix instead; a prompt ending inside a character keeps the full priming (vLLM
  itself emits prompt text there, found by the self-test).
Both self-test at boot on the served tokenizer (fail closed, wrong-input branch, _MUSTFAIL
refuses). In-image gate (vLLM 0.26.0, transformers 5.12.1, tokenizers 0.22.2):
bench/runs/pp-host2-front-gate-20261019T122922Z.jsonl all_ok (6 rungs). Host tests 11/11 + 4/4.
No card number yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
B1 medians (ms) 4k / 16k / 32k: TTFT 586 / 2435 / 5038, runner 560 / 2371 / 4919, outside
27 / 64 / 120: render 11 / 37 / 71, api_out 5 / 16 / 34; client->handler 1.8-2.5, IPC in
0.3-1.7, engine core add..schedule <1.2, IPC out ~1, to client 0.5-1.7. At B8 the 32k
requests queue behind each other's prefill (to_schedule seconds), as expected; render under
8 concurrent requests is serial in vLLM's one renderer thread (median 317 ms at 32k), hidden
behind the earlier users' prefill. Host clocks of an instrumented boot; 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>
Believed before: the 18/83 ms client->runner gap held IPC/serialization and
engine-core polling. The S2-hg-ft attribution showed those are <=2 ms each;
the prompt-scaled hops are the single-thread render (71 ms at 32k) and the
detokenizer priming on the whole prompt (14 ms). Split tokenization and a
windowed detok prime save 97 ms TTFT at B1/32k and 4 ms at B1/4k on cards.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
serving: bind-mount the front-end plugin files in the Nix unit
All checks were successful
cards-fresh cards: fresh (run 845) fp=40ce3edeec0f2cd2
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 4m3s
tt-stack-ci / Report upstream drift (pull_request) Successful in 1m29s
tt-stack-ci / Plan card run (fingerprint, reuse, cards-fresh) (pull_request) Successful in 2m50s
tt-stack-ci / Serialized card gate (pull_request) Has been skipped
a8f8fffbba
test_prod_matches_nix failed on this branch the same way it did for
prefill_host.py (CI 9511): ttx overlays the whole prod-local-plugin tree, the
unit listed only some files. entrypoints.py imports front_latency (and through
it front_levers) unconditionally, so all three must be present on every boot;
they patch nothing unless a QWEN36_FRONT_* flag is set.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Believed before: each KV-only MTP warm pass is ~2 ms of device time, and moving
it earlier on the host (wtse) was INERT, so the cost is the device work. The
kv_only pass still ran the full fused [q|k|v|gate] AGMM (7168 cols/chip) plus
q-norm and q RoPE, then threw q and gate away: 1024 of 7168 columns are used.

QWEN36_MTP_WARM_KVPROJ=1 projects only the k|v block (a column copy of the
fused weight, one narrow AGMM); the boot self-test requires K and V bitwise
equal to the stock pass on both chips, a v|k-swap wrong-input branch must
differ, and _MUSTFAIL serves the swap (REFUSED). QWEN36_MTP_WARM_LOFI=1 runs
the warm fc at LoFi (tier 2 for the drafter: bounded deviation, watch
acceptance). The self-test also logs one pass's device time, stock vs served,
with a per-op split: the on-card attribution, in the screen's own boots.
Arms -wkv / -wkl on S2-hg-fe; queue chains behind pp-gdn.

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 first launch and pp-gdn's gum-ab3 both waited on the mesh slot behind the
CI card gate for #264 and share the ttx owner claim, so both re-acquired it
when CI released: gum-ab3 booted at 18:21:29Z, our control 6 s later and
failed on 'Sysmem mapped at unexpected NOC address'. No speed number; gum-ab3's
container kept running. pp-glue2-opmark already waits for gum-ab3, so we queue
behind it rather than race it again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The control (S2-hg-fe, which booted fine at 16:21Z and in CI) died in
open_mesh_device: 'Timed out while waiting for active ethernet core 26-25',
right after pp-glue2-opmark's step failed. ttx slot acquire healed the mesh
(120 s settle); pp-gdn-sdpa's ab was already waiting on us, so we go behind it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
pp/warm: verdict R-2026-10-19-wkv: K/V-only warm pass -15% device time but INERT on PP; warm fc LoFi NOGO
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
tt-stack-ci / Plan card run (fingerprint, reuse, cards-fresh) (pull_request) Has been cancelled
tt-stack-ci / Serialized card gate (pull_request) Has been cancelled
cards-fresh cards: PR does not merge cleanly onto base
9270938856
Believed before: the MTP warm pass (~2 ms) still costs PP, as wtspan's -1.7%
at B1/4k did. Measured in-boot: 3.39 ms per 2048-row pass; the K/V-only
projection cuts it to 2.87 ms (bitwise K/V, tier 1). On cards it is PP-flat
(-0.35..+0.22%): since hg the passes are off the B=1 TTFT path and at B>1 sit
behind the next user's replay, so the exposure is <=0.13%. The warm fc at LoFi
saves 0.02 ms and moves drafter acceptance: NOGO.

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

Closed as superseded: both verdicts here are dead-ends the warm-pass design has since overtaken (wtspan/wtse rows, R-2026-10-16-wtse era); the branch conflicts at +146k lines of embedded merges. Reopen only to harvest the INERT/NOGO rows. Verified 2026-11-18.

Closed as superseded: both verdicts here are dead-ends the warm-pass design has since overtaken (wtspan/wtse rows, R-2026-10-16-wtse era); the branch conflicts at +146k lines of embedded merges. Reopen only to harvest the INERT/NOGO rows. Verified 2026-11-18.
orchestra closed this pull request 2026-11-18 13:02:47 +01: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) Has been cancelled
tt-stack-ci / Report upstream drift (pull_request) Has been cancelled
tt-stack-ci / Plan card run (fingerprint, reuse, cards-fresh) (pull_request) Has been cancelled
tt-stack-ci / Serialized card gate (pull_request) Has been cancelled
cards-fresh cards: PR does not merge cleanly onto base

Pull request closed

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!267
No description provided.