From 5f317a3afc0bb0225f9705f4bb66f716fb60b1d2 Mon Sep 17 00:00:00 2001 From: Breno Perucchi Date: Sun, 4 Oct 2026 20:28:36 -0300 Subject: [PATCH] ckpt=0: its session is neither continued nor parked; docs say what is skipped and when the root is taken --- docs/DETAILS.md | 7 ++++--- serve/server.py | 2 +- src/program/generate.cpp | 9 +++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/DETAILS.md b/docs/DETAILS.md index 22b30ef3..737b0856 100644 --- a/docs/DETAILS.md +++ b/docs/DETAILS.md @@ -636,9 +636,10 @@ prompt when that is 2,048 tokens or more (engine 0.1.20; PR #62 + #65), so that system prompts and tool lists. Engine options: `--prompt-cache N` (0 = off), `--prompt-cache-every N`, `--prompt-cache-root N` (0 = no system-prompt checkpoint), `--turn-token ID`. A one-shot request that no later request continues (a classification call, a probe) can send -`"strata_checkpoint": false` in its body: it then saves no checkpoint at its last turn and reads its prompt in one -part, which skips work nothing would reuse. It still starts from a checkpoint it matches, and the system-prompt root -is still taken. Without the field (or with `true`) nothing changes. +`"strata_checkpoint": false` in its body: it saves no checkpoint at its last turn nor every 16K tokens, so what +follows the reused prefix (or the root) is read in one run, and its session is not kept or parked for a next request. +It still starts from a checkpoint it matches, and still saves the system-prompt root when that reaches +`--prompt-cache-root`. Without the field (or with `true`) nothing changes. **Multiple conversations (opt-in).** Add `--conversation-cache-mib 8192 --conversation-cache-slots 4` to the engine arguments to park up to four conversations diff --git a/serve/server.py b/serve/server.py index 00841fcf..6f4bdf9d 100644 --- a/serve/server.py +++ b/serve/server.py @@ -717,7 +717,7 @@ class StrataEngine: if isinstance(v, (int, float)) and not isinstance(v, bool) and 0.0 <= float(v) <= 1.0: keys += f" {k}={float(v)!r}" # "strata_checkpoint": false - a one-shot call (a classification, a probe) whose turn no later request - # extends: no conversation checkpoint at its end (#830). It still reuses a cached prefix. Absent = today's. + # extends: no conversation checkpoint for it (#830). It still reuses a cached prefix. Absent = as before. if sampling.get("strata_checkpoint") is False: keys += " ckpt=0" return keys + StrataEngine.projection_key(sampling) diff --git a/src/program/generate.cpp b/src/program/generate.cpp index e013cefa..5e452167 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -6316,9 +6316,10 @@ int main(int argc, char** argv) { float req_min_p = 0.0f, req_penalty_repeat = 1.0f, req_penalty_freq = 0.0f, req_penalty_present = 0.0f; int req_penalty_last_n = 0; int req_cvec = 1; // cvec=0|1: a loaded control vector for this request (on when absent) - // ckpt=0: a one-shot call whose turn no later request extends. It reads its prompt in one part and saves - // no checkpoint at the last turn boundary (nor the periodic ones of a long prompt); it still resumes from - // a checkpoint it matches, and still saves the root of a long enough system prompt. Absent = today's. + // ckpt=0: a one-shot call whose turn no later request extends. No checkpoint at its last turn boundary + // (so no split there) nor every --prompt-cache-every tokens, and its session is neither continued nor + // parked after it. It still resumes from a checkpoint it matches, and still saves the system-prompt root + // when that reaches --prompt-cache-root. Absent = checkpointed as before. int req_ckpt = 1; // tuning keys (setup's calibration measures settings without restarting the engine): the PCIe share of // the missed experts and the draft-probability floor, for this request only @@ -7291,7 +7292,7 @@ int main(int argc, char** argv) { // (the checkpoints taken while reading it are still good) live.swap(consumed); live_imgs = imgs_below(req_imgs, (int64_t) live.size()); - live_ok = o.prompt_cache > 0; + live_ok = o.prompt_cache > 0 && req_ckpt; // ckpt=0: nothing to continue or park (#830) } static const bool state_hash = std::getenv("STRATA_STATE_HASH") != nullptr; if (state_hash && live_ok) {