checkpoint slots: startup and help name the window snapshots too

This commit is contained in:
keptn42 committed 2026-10-12 09:05:31 +00:00
1 parent e35052abfe
commit 9a2747eaef
3 files changed
+8 -6

No files matched your search

+4 -2
View File
@@ -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" },
+3 -3
View File
@@ -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());
}
}
+1 -1
View File
@@ -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 |