docs(serve): conversation cache real-model run (job 411)

Cache off and on, same requests: the resumed chat B (reused 2297 of 2364) produced
the same 38 greedy tokens as B read from 0; TTFT 1645.6 ms vs 10330.8 ms; a new chat
sharing the system prompt resumed from the root checkpoint (reused 2286, TTFT
983.3 ms). One sample per cell; the cache stays off by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pavlo Ratushnyi
2026-10-16 12:55:09 +02:00
co-authored by Claude Opus 5.5
parent 063e0d8b45
commit e6d3d09a99
+25 -6
View File
@@ -103,8 +103,8 @@ DMA share and adaptive swaps (they need the registered model bank), and every re
## Conversation cache
`--prompt-cache N` (`StackConfig::conversation`; **off by default** until the real-model smoke below has passed
on a GPU, the Original's default is 6), `--prompt-cache-every N` (16384), `--prompt-cache-root N` (2048),
`--prompt-cache N` (`StackConfig::conversation`; **off by default**: the real-model smoke below passed once (job
411); the Original's default is 6, to be adopted after the uncovered cases listed under Open items have a run), `--prompt-cache-every N` (16384), `--prompt-cache-root N` (2048),
`--turn-token ID` (248045, negative = none), `STRATA_CKPT_REREAD=1` (re-read instead of restore, the Original's
check of a checkpoint). Code: `qwen_forward/original_serve_conversation.rs` over the golden-tested policy in
`conversation/manager.rs`.
@@ -176,9 +176,11 @@ first missing producer's name; that is the expected result until they are bound.
* Commit/draft overlap of the Original is traded for exactness (see above).
* `draft_first` (CLI only), scaled RoPE tables (`STRATA_ROPE_TABLE`), multi-stage and vision requests are not
supported.
* Conversation cache: bound (see above) but off by default and not yet run on a GPU; parking and live
continuation after an undrafted last window are not bound. The one-token prompt (no prompt append, so no
streamed-KV resolver) is fixed by `OriginalQsaMappedJournal::ensure_resolver` at assemble (GPU test passes).
* Conversation cache: bound (see above), off by default; one real-model run so far (job 411, below). Parking
and live continuation after an undrafted last window are not bound; cancellation, sampled requests, prompts
past one root/periodic checkpoint and `STRATA_CKPT_REREAD` have no GPU run yet. The one-token prompt (no
prompt append, so no streamed-KV resolver) is fixed by `OriginalQsaMappedJournal::ensure_resolver` at assemble
(model-free GPU test and the real-model smoke pass).
* Host-side rolling costs not measured: 12 small device checkpoints per committed round, one GDN readback per
request when `settle_state` is on.
@@ -188,4 +190,21 @@ Same inputs as the serve smoke; `--exact backend::original_serve_smoke::original
It serves a one-token prompt first, then chat A, then chat B = A + reply + a new user turn (must resume,
`reused > 0`), then B again read from 0 (`forget_conversation`), asserting equal greedy tokens and printing TTFT
on the `CONV` lines, then a new chat sharing the system prompt (root checkpoint). Optional
`LELEKA_CONVERSATION_SYSTEM_REPEAT` (120), `LELEKA_CONVERSATION_MAX_NEW` (48), `STRATA_CKPT_REREAD=1`.
`LELEKA_CONVERSATION_SYSTEM_REPEAT` (120), `LELEKA_CONVERSATION_MAX_NEW` (48), `STRATA_CKPT_REREAD=1`;
`LELEKA_CONVERSATION_CACHE=off` is the control (same requests, nothing reused).
Job 411 (RTX 5090, 2026-10-16, branch `claude/conversation-cache` 562f35d = bring-up e9995d8 + 791a4fa, capacity
1024, budget 24 GiB, greedy, max_new 48, one run each, no warm-up beyond the requests listed):
| request | n | reused | TTFT ms (cache on) | TTFT ms (cache off control) |
| --- | --- | --- | --- | --- |
| one-token prompt (first after open) | 1 | 0 | 684 | 1155 |
| chat A (cold) | 2300 | 0 | 9787 | 9183 |
| chat B = A + reply + new turn | 2364 | 2297 | 1646 | 9547 (reused 0) |
| chat B read from 0 (`forget_conversation`) | 2364 | 0 | 10331 | 9619 |
| new chat, same system prompt (root) | 2301 | 2286 | 983 | 9144 (reused 0) |
Greedy tokens of B resumed == B read from 0 (38 tokens, identical) in the cache-on run; the off run also
repeats B exactly. Chat A's last two of 48 tokens differ between the two runs (both read A cold, reused 0): a
run-to-run difference unrelated to the cache, not investigated. This is one sample per cell, not a
performance qualification.