Repository navigation
Description
Status (updated 2026-09-29 12:24Z)
State: the cache works. The "cache miss" suspicion was a misreading. Warm-turn TTFT here is dominated by prefilling new tokens.
- What job 626's logs actually show: each warm turn restores the previous prompt's tail snapshot and skips it: turn 2 at 23.1k skips 18,496 tokens (16-token anchor gap), and turn 3 at 27.8k skips 23,216. It then replays only the new user turn:
warmturn.pyappendsnwords/4= 2,500 filler words (~4.65k tokens) per turn. "Intermediate hit" is the log's label for that prompt-boundary snapshot. "0 exact-leaf hits" is expected, because the next prompt is always longer than the leaf. - So the 3.7–4.0 s warm TTFT ≈ prefill of ~4.65k new tokens at 23–28k depth (≈1.2k tok/s). That's prefill speed at depth ([job] Qwen3.8-Flash-Next: long-context cold prefill to SGLang parity (stage 1 = #68) #74), not caching.
- Chat template: the HF template is prefix-stable with thinking off. With thinking on, the re-rendered assistant turn drops the reasoning, so the saved leaf diverges from the next prompt at the completion's start. The tail snapshot is still at the prompt boundary, so the restore point doesn't change.
- In flight: reiner
645. It runs the same 10k-word conversation with a 250-word vs 2,500-word follow-up, so restore cost and new-token prefill show up separately; tail split on vs off (ATLAS_NO_TAIL_SPLIT=1); andssm-state-poisoning-gatewith prefix caching on (the done bar's correctness gate). - Next: if the small follow-up is ≤ 3 s at 27k, the done bar is met on a comparable workload, and this closes. The SGLang comparison (27k re-served in 2.5 s) needs the same per-turn delta to be fair.
Kind
Feature for a model we already support
Model
nvidia/Qwen3.8-Flash-Next-NVFP4
What's the job?
Make multi-turn agent TTFT fast with prefix caching: SGLang re-serves 27k tokens in 2.5 s vs 12 s cold. Atlas has the radix tree + SSM snapshot LRU, but on qwen4_exp the warm SSM hit fires once per prefix, and the tail-split trade (ATLAS_NO_TAIL_SPLIT: −21-29 % cold, +46 % on turn 2) is unsettled. Done = a warmturn.py measurement (turns 1-5 at 8k/27k) showing warm TTFT ≤ 3 s at 27k, ssm-state-poisoning-gate green with prefix caching ON.
Impact radius
Shared code, other models could change
What else could it touch?
spark-runtime/src/radix_tree/snapshot*.rs, the QSA/PLE aux-state snapshot path, the scheduler's prefix restore.
Who's waiting or willing to test?
@AzeezIsh (GB10)
Activity
[-][job] Qwen3.8-Flash-Next: long-context cold prefill to SGLang parity (stage 1 = #68)[/-][+][job] Qwen3.8-Flash-Next: fast multi-turn TTFT with prefix caching[/+]AzeezIsh commentedon Sep 26, 2026
First measurement on current code (reiner job 279).
Setup:
53f4a3d3a, which is main66 plus qwen4_exp: release the nvidia pack's MTP expert FP8 sources after requant (~2.5 GB) #78, stream: hold back only a marker-prefix suffix (removes the ~135 ms/delta SSE lag) #67, qwen4_exp: land the 2026-08-31 long-context TTFT campaign (QSA tensor cores, mHC grid fix, MoE CTA striding) #68, Stop the per-request host heap growth (#73): share xgrammar's TokenizerInfo, dedupe the kernel audit #82 and spark-model: reserve lazy FP8->BF16 copies in the KV budget (#71) #83;warmturn.py: 3-turn conversations, 3 reps each; turn 1 is cold, turns 2 and 3 append the reply plus about a quarter of the prompt again.Marconi intermediate hit9 times, 0no SSM snapshot, 0 exact-leaf bypasses, and 15 saves.prefill_b/prefix_lookup.rsdeliberately recomputes by default (ATLAS_MARCONI_EXACT=1re-enables the shortcut). That is a different path from a real multi-turn conversation.Not yet measured: the issue's 27k target. My 13000-word arm overflowed
max_seq_len32768 on turn 3 (36k tokens, HTTP 400), so it produced no data. The rerun needs about 10000 words so that turn 3 lands near 28k.The agentic perf leg (job 281) runs with
ATLAS_SSM_SNAP_STATS=1, so its 1007 turns will also report the hit rate, mean anchor and recompute tokens under real agentic traffic.AzeezIsh commentedon Sep 26, 2026
Warm multi-turn TTFT at ~27k (reiner job 425). Merge-train tree (
53f4a3d3a, now main), perf-leg serve profile (the Flash-Next recipe with prefix caching on). 3 conversations, turn deltas of about 4.6k tokens.Snapshot paths: 6 Marconi intermediate hits, 1 exact-leaf hit, 0 prefix hits without a snapshot, 11 snapshots saved.
docs(status): #86/#96/#99 merged; recipes PR; open findings (#102, #74,
AzeezIsh commentedon Sep 26, 2026
Triage (2026-09-26). At ~27k, warm turns take 3.70 / 3.98 s (job 425) against the ≤ 3 s bar; SGLang does 2.5 s. The warm path works: 6 Marconi hits and 0 misses.
The two cheapest levers are both simple A/Bs:
The done criterion also requires
ssm-state-poisoning-gategreen with prefix caching ON, and that hasn't been posted yet.Suggest timeboxing this to one week. If ≤ 3 s isn't reached, record the curve and close it; 3.3x faster than cold is already a shippable result.
AzeezIsh commentedon Sep 27, 2026
Where the missing second probably is (Qwen3.8-Max consult plus our own numbers).
The engine's exact-leaf path clearly works:
warmturn.pyat ~27k mostly resumes from a Marconi intermediate checkpoint (spacing 4096), recomputing up to ~4k tokens (job 425).That difference points at turn construction, not the cache. The exact leaf is token-keyed. If the harness re-renders the previous assistant turn (whitespace, a stripped reasoning block, EOS/role tokens), the next prompt diverges from the saved leaf inside the reply, and lookup falls back to the last 4096-aligned checkpoint.
Cheapest discriminating check (no GPU A/B needed):
prompt + completiontoken stream and turn N+1's prompt;saved_leaf_len == prompt_len + completion_lenat save time, which rules out a leaf saved before the tail flush / tail-split.Then:
warmturn-ckptjob) are the fallback, not the first move: they cost memory and I/O on every turn to paper over a key mismatch.Timebox as proposed earlier: one week, then record the curve.
AzeezIsh commentedon Sep 29, 2026
Done. The done bar is met on main
b03dc7363(GB10, perf-leg serve profile: reasoning off, MTP K=2, prefix caching on, tail split on by default).Warm TTFT at 27k (reiner
646, 14,500-word conversation, 250-word follow-ups, 3 reps):The bar is ≤ 3 s; SGLang's 27k re-serve takes 2.5 s. Each warm turn restores the previous prompt's tail snapshot, skipping 27,080 tokens on average, and replays about 511. 0 errors.
ssm-state-poisoning-gatewith prefix caching on: Pass (645): 12 replays within bounds, 0 collapsed.The tail split stays on:
645measured it at +0.1 s cold (12.32 vs 12.24 s at 18.5k) against −1.4 s on turn 2 with small follow-ups (0.71 vs 2.08 s) and −1.4 to −3.1 s with large ones.The earlier 3.7–4.0 s warm numbers came from
warmturn.pyappending ~4.65k new tokens per turn. That's prefill speed at depth, which #74 tracks, not a cache miss. The restore already skipped the whole previous prompt (see626'sMarconi intermediate hitlines).strix-windows: serve Flash-Next with prefix caching on (4 Marconi slo…