Skip to content

server : fix context checkpoint eviction on prompts shorter than checkpoint_min_step - #28302

Merged
ggerganov merged 1 commit into
ggml-org:masterfrom
masterFoad:server-ckpt-eviction-pr
Sep 8, 2026
Merged

ggerganov merged 1 commit into
ggml-org:masterfrom
masterFoad:server-ckpt-eviction-pr

Conversation

@masterFoad

Copy link
Copy Markdown
Contributor

Overview

This fixes create_checkpoint() deleting the checkpoint a later rewind needs whenever the prompt is shorter than checkpoint_min_step.

create_checkpoint() currently runs a spacing eviction before appending the new checkpoint. Walking from the oldest entry, it removes checkpoints from another task whose n_tokens is within checkpoint_min_step (8192 by default) of the previous surviving checkpoint. On prompts shorter than 8192 tokens, effectively every checkpoint falls within that range, so only the oldest one survives.

This removes the recent checkpoint that the prompt-fill loop placed near the end of the prompt at n_tokens - 4 (checkpoint_offsets = {4 + n_ubatch, 4}, #20288). For hybrid/recurrent models, whose recurrent state cannot simply be rolled back, that recent checkpoint is the useful one when a later request rewinds the conversation.

The functional change is about ten lines: apply the spacing rule only once the checkpoint list has reached n_ctx_checkpoints, which already provides a hard capacity bound, and replace an existing checkpoint at the same n_tokens instead of appending a duplicate.

I found this while replaying a coding-agent transcript on Tiel-Coder-35B-A3B-MTP-UD-IQ3_XXS.gguf (HF: peculiar-ragdoll/Tiel-Coder-35B-A3B-GGUF-MTP), a dynamic UD-IQ3_XXS re-quantization of Ornith-1.5-35B-A3B. It is a hybrid GDN MoE: 30 of its 40 trunk layers use Gated DeltaNet recurrent state and only 10 use full attention with a KV cache, so rewinding requires restoring the recurrent state from a checkpoint.

The symptom was that reopening each session caused a few hundred already-cached tokens to be processed again, while the server log repeatedly printed erasing context checkpoint too close.

When it shows. Normal linear chat is unaffected: each turn resumes from the checkpoint created by the previous request before that checkpoint can be evicted. Switching between conversations is also unaffected because the prompt cache saves and restores the slot together with its checkpoints.

The problem appears when a request rewinds within a conversation after it has already advanced: editing or branching an earlier turn, agent harnesses that retry or compact a session, or reopening a session at an earlier point.

Tested on my 14inch MacBook Pro M5 24 GB and my 16inch MacBook Pro M1 Pro 32 GB.

Additional information

Stock Qwen3.5-9B Q4_K_M (Unsloth), upstream/master = 7798007, M5, using 6 turns of ~150 tokens after a 390-token system prompt, then editing turn 4, continuing for two more turns, and finally regenerating the last answer. Generation was greedy with 120-token replies. prompt_n is the number of tokens llama-server actually processed:

step master prompt_n master prompt ms PR prompt_n PR prompt ms
turns 2-6, each 144-154 440-448 144-154 440-451
edit turn 4 after turn 6 702 1459 26 229
turns 5-6 again 145-149 448 145-149 449-451
regenerate last answer 4 69 4 67
total, 9 warm requests 1753 4647 1077 3407

Both sides produced the same greedy output.

Same scenario on the M1 Pro, run as master, PR, then master again as an ordering control:

step master PR master again
turns 2-6, prompt ms per turn 840-1176 831-846 840-851
edit turn 4 after turn 6 704 tok / 3355 ms 26 tok / 264 ms 704 tok / 3323 ms
regenerate last answer 4 tok / 102 ms 4 tok / 101 ms 4 tok / 101 ms
erasing context checkpoint too close lines in server log 23 0 23

The ordering control reproduces the original behavior after the PR run, which makes the edit-turn difference unlikely to be explained by thermal state or cache warming.

Tiel-Coder-35B-A3B-MTP-UD-IQ3_XXS (Ornith-1.5-35B-A3B, hybrid GDN MoE), b10488 tree, M5, using a fixed replay of a 3-session coding-agent transcript, 13 generations, and a ~5.6K-token system prompt, measured as the mean of 3 warm repetitions. Each repetition reopens the sessions at turn 1, which exercises the rewind case.

The three session openers re-processed 260/254/272 tokens before the patch and 40/34/52 after it. Total warm re-processed tokens per repetition dropped from 2436 to 1776, and warm wall time from 18.25 to 17.12 s (−6.2%). In the same plain-chat edit-turn-4 scenario used above, re-processed tokens dropped from 715 to 26.

Memory. Master effectively retains 2 to 4 checkpoints on short prompts because the spacing pass removes the rest. After this change, a slot may retain up to n_ctx_checkpoints checkpoints before the existing capacity rule starts evicting them.

At the default limit of 32, that means up to 32 times the model's checkpoint state size: about 74 MiB per checkpoint on Tiel and 50 MiB on Qwen3.5-9B. The highest observed usage in the agent replay was 8 live checkpoints / 596 MiB after duplicate positions were removed, and the Qwen3.5-9B chat reached 13 live checkpoints.

--ctx-checkpoints already provides an explicit bound. A byte-based budget in addition to the count would be a reasonable follow-up, but I would prefer to keep that separate from this eviction fix unless maintainers want it included here.

An alternative would be to keep applying the spacing rule on every call but choose the most redundant checkpoint, for example the one closest to its neighbours, instead of allowing the oldest checkpoint to dominate the surviving set. I went with the smaller change here, but I am happy to reshape the policy if that is preferred.

Related: #22929 introduced checkpoint_min_step; its discussion includes a report of prompt-cache performance dropping for sub-1000-token requests after the merge. #24055 ("context checkpoints always invalidated on hybrid/recurrent models", open) appears to describe the same underlying mechanism. See also #22384 and #20225 for earlier restore-path fixes.

Test methodology

  • Multi-turn script against llama-server using /v1/chat/completions, temperature 0, top_k 1, and seed 0, recording timings.prompt_n and timings.prompt_ms for every request. Master and PR were built from the same tree and build directory, with CMAKE_BUILD_TYPE=Release confirmed on both.
  • Server config: --ctx-size 16384 --batch-size 512 --ubatch-size 256 --flash-attn on --cache-type-k q8_0 --cache-type-v q8_0 --parallel 1 --jinja, with the defaults for --ctx-checkpoints (32), --checkpoint-min-step (8192), and prompt caching.
  • This is a server-only change, so it does not affect model arithmetic. The agent replay's perplexity canary remained unchanged at 3.3969.

Requirements

  • I have read and agree with the contributing guidelines.
  • AI usage disclosure: YES, AI was used during the implementation and profiling, guided and reviewed by me.

…list is full

The spacing eviction in create_checkpoint() keeps the oldest checkpoint and
erases every later one within checkpoint_min_step of it. For prompts shorter
than checkpoint_min_step this drops the checkpoint at n_tokens - 4 that the
next request resumes from, so hybrid/recurrent models re-prefill from the
previous checkpoint instead. Apply the spacing rule only once the list is at
n_ctx_checkpoints, and replace an existing checkpoint at the same n_tokens
instead of appending a duplicate.
@ggml-gh-bot

ggml-gh-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

Hi @masterFoad, thanks for your contribution!

Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:

  • PR Template not respected: Please respect the template when creating a new pull request. Make sure to fill out all required sections.

  • Multiple open PRs from a new contributor: We limit new contributors (those without a previously merged PR) to 1 open PR at a time. You currently have 3 open PRs.


Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below.

@landrewes33

Copy link
Copy Markdown

Can confirm this fixes a real production symptom independently. Running Qwen3.8-27B (hybrid attention + Mamba2/SSM architecture, GGUF general.architecture = qwen35) via ollama 0.33.3, every single conversation turn was forcing full prompt reprocessing regardless of prompt length — observed on prompts from a few hundred tokens up to ~6,241 tokens, all comfortably under the default 8192-token checkpoint_min_step. Logs showed checkpoints being created and then immediately erased ("erased invalidated context checkpoint") on the very next turn, exactly matching the eviction-logic bug described here. This patch would directly fix that for any hybrid/recurrent model workload with typical (sub-8K-token) conversation lengths — appreciate the fix, hope it gets reviewed soon.

@masterFoad
masterFoad marked this pull request as ready for review September 6, 2026 07:39
@masterFoad
masterFoad requested a review from a team as a code owner September 6, 2026 07:39
@ggerganov ggerganov self-assigned this Sep 6, 2026
@ggerganov ggerganov added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Sep 8, 2026
@ggerganov
ggerganov merged commit 5d806aa into ggml-org:master Sep 8, 2026
22 of 27 checks passed
SteelPh0enix pushed a commit to SteelPh0enix/llama.cpp-qwen4exp that referenced this pull request Sep 8, 2026
…list is full (ggml-org#28302)

The spacing eviction in create_checkpoint() keeps the oldest checkpoint and
erases every later one within checkpoint_min_step of it. For prompts shorter
than checkpoint_min_step this drops the checkpoint at n_tokens - 4 that the
next request resumes from, so hybrid/recurrent models re-prefill from the
previous checkpoint instead. Apply the spacing rule only once the list is at
n_ctx_checkpoints, and replace an existing checkpoint at the same n_tokens
instead of appending a duplicate.

(cherry picked from commit 5d806aa)
x1250 pushed a commit to x1250/llama.cpp that referenced this pull request Sep 9, 2026
…list is full (ggml-org#28302)

The spacing eviction in create_checkpoint() keeps the oldest checkpoint and
erases every later one within checkpoint_min_step of it. For prompts shorter
than checkpoint_min_step this drops the checkpoint at n_tokens - 4 that the
next request resumes from, so hybrid/recurrent models re-prefill from the
previous checkpoint instead. Apply the spacing rule only once the list is at
n_ctx_checkpoints, and replace an existing checkpoint at the same n_tokens
instead of appending a duplicate.
@axodouble

Copy link
Copy Markdown

Hey there, sorry for commenting on a closed pull request, I have been trying to fix a similar issue as to this one by @landrewes33, but still not working, even on commit 434ddbb.

Can confirm this fixes a real production symptom independently. Running Qwen3.8-27B (hybrid attention + Mamba2/SSM architecture, GGUF general.architecture = qwen35) via ollama 0.33.3, every single conversation turn was forcing full prompt reprocessing regardless of prompt length — observed on prompts from a few hundred tokens up to ~6,241 tokens, all comfortably under the default 8192-token checkpoint_min_step. Logs showed checkpoints being created and then immediately erased ("erased invalidated context checkpoint") on the very next turn, exactly matching the eviction-logic bug described here. This patch would directly fix that for any hybrid/recurrent model workload with typical (sub-8K-token) conversation lengths — appreciate the fix, hope it gets reviewed soon.

So I tried b10864, but no dice.

Using the b10864 build, still produces these issues where "forcing full prompt re-processing due to lack of cache data (likely due to SWA or hybrid/recurrent memory," happens.
I have tried this with a different set-up too, Q8 on an AMD R9700 and oddly enough this issue does not occur.

I briefly believed that this would potentially be an issue with the quant I was using, specifically UD-Q5_K_M, but after dropping to Q4_0 the issue still occurs, I believed it could have maybe had to do with the UD quantizations.

I did my best to try and figure out what the issue was with some other AI tools, trying new builds, different flags but these issues still appear, and changes my overall work to be 95% prompt processing, which is far from optimal.
Do any of you have any ideas on what I could try?

Setup specifics:

  • 2x RTX 2000 Ada Generation.
  • Ubuntu 26.04 LXC Container on Proxmox.
  • All CUDA drivers work.
  • Tested: Q4_0, UD-Q5_K_M.

Trying 434ddbbc0 now.

I slot   operator(): id  0 | task 0 | new prompt, n_ctx_slot = 131072, n_keep = 0, task.n_tokens = 114943
I slot   operator(): id  0 | task 0 | cached n_tokens = 0, memory_seq_rm [0, end)
I slot   operator(): id  0 | task 0 | cached n_tokens = 512, memory_seq_rm [512, end)
I slot   operator(): id  0 | task 0 | cached n_tokens = 1024, memory_seq_rm [1024, end)
I slot   operator(): id  0 | task 0 | cached n_tokens = 1536, memory_seq_rm [1536, end)
I slot print_timing: id  0 | task 0 | prompt processing, n_tokens =   2048, progress = 0.02, t =   3.60 s / 569.08 tokens per second
.....
I slot create_check: id  0 | task 0 | created context checkpoint 3 of 64 (pos_min = 114430, pos_max = 114430, n_tokens = 114431, size = 599.241 MiB)
I slot print_timing: id  0 | task 0 | prompt processing, n_tokens = 114921, progress = 1.00, t = 456.25 s / 251.88 tokens per second
I slot   operator(): id  0 | task 0 | cached n_tokens = 114921, memory_seq_rm [114921, end)
I slot create_check: id  0 | task 0 | created context checkpoint 4 of 64 (pos_min = 114920, pos_max = 114920, n_tokens = 114921, size = 601.167 MiB)
I slot print_timing: id  0 | task 0 | prompt processing, n_tokens = 114939, progress = 1.00, t = 458.15 s / 250.87 tokens per second
I slot   operator(): id  0 | task 0 | cached n_tokens = 114939, memory_seq_rm [114939, end)
I slot init_sampler: id  0 | task 0 | init sampler, took 11.18 ms, tokens: text = 114943, total = 114943
I slot create_check: id  0 | task 0 | created context checkpoint 5 of 64 (pos_min = 114938, pos_max = 114938, n_tokens = 114939, size = 601.237 MiB)
I cmn  common_reaso: deactivated (natural end)
I slot print_timing: id  0 | task 0 | n_gen =    101, tg =  12.75 t/s, tg_3s =  12.88 t/s
I slot print_timing: id  0 | task 0 | n_gen =    149, tg =  13.43 t/s, tg_3s =  15.08 t/s
I slot print_timing: id  0 | task 0 | n_gen =    197, tg =  13.80 t/s, tg_3s =  15.08 t/s
....
I slot print_timing: id  0 | task 0 | n_gen =   1699, tg =  14.86 t/s, tg_3s =  14.96 t/s
I srv  server_strea: conv_id= (empty=1)
I srv    operator(): chat format: peg-native
I slot print_timing: id  0 | task 0 | prompt eval time =  458801.34 ms / 114943 tokens (    3.99 ms per token,   250.53 tokens per second)
I slot print_timing: id  0 | task 0 |        eval time =  116890.80 ms /  1736 tokens (   67.37 ms per token,    14.84 tokens per second)
I slot print_timing: id  0 | task 0 |       total time =  575692.14 ms / 116679 tokens
I slot print_timing: id  0 | task 0 |    graphs reused =        567
I slot print_timing: id  0 | task 0 | draft acceptance = 0.99053 ( 1150 accepted /  1161 generated), mean len =  2.97
I slot print_timing: id  0 | task 0 |      acc per pos = (0.991, 0.978)
I spec common_specu: statistics        draft-mtp: #calls(b,g,a) =    1    587    584, #gen drafts =    584, #acc drafts =   579, #gen tokens =   1161, #acc tokens =  1150, #mean acc len = 2.97, #acc rate/pos = (0.991, 0.978), dur(b,g,a) = 0.003, 10700.903, 0.672 ms
I slot      release: id  0 | task 0 | stop processing: n_tokens = 116680, truncated = 0
I srv  update_slots: all slots are idle
I slot get_availabl: id  0 | task -1 |  - checking sim = 0.702 (32484/46265) > 0.100
I slot get_availabl: id  0 | task -1 | selected slot by LCP similarity, f_sim_best = 0.702 (> 0.100 thold), f_keep = 0.278
I srv  get_availabl: updating prompt cache
I srv   prompt_save:  - saving prompt with length 116680, total state size = 4484.890 MiB (draft: 458.452 MiB)
I srv          load:  - looking for better prompt, base f_keep = 0.278, f_sim = 0.702
I srv          load:    - prompt with length  116680, lcp =   32484, f_keep = 0.278, f_sim = 0.702
I srv        update:  - cache state: 1 prompts, 7008.995 MiB (limits: 8192.000 MiB, 131072 tokens, 136373 est)
I srv        update:    - prompt 0x576b33539230:  116680 tokens, checkpoints:  5,  7008.995 MiB
I srv  get_availabl: prompt cache update took 2775.26 ms
I cmn  common_reaso: activated, budget=2147483647 tokens
I slot launch_slot_: id  0 | task -1 | sampler chain: logits -> penalties -> ?dry -> ?top-n-sigma -> top-k -> ?typical -> top-p -> ?min-p -> ?xtc -> ?temp-ext -> dist 
I slot launch_slot_: id  0 | task -1 | sampler params: 
        repeat_last_n = 64, repeat_penalty = 1.000, frequency_penalty = 0.000, presence_penalty = 0.100
        dry_multiplier = 0.000, dry_base = 1.750, dry_allowed_length = 2, dry_penalty_last_n = 64
        top_k = 40, top_p = 0.900, min_p = 0.000, xtc_probability = 0.000, xtc_threshold = 0.100, typical_p = 1.000, top_n_sigma = -1.000, temp = 1.000
        mirostat = 0, mirostat_lr = 0.100, mirostat_ent = 5.000, adaptive_target = -1.000, adaptive_decay = 0.900
I slot launch_slot_: id  0 | task 816 | processing task, is_child = 0
I slot   operator(): id  0 | task 816 | new prompt, n_ctx_slot = 131072, n_keep = 0, task.n_tokens = 46265
I slot   operator(): id  0 | task 816 | checking checkpoint with [114938, 114938] against 32484...
I slot   operator(): id  0 | task 816 | checking checkpoint with [114920, 114920] against 32484...
I slot   operator(): id  0 | task 816 | checking checkpoint with [114430, 114430] against 32484...
I slot   operator(): id  0 | task 816 | checking checkpoint with [64000, 64000] against 32484...
I slot   operator(): id  0 | task 816 | checking checkpoint with [43708, 43708] against 32484...
I slot   operator(): id  0 | task 816 | forcing full prompt re-processing due to lack of cache data (likely due to SWA or hybrid/recurrent memory, see https://github.com/ggml-org/llama.cpp/pull/13194#issuecomment-2868343055)
I slot   operator(): id  0 | task 816 | erased invalidated context checkpoint (pos_min = 43708, pos_max = 43708, n_tokens = 43709, n_swa = 0, pos_next = 0, size = 321.365 MiB)
I slot   operator(): id  0 | task 816 | erased invalidated context checkpoint (pos_min = 64000, pos_max = 64000, n_tokens = 64001, n_swa = 0, pos_next = 0, size = 401.095 MiB)
I slot   operator(): id  0 | task 816 | erased invalidated context checkpoint (pos_min = 114430, pos_max = 114430, n_tokens = 114431, n_swa = 0, pos_next = 0, size = 599.241 MiB)
I slot   operator(): id  0 | task 816 | erased invalidated context checkpoint (pos_min = 114920, pos_max = 114920, n_tokens = 114921, n_swa = 0, pos_next = 0, size = 601.167 MiB)
I slot   operator(): id  0 | task 816 | erased invalidated context checkpoint (pos_min = 114938, pos_max = 114938, n_tokens = 114939, n_swa = 0, pos_next = 0, size = 601.237 MiB)
I slot   operator(): id  0 | task 816 | cached n_tokens = 0, memory_seq_rm [0, end)
I slot   operator(): id  0 | task 816 | cached n_tokens = 512, memory_seq_rm [512, end)
I slot   operator(): id  0 | task 816 | cached n_tokens = 1024, memory_seq_rm [1024, end)
I slot   operator(): id  0 | task 816 | cached n_tokens = 1536, memory_seq_rm [1536, end)
I slot print_timing: id  0 | task 816 | prompt processing, n_tokens =   2048, progress = 0.04, t =   3.77 s / 543.27 tokens per second
I slot   operator(): id  0 | task 816 | cached n_tokens = 2048, memory_seq_rm [2048, end)
I slot print_timing: id  0 | task 816 | prompt processing, n_tokens =   2560, progress = 0.06, t =   4.81 s / 531.95 tokens per second
I slot   operator(): id  0 | task 816 | cached n_tokens = 2560, memory_seq_rm [2560, end)
I slot print_timing: id  0 | task 816 | prompt processing, n_tokens =   3072, progress = 0.07, t =   5.86 s / 524.19 tokens per second
I slot   operator(): id  0 | task 816 | cached n_tokens = 3072, memory_seq_rm [3072, end)
I slot print_timing: id  0 | task 816 | prompt processing, n_tokens =   3584, progress = 0.08, t =   6.91 s / 518.46 tokens per second
.....
I slot   operator(): id  0 | task 816 | cached n_tokens = 45263, memory_seq_rm [45263, end)
I slot print_timing: id  0 | task 816 | prompt processing, n_tokens =  45753, progress = 0.99, t = 126.34 s / 362.15 tokens per second
I slot   operator(): id  0 | task 816 | cached n_tokens = 45753, memory_seq_rm [45753, end)
I slot create_check: id  0 | task 816 | created context checkpoint 2 of 64 (pos_min = 45752, pos_max = 45752, n_tokens = 45753, size = 329.396 MiB)
I slot print_timing: id  0 | task 816 | prompt processing, n_tokens =  46261, progress = 1.00, t = 128.33 s / 360.47 tokens per second
I slot   operator(): id  0 | task 816 | cached n_tokens = 46261, memory_seq_rm [46261, end)
I slot init_sampler: id  0 | task 816 | init sampler, took 4.41 ms, tokens: text = 46265, total = 46265
I slot create_check: id  0 | task 816 | created context checkpoint 3 of 64 (pos_min = 46260, pos_max = 46260, n_tokens = 46261, size = 331.392 MiB)
I slot print_timing: id  0 | task 816 | n_gen =    100, tg =  16.80 t/s, tg_3s =  16.97 t/s
.....
I slot print_timing: id  0 | task 816 | n_gen =    840, tg =  17.14 t/s, tg_3s =  19.55 t/s
I slot print_timing: id  0 | task 816 | prompt eval time =  129449.38 ms / 46265 tokens (    2.80 ms per token,   357.40 tokens per second)
I slot print_timing: id  0 | task 816 |        eval time =   51350.93 ms /   888 tokens (   57.89 ms per token,    17.27 tokens per second)
I slot print_timing: id  0 | task 816 |       total time =  180800.31 ms / 47153 tokens
I slot print_timing: id  0 | task 816 |    graphs reused =        817
I slot print_timing: id  0 | task 816 | draft acceptance = 0.82391 (  510 accepted /   619 generated), mean len =  2.56
I slot print_timing: id  0 | task 816 |      acc per pos = (0.878, 0.682)
I spec common_specu: statistics        draft-mtp: #calls(b,g,a) =    2    966    911, #gen drafts =    911, #acc drafts =   866, #gen tokens =   1780, #acc tokens =  1660, #mean acc len = 2.82, #acc rate/pos = (0.951, 0.872), dur(b,g,a) = 0.004, 16148.030, 0.964 ms
I slot      release: id  0 | task 816 | stop processing: n_tokens = 47154, truncated = 0
I srv  update_slots: all slots are idle
I srv  server_strea: conv_id= (empty=1)
I srv    operator(): chat format: peg-native
I slot get_availabl: id  0 | task -1 |  - checking sim = 0.894 (43667/48866) > 0.100
I slot get_availabl: id  0 | task -1 | selected slot by LCP similarity, f_sim_best = 0.894 (> 0.100 thold), f_keep = 0.926
I cmn  common_reaso: activated, budget=2147483647 tokens
I slot launch_slot_: id  0 | task -1 | sampler chain: logits -> penalties -> ?dry -> ?top-n-sigma -> top-k -> ?typical -> top-p -> ?min-p -> ?xtc -> ?temp-ext -> dist 
I slot launch_slot_: id  0 | task -1 | sampler params: 
        repeat_last_n = 64, repeat_penalty = 1.000, frequency_penalty = 0.000, presence_penalty = 0.100
        dry_multiplier = 0.000, dry_base = 1.750, dry_allowed_length = 2, dry_penalty_last_n = 64
        top_k = 40, top_p = 0.900, min_p = 0.000, xtc_probability = 0.000, xtc_threshold = 0.100, typical_p = 1.000, top_n_sigma = -1.000, temp = 1.000
        mirostat = 0, mirostat_lr = 0.100, mirostat_ent = 5.000, adaptive_target = -1.000, adaptive_decay = 0.900
I slot launch_slot_: id  0 | task 1288 | processing task, is_child = 0
I slot   operator(): id  0 | task 1288 | new prompt, n_ctx_slot = 131072, n_keep = 0, task.n_tokens = 48866
I slot   operator(): id  0 | task 1288 | checking checkpoint with [46260, 46260] against 43667...
I slot   operator(): id  0 | task 1288 | checking checkpoint with [45752, 45752] against 43667...
I slot   operator(): id  0 | task 1288 | checking checkpoint with [43726, 43726] against 43667...
I slot   operator(): id  0 | task 1288 | forcing full prompt re-processing due to lack of cache data (likely due to SWA or hybrid/recurrent memory, see https://github.com/ggml-org/llama.cpp/pull/13194#issuecomment-2868343055)
I slot   operator(): id  0 | task 1288 | erased invalidated context checkpoint (pos_min = 43726, pos_max = 43726, n_tokens = 43727, n_swa = 0, pos_next = 0, size = 321.436 MiB)
I slot   operator(): id  0 | task 1288 | erased invalidated context checkpoint (pos_min = 45752, pos_max = 45752, n_tokens = 45753, n_swa = 0, pos_next = 0, size = 329.396 MiB)
I slot   operator(): id  0 | task 1288 | erased invalidated context checkpoint (pos_min = 46260, pos_max = 46260, n_tokens = 46261, n_swa = 0, pos_next = 0, size = 331.392 MiB)
I slot   operator(): id  0 | task 1288 | cached n_tokens = 0, memory_seq_rm [0, end)
I slot   operator(): id  0 | task 1288 | cached n_tokens = 512, memory_seq_rm [512, end)
I slot   operator(): id  0 | task 1288 | cached n_tokens = 1024, memory_seq_rm [1024, end)
I slot   operator(): id  0 | task 1288 | cached n_tokens = 1536, memory_seq_rm [1536, end)
I slot print_timing: id  0 | task 1288 | prompt processing, n_tokens =   2048, progress = 0.04, t =   3.72 s / 550.31 tokens per second
I slot   operator(): id  0 | task 1288 | cached n_tokens = 2048, memory_seq_rm [2048, end)

I slot print_timing: id  0 | task 1288 | prompt processing, n_tokens =   7168, progress = 0.15, t =  14.38 s / 498.63 tokens per second
I slot   operator(): id  0 | task 1288 | cached n_tokens = 7168, memory_seq_rm [7168, end)
I srv    operator(): operator(): cleaning up before exit...
W srv          stop: cancel task, id_task = 1288
I common_memory_breakdown_print: | memory breakdown [MiB]              | total   free     self   model   context   compute    unaccounted |
I common_memory_breakdown_print: |   - CUDA0 (RTX 2000 Ada Generation) | 15941 = 5322 + (10473 =  6918 +    2409 +    1145) +         145 |
I common_memory_breakdown_print: |   - CUDA1 (RTX 2000 Ada Generation) | 15949 = 3330 + (11237 =  7701 +    2391 +    1145) +        1381 |
I common_memory_breakdown_print: |   - Host                            |                  1215 =   682 +       0 +     533                |

zbrad pushed a commit to zbrad/llama.cpp that referenced this pull request Sep 10, 2026
…list is full (ggml-org#28302)

The spacing eviction in create_checkpoint() keeps the oldest checkpoint and
erases every later one within checkpoint_min_step of it. For prompts shorter
than checkpoint_min_step this drops the checkpoint at n_tokens - 4 that the
next request resumes from, so hybrid/recurrent models re-prefill from the
previous checkpoint instead. Apply the spacing rule only once the list is at
n_ctx_checkpoints, and replace an existing checkpoint at the same n_tokens
instead of appending a duplicate.
roverdrubber added a commit to roverdrubber/llama.cpp that referenced this pull request Oct 15, 2026
The branch is far behind upstream master and the parts that a card other than
this one needs had drifted. This ports the non-backend half of that sync,
content-matched against upstream rather than replayed by hash: the parser and
JSON schema chain (ggml-org#27764, ggml-org#28736, ggml-org#28742, which adds common/parsers/,
common/json-schema.* and tests/test-json-schema.cpp and retires the three
example scripts it replaces), the chat, grammar, jinja and server fixes
(ggml-org#28302, ggml-org#28469, ggml-org#26885, ggml-org#28279, ggml-org#28511, ggml-org#28620, ggml-org#28817, ggml-org#28749), the
qwen4exp RMSNorm and multiply fusion (ggml-org#28896, hand-ported because the norm
tensors here load with a different shape), the GDN q/k l2 norm as
flash-linear-attention defines it (ggml-org#28068), the ggml_prec_set_acc API that
replaces ggml_mul_mat_set_prec and ggml_flash_attn_ext_set_prec at every call
site, and the scheduler fixes for zero-sized expert ids (ggml-org#28739) and split
inputs (ggml-org#28387).

The GPU backend half of the same sync lands in the following two commits; this
one alone does not build the CUDA or HIP backend, because their call sites move
to the new precision API there.

test-chat, test-json-schema, test-json-schema-to-grammar,
test-grammar-integration and test-grammar-parser pass.

Assisted-by: Claude Opus 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants