From 9a2747eaef1b49dc3b7e88aa851d8b57b7e30bb8 Mon Sep 17 00:00:00 2001 From: keptn42 Date: Mon, 12 Oct 2026 09:05:11 +0000 Subject: [PATCH] checkpoint slots: startup and help name the window snapshots too --- core/config.cpp | 6 ++++-- core/engine_bringup.cpp | 6 +++--- docs/GUIDE.md | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/config.cpp b/core/config.cpp index a619b23f..c4975d3b 100644 --- a/core/config.cpp +++ b/core/config.cpp @@ -84,7 +84,8 @@ static const Flag g_flags[] = { { "--prefix-cache-host-mib", "N", "copy finished conversations' KV to host memory, up to N MiB,\n" " so their VRAM can go to experts and a return restores\n" " instead of re-prefilling. 0 is off. Part of it holds\n" - " linear-state snapshots on a hybrid model; startup says how many" }, + " snapshots on a hybrid or sliding-window model;\n" + " startup says how many" }, { "--prefix-cache-dir", "DIR", "where the disk tier keeps them. Not --weights-disk-tier, which is\n" " about WEIGHTS" }, { "--prefix-cache-disk-mib", "N", "and copy them on to disk under --prefix-cache-dir, up to N MiB,\n" @@ -103,7 +104,8 @@ static const Flag g_flags[] = { * 2 for the whole server rather than 2 x --max-num-seqs. At the default 8 slots and * 8 sequences that is one snapshot a sequence, which is what an append-only chat wants -- * the next turn's hit lands at the end of the last one. */ - { "--checkpoint-slots", "N", "linear-state snapshots retained IN TOTAL (not " + { "--checkpoint-slots", "N", "linear-state or sliding-window snapshots " + "retained IN TOTAL (not " "per sequence), in pinned host memory; compare " "against --max-num-seqs" }, { "--no-prefix-cache", nullptr, "disable prefix caching" }, diff --git a/core/engine_bringup.cpp b/core/engine_bringup.cpp index 49b836f6..0ffb1105 100644 --- a/core/engine_bringup.cpp +++ b/core/engine_bringup.cpp @@ -2839,11 +2839,11 @@ int Engine::configure_kv() { if (slot > 0 && n > 0 && cfg_.prefix_cache) { if (ck_store_.open(slot, slot * n) != RAD_OK) { RAD_WARN("checkpoint slots: no pinned host memory for %lld snapshot(s) of %s; a " - "hybrid session's prefix hits replay their linear layers from zero. " + "hybrid or sliding-window session's prefix hits prefill from the start. " "Lower --checkpoint-slots.", (long long)n, humanb(slot).c_str()); } else { - RAD_INFO("checkpoint slots: %lld linear-state snapshot(s) of %s in pinned host " - "memory (%s), none of it on the card", (long long)n, + RAD_INFO("checkpoint slots: %lld snapshot(s) (linear state or sliding window) of " + "%s in pinned host memory (%s), none of it on the card", (long long)n, humanb(slot).c_str(), humanb(ck_store_.cap_bytes()).c_str()); } } diff --git a/docs/GUIDE.md b/docs/GUIDE.md index 32e25cd5..9d43850d 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -1077,7 +1077,7 @@ one line naming each one the command line moved. | `--placement MODE` | auto | `all_vram`, `layer_offload`, `expert_tiered`, `auto` | | `--deterministic` | off | pin placement to the loader's plan, so the resident set cannot change under the heat engine | | `--checkpoint-interval N` | 2048 | linear-attention state checkpoint interval, in tokens | -| `--checkpoint-slots N` | 8 | linear-state snapshots the server may hold at once, **in total**, not per sequence. They live in pinned host memory, not VRAM: one slot is a snapshot of every rank's shard (113 MB on Flash-Next at `--tp 2`), allocated at startup. A snapshot is copied off the card after the step that produced it and back before the step that resumes from it. With a disk tier a full store detaches its least recently used snapshot to disk instead of losing it | +| `--checkpoint-slots N` | 8 | linear-state (hybrid) or sliding-window snapshots the server may hold at once, **in total**, not per sequence. They live in pinned host memory, not VRAM: one slot is a snapshot of every rank's shard (113 MB on Flash-Next at `--tp 2`; on Gemma 4 31B the 1024-token window of every sliding layer, 406 MiB at `--tp 2`), allocated at startup. A snapshot is copied off the card after the step that produced it and back before the step that resumes from it. With a disk tier a full store detaches its least recently used snapshot to disk instead of losing it | | `--checkpoint-policy NAME` | geometric-backoff | also `tip-only`, `keep-all` | | `--no-prefix-cache` | — | disable prefix caching |