From: Georgi Gerganov Date: Tue, 17 Mar 2026 13:21:14 +0000 (+0200) Subject: server : fix ctx checkpoint invalidation (#20671) X-Git-Tag: upstream/0.0.8611~218 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=8cc2d81264c6089ae86fc25a9f7e6e75114d3590;p=pkg%2Fggml%2Fsources%2Fllama.cpp server : fix ctx checkpoint invalidation (#20671) --- diff --git a/tools/server/server-context.cpp b/tools/server/server-context.cpp index c47ad876c..05d6da100 100644 --- a/tools/server/server-context.cpp +++ b/tools/server/server-context.cpp @@ -2402,11 +2402,11 @@ private: } { - // erase any checkpoints with pos_min > pos_min_thold + // erase any checkpoints with pos_max > pos_next for (auto it = slot.prompt.checkpoints.begin(); it != slot.prompt.checkpoints.end();) { const auto & cur = *it; - if (cur.pos_min > pos_min_thold) { - SLT_WRN(slot, "erased invalidated context checkpoint (pos_min = %d, pos_max = %d, n_tokens = %" PRId64 ", n_swa = %d, size = %.3f MiB)\n", cur.pos_min, cur.pos_max, cur.n_tokens, n_swa, (float) cur.data.size() / 1024 / 1024); + if (cur.pos_max > pos_next) { + SLT_WRN(slot, "erased invalidated context checkpoint (pos_min = %d, pos_max = %d, n_tokens = %" PRId64 ", n_swa = %d, pos_next = %d, size = %.3f MiB)\n", cur.pos_min, cur.pos_max, cur.n_tokens, n_swa, pos_next, (float) cur.data.size() / 1024 / 1024); it = slot.prompt.checkpoints.erase(it); } else { ++it;