P/D delta KV export + n1d handoff + router socket activation (pd-path lane; all live on cfx-llm1) #368
No reviewers
Labels
No labels
cards:go
hermes-approved
human-approved
human-approved
iter
0
iter
1
iter
2
iter
3
prio:high
prio:low
prio:med
priority/high
state
blocked
state
doing
state
done
state
review
state
todo
x280
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitpartner/tt-stack!368
Loading…
Reference in a new issue
No description provided.
Delete branch "opus/pd-delta-export"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lane: the P/D path (docs/PD-PATH-BREAKDOWN.md). Everything here runs on cfx-llm1 production.
Shipped (each A/B'd, gated, with rollback in #334)
Tooling
tools/pd-split/window/ (pdd.sh arms/bench/gates/deploy, window.sh detached driver with STOP_AT and router.env snapshot restore, compare_ab/tg_concurrency/analyze), skill .claude/skills/pd-router-connector-ab, walkthrough docs/walkthroughs/2026-11-08-pd-delta-export.md, records bench/runs/pd-delta-20261108/.
Review
Independent opus-reviewer: LAND. Two medium operational findings fixed in
04eee3cc(window.sh never ends with decode stopped; socket stop semantics documented; pdd.sh arm restores router.env on a failed edit). Low items noted for follow-up (fill status-file cleanup, fills bypass the TT gate, assert on group kinds).Router suite 175 passed / 1 skipped; transport 36 passed; connector test_cpu 11 passed (cfx-llm1).
Based on #373 (merged).
🤖 Generated with Claude Code
Design 8.6 step 4. Before: the plan assumed the router could floor its RTX-held estimate to vLLM's 832-token hybrid block. Live check on the svc-final RTX service: a 4,401-token prompt re-sent with ~870 tokens appended hit 3,328 tokens (4 x 832, one 4096-budget chunk), not 4,160, so mamba-align hits land on chunk ends. An 832 floor would have made TT export from 4096 while the RTX held 3328, and the connector would have refused every such handoff. The router now floors to 3328 (its estimate then equalled the server's hit counter). - router.py: /v1/chat/completions, /v1/completions (SSE passed through byte for byte), /v1/models, /health, /router/stats; HF tokenizer + chat template (ids equal to the RTX /tokenize on 7 cases); per-session prefix tracker (LCP with what was last sent, LRU within the 341k KV pool); uncached >= 5120 -> TT export (stream C's pd_export API: prompt[:-1], max_tokens 1) -> broker poll -> RTX with kv_transfer_params {tt_handoff, n_tokens, prefix_tokens}; every failure falls back to a plain RTX request; one PD_ROUTER JSON log line per request. The TT path is off by default and UNVERIFIED end to end. - replay.py: agent-sessions / agentic-pi / JSONL traces through the same policy and tracker under the 8.4 cost model with FIFO TT, link and RTX-prefill queues (ESTIMATE record). - 22 unit tests with mock backends, plus BrokerProbe against stream B's real broker/receiver/sender on loopback. - PD-BUILD-CONTRACT: the router's calls, and proposals to A (prompt-tokens details), B (TCP status) and C (export outcome in the response). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>An invalid RTXOPT_ATTN_SPLITKV raised inside sitecustomize. site.py swallows that ('Error in sitecustomize'), so the worker booted with no rtxopt patch at all (no overlay, no draft vocab) instead of refusing. The hook is now always registered when the flag is set and attn_splitkv.parse_mode raises in the worker's FlashInfer import. The kernel's tl.dot takes bf16 Q and the loads assume unit-stride rows; the builder now refuses a non-bf16 decode q dtype and forward refuses non-bf16 or strided Q/O instead of failing in a Triton compile during graph capture or reading the wrong elements. Host-side checks rerun (ref, interpreter, AOT, flag-off registry); no GPU number. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>Expected: a8 would add a few % at B8 on the D+E1 combo, and kvf-a/1 (lower val loss) would lift AL. Evidence: a8 on the combo emits garbage ('terasteras...', first GSM8K wave all hit 8192 tokens), so it has no speed number. kvf-a/1 on the combo: AL flat (2.99 vs 3.00), TG B8 4k -2.2%, B4 32k -5.9%, B1 32k -5.8% (2-vs-2 ABBA); the bf16-native head shows the same loss (-3.8/-2.5/-5.8%), so the cost is the bf16 mtp.* overlay (+0.7-1 ms/step) and the training adds no acceptance on this corpus. Gates for kvf-a/1 pass (GSM8K T=1 58/60, retrieval 1.0). Combo vs ctl over 6 vs 5 boots: B8 4k 94.8 vs 81.8, B8 32k 70.9 vs 61.6. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>Needs pd-split/rtxopt/thinkingcap-freq-rank-agentic.{npy,json} (opus/pd-draft-tune, sha256 fdbdda55...). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>- arrival: adaptive.choose("arrival") on every tokenized request before the C5 decision runs; "tt-direct" serves the client's request end to end on TT, else the C5 path unchanged - prefill-done: after a complete export, adaptive.choose("prefill-done"); "tt-resubmit" sends the whole request to TT and drops the export in the broker (new BrokerProbe.drop, the broker's existing "drop" op) - live signals: RTX /metrics running/waiting/KV (parse_vllm_load), TT /metrics (logged cross-check), router counters (rtx in-flight with streamed tokens, tt decoding, tt prefill busy excl. self), UtilMeter, OutEstimator - failure safety: any TT failure before the first client byte falls back to the RTX (with the export for resubmit) - sticky sessions (margin_stay), TT-decoded turns not recorded in the RTX tracker - PD_ROUTER records carry adaptive {stage, route, reason, pred, live, ...}; /router/stats adaptive block - flags --adaptive --tt-decode-cap --adaptive-margin-in/-stay --adaptive-out-default --adaptive-rtx-max-seqs (off; with it off the bodies, logs, stats and banner are unchanged); commented variant in router.env.template - test_adaptive_router.py: 18 tests on mock backends; whole router suite 98 passed, 1 skipped Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>Requests carrying a "developer" message (Codex-style clients) raised "TemplateError: Unexpected message role." in the router (pd-router.jsonl 2026-11-08 09:49Z x3, 11:37Z; 2026-11-07 23:31Z x2) and went to the RTX untokenized. The RTX log shows vLLM's "Converting developer messages to 'system' role" at exactly those seconds: renderers/hf.py converts developer -> system and merges every system message into one first message when the template has no developer role. tokenize_hf._messages now rebuilds the conversation the way vLLM 0.32's parse_chat_messages (content format "openai") + safe_apply_chat_template do, which also fixes silent id mismatches found on the way: - developer -> system + _consolidate_system_messages - client reasoning_content dropped, `reasoning` rendered as reasoning_content - tool text parts joined with "\n" - Claude Code billing-header line stripped from system messages - tool-call arguments: invalid / non-object / empty -> {} (vLLM coerces) - request-level reasoning_effort -> template kwargs (+ enable_thinking) Router ids == RTX POST /tokenize ids on cfx-llm1 for all 8 message shapes (old code: 3 errors, 5 silent mismatches); reasoning_effort kwargs equal vLLM's ChatCompletionRequest.build_chat_params and the rendered ids match. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>verdict: approve (comment-only — WIP draft, no label, stays draft)
tier: T2
rationale: All three named items are additive, env-gated, and off-by-default; the production serving path and router levers do nothing at their defaults, and the nix change only adds a read-only mount. The A/B GPU e2e proof is still pending, so this is an approve of a draft, not a merge.
concerns:
test_e2e_tiny,test_e2e_delta) is deferred to the #334 window. Do not lift WIP / apply thehuman-approvedlabel until the A/B results are on record.--export-prefix deltaflips a live router routing decision (export_prefixdefault"held"); thepd_export.pyKV streaming is env-gated (QWEN36_PD_EXPORT, default off) and self-tests + MUSTFAIL are present — good. Butrtx_overflow_small(default 0 = off) andexport_prefix(default"held") must stay off in every arm that ships, otherwise the merge silently changes live routing for all users.bench/runs/*records that become a permanent standing default for every future run once this merges. Confirm the drafter is aware the non-pd-split tooling (rtx-drafter, traffic-bench) is being committed as the new default, not just scaffolding.pd_export.pyis mounted read-only into every serving unit's container viamodules/tenstorrent-serving.nix; inert unlessQWEN36_PD_EXPORT=1, so safe, but it is now standing behaviour for all serving units on merge.Re-review when the A/B results land; then apply the single-id
human-approvedlabel and lift WIP.Status 2026-11-08 22:00 CET: delta export SHIPPED (router --export-prefix delta, 21:47; connector
d842501bdeployed on cfx-llm1). W1 lost (GDN groups hit deeper than the MTP-dropped attention group -> vLLM fell back to hit 0); W2 found it; W3 on the ehq8 baseline: agentic TTFT p50 -27/-30/-34% (B1/B4/B8), PP 12.0k->16.1k / 5.3k->7.3k / 3.7k->5.5k tok/s, end-to-end -17..-19%, cold cells unchanged; TG/user agentic B8 67.5->51.0 (more concurrent decode, see walkthrough). Gates: retrieval 1.0/1.0, GSM8K T=1 57/60. Records bench/runs/pd-delta-20261108/w3. HISTORY beat: #371.Merge note: this branch sits on opus/pd-arena-freelist (
b4907a4d, deployed in prod but not in master); a test merge with master conflicts in 8 TT/transport files this lane never touched (bench/arms s12phv-pd-export*, nix serve-arm json, kv_host_tier.py, pd_export.py, test_pd_export.py, transport/receiver.py, ring.py). The freelist owner needs to land or rebase that base first; my lane's files (tools/pd-split/router, connector, window, docs, skill) merge cleanly.b4907a4d) for landing on masterWIP: P/D delta KV export, router TemplateError fix, TT-queue overflow (pd-path lane)to P/D delta KV export + n1d handoff + router socket activation (pd-path lane; all live on cfx-llm1)Independent review: LAND (opus-reviewer); mediums fixed in
04eee3cc. CI #11740 green. Merging.agent-gateway closeout (merged): cleared
agent:*labels.Hermes kanban card (if any) is left for Hermes to archive/complete.