Skip to content

Commit 8cc2d81

Browse files
authored
server : fix ctx checkpoint invalidation (#20671)
1 parent 6276706 commit 8cc2d81

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tools/server/server-context.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,11 +2402,11 @@ struct server_context_impl {
24022402
}
24032403

24042404
{
2405-
// erase any checkpoints with pos_min > pos_min_thold
2405+
// erase any checkpoints with pos_max > pos_next
24062406
for (auto it = slot.prompt.checkpoints.begin(); it != slot.prompt.checkpoints.end();) {
24072407
const auto & cur = *it;
2408-
if (cur.pos_min > pos_min_thold) {
2409-
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);
2408+
if (cur.pos_max > pos_next) {
2409+
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);
24102410
it = slot.prompt.checkpoints.erase(it);
24112411
} else {
24122412
++it;

0 commit comments

Comments
 (0)