Archived
sched: skip periodic window snapshots under tip-only
Treat tip-only as a true opt-out from periodic window snapshot creation and interval chunk splits, while retaining the existing tail snapshot and explicit request checkpoints. Leave recurrent-state scheduling unchanged and report the effective chunk bound accurately. Cover geometric-backoff and keep-all interval behavior, tip-only chunk planning and single-snapshot reservation, aligned and short prompts, explicit checkpoints, and recurrent-state scheduling.
This commit is contained in:
1 parent
192fe10278
commit
d6957e88a1
5 files changed
+91
-26
No files matched your search
@@ -153,9 +153,11 @@ int chunk_geometry_resolve(const Program& prog, const Config& cfg, ChunkGeometry
|
||||
|
||||
/* Log the effective chunk length. `plan_chunk` splits at the checkpoint interval first, so
|
||||
* when the interval is below --max-num-batched-tokens, raising the budget does not change the
|
||||
* chunk; the log line makes that visible. */
|
||||
* chunk; the log line makes that visible. tip-only window snapshots do not
|
||||
* split at the interval, so their chunk is bounded by the token budget. */
|
||||
const int64_t span_tok = g.checkpoint_interval * g.span;
|
||||
const int64_t eff = (g.checkpoint_interval > 0 && span_tok < cfg.max_tok)
|
||||
const bool periodic = !g.window_ckpt || cfg.checkpoint_policy != "tip-only";
|
||||
const int64_t eff = (g.checkpoint_interval > 0 && periodic && span_tok < cfg.max_tok)
|
||||
? span_tok : cfg.max_tok;
|
||||
RAD_INFO("chunk geometry: quantum %lld (attn block %lld, state chunk %lld), checkpoint "
|
||||
"interval %lld, max_tok %lld -> prefill chunks of at most %lld%s",
|
||||
|
||||
@@ -53,7 +53,8 @@ struct ChunkGeometry {
|
||||
|
||||
/* No linear state but a sliding window: checkpoints snapshot the window behind an
|
||||
* interval boundary or the prompt's tail (KVManager::has_window_snapshot). Intermediate
|
||||
* snapshots let an edited prompt resume below its divergence instead of from zero. */
|
||||
* snapshots let an edited prompt resume below its divergence instead of from zero.
|
||||
* tip-only skips interval snapshots and keeps the original tail-only chunking. */
|
||||
bool window_ckpt = false;
|
||||
|
||||
bool checkpoints() const { return checkpoint_interval > 0; }
|
||||
|
||||
@@ -751,7 +751,11 @@ int64_t Scheduler::plan_chunk(int64_t n_computed, int64_t n_target, int64_t budg
|
||||
if (geo_.checkpoints()) {
|
||||
const int64_t I = geo_.checkpoint_interval;
|
||||
int64_t next = ((n_computed / I) + 1) * I; /* strictly after n_computed */
|
||||
if (geo_.window_ckpt) {
|
||||
if (geo_.window_ckpt && cfg_.checkpoint_policy == "tip-only") {
|
||||
/* An explicit tail-only policy should not pay for intermediate
|
||||
* window copies or chunk splits just to retire those snapshots. */
|
||||
next = INT64_MAX;
|
||||
} else if (geo_.window_ckpt) {
|
||||
/* A tail-only window snapshot is unreachable after a prompt edit.
|
||||
* Keep interval checkpoints too; the ordinary retention policy bounds
|
||||
* their storage. Preserve the tail before the template's changed suffix,
|
||||
|
||||
Reference in new issue
Block a user