Repository navigation
Closed
Labels
Description
Name and Version
build: 8140 (39fb81f) with GNU 15.2.0 for Linux x86_64
Operating systems
Linux
GGML backends
Vulkan
Hardware
RX 7900XTX
Models
Qwen3.5 35B-A3B Q4_K_XL Unsloth GGUF
Problem description & steps to reproduce
I am running llama-server in docker in router mode. When I load Qwen3.5 I see the below logs which show it is not re-using the context. I set the below config so there should be plenty of context for it
; Context Size
ctx-size = 100000
parallel = 4
slot-prompt-similarity = 0.25
First Bad Commit
No response
Relevant log output
Logs
srv proxy_reques: proxying request to model Qwen3.5 on port 53409
[53409] srv params_from_: Chat format: peg-constructed
[53409] slot get_availabl: id 3 | task -1 | selected slot by LCP similarity, sim_best = 0.988 (> 0.250 thold), f_keep = 0.940
[53409] slot launch_slot_: id 3 | task -1 | sampler chain: logits -> penalties -> ?dry -> ?top-n-sigma -> top-k -> ?typical -> top-p -> ?min-p -> ?xtc -> ?temp-ext -> dist
[53409] slot launch_slot_: id 3 | task 2400 | processing task, is_child = 0
[53409] slot update_slots: id 3 | task 2400 | new prompt, n_ctx_slot = 25088, n_keep = 0, task.n_tokens = 7238
[53409] slot update_slots: id 3 | task 2400 | erased invalidated context checkpoint (pos_min = 7536, pos_max = 7536, n_swa = 1, size = 62.813 MiB)
[53409] slot update_slots: id 3 | task 2400 | n_tokens = 7153, memory_seq_rm [7153, end)
[53409] slot update_slots: id 3 | task 2400 | failed to truncate tokens with position >= 7153 - clearing the memory
[53409] slot prompt_clear: id 3 | task 2400 | clearing prompt with 7153 tokens
[53409] slot update_slots: id 3 | task 2400 | prompt processing progress, n_tokens = 2048, batch.n_tokens = 2048, progress = 0.282951
[53409] slot update_slots: id 3 | task 2400 | n_tokens = 2048, memory_seq_rm [2048, end)
[53409] slot update_slots: id 3 | task 2400 | prompt processing progress, n_tokens = 4096, batch.n_tokens = 2048, progress = 0.565902
[53409] slot update_slots: id 3 | task 2400 | n_tokens = 4096, memory_seq_rm [4096, end)
[53409] slot update_slots: id 3 | task 2400 | prompt processing progress, n_tokens = 6144, batch.n_tokens = 2048, progress = 0.848853
[53409] slot update_slots: id 3 | task 2400 | n_tokens = 6144, memory_seq_rm [6144, end)
[53409] slot update_slots: id 3 | task 2400 | prompt processing progress, n_tokens = 6726, batch.n_tokens = 582, progress = 0.929262
[53409] slot update_slots: id 3 | task 2400 | n_tokens = 6726, memory_seq_rm [6726, end)
[53409] slot update_slots: id 3 | task 2400 | prompt processing progress, n_tokens = 7238, batch.n_tokens = 512, progress = 1.000000
[53409] slot update_slots: id 3 | task 2400 | prompt done, n_tokens = 7238, batch.n_tokens = 512
[53409] slot init_sampler: id 3 | task 2400 | init sampler, took 2.27 ms, tokens: text = 7238, total = 7238
[53409] srv log_server_r: done request: POST /v1/chat/completions 127.0.0.1 200
srv log_server_r: done request: POST /v1/chat/completions 192.168.50.105 200
[53409] slot print_timing: id 3 | task 2400 |
[53409] prompt eval time = 3815.79 ms / 7238 tokens ( 0.53 ms per token, 1896.85 tokens per second)
[53409] eval time = 15.81 ms / 2 tokens ( 7.90 ms per token, 126.53 tokens per second)
[53409] total time = 3831.60 ms / 7240 tokens
[53409] slot release: id 3 | task 2400 | stop processing: n_tokens = 7239, truncated = 0
[53409] srv update_slots: all slots are idleReacted by jacekpoplawski, Josh Leverette, Anchit Bajaj, moontato, Bernhard Froemel, imnachar and 大芡猫
Reacted by Dampfinchen
Activity
Dampfinchen commentedon Feb 24, 2026
Can confirm this on my system. RTX 2060, i7 9750H, Windows 11, 32 GB RAM, Same model as OP. It always re-processes the prompt.
slot update_slots: id 3 | task 118 | 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)LLama.cpp server, b8145
jacekpoplawski commentedon Feb 24, 2026
I also see "forcing full prompt..."
(old issue for Qwen Next: #19394)
ggerganov commentedon Feb 24, 2026
Please provide feedback if #19849 works as expected.
Dampfinchen commentedon Feb 24, 2026
Busy right now, but what I can say at the moment is that it doesn't matter if I use it with or without the vision encoder (mmproj) loaded, it always reprocesses the prompt.
ggerganov commentedon Feb 24, 2026
@Dampfinchen Most likely you are using very short prompts (i.e. less than 512 tokens).
NickM-27 commentedon Feb 24, 2026
@ggerganov I built that PR and tested under the same circumstances and this is what I see now, looks like it is working correctly
MuhammedKalkan commentedon Feb 24, 2026
dont know if related but i experience crashes with Qwen3.5 (27B- 35B)
AMD 7900 XTX ROCM build
TillWege commentedon Feb 24, 2026
Atleast for me on AMD 395+ not running the mmproj flag fixes this
coder543 commentedon Feb 24, 2026
Confirmed with A/B test on Qwen3.5-122B-A10B:
Text-only instruct (no mmproj): cache reuse works
req1: prompt_n=4834, cache_n=0, prompt_ms=5384.8
req2: prompt_n=512, cache_n=4322, prompt_ms=622.4
MM instruct (with mmproj): cache reuse fails, full reprocess on req2
req1: prompt_n=4834, cache_n=0, prompt_ms=5375.2
req2: prompt_n=4834, cache_n=0, prompt_ms=5355.5
Relevant MM logs on 2nd request:
selected slot by LCP similarity, sim_best = 1.000 ...need to evaluate at least 1 token for each active slot (n_past = 4834, task.n_tokens() = 4834)n_past was set to 4833n_tokens = 4833, memory_seq_rm [4833, end)failed to truncate tokens with position >= 4833 - clearing the memoryprompt_clear ... clearing prompt with 4833 tokensThis suggests slot selection/LCP is fine, but KV truncation fails in the MM path and forces prompt clear + full re-
eval.
EDIT: This is on an Nvidia DGX Spark using CUDA.
Dampfinchen commentedon Feb 24, 2026
Apologies, you are right. It works at above 512 tokens.
IceWreck commentedon Feb 24, 2026
Yep, can confirm disabling mmproj fixed it. (I guess the PR above will fix it even with vision enabled).
andyceo commentedon Feb 25, 2026
Confirming the 2d89c60 (the #19866 pr) is reprocess prompt on every request. Did not try other PRs yet
intermittentnrg commentedon Mar 4, 2026
llama.cpp is running well with OpenCode. But every time i send prompt from Opencode it does:
Not sure what information I should include. But just that it seems to happen every time I send new prompt seems useful (i.e. it does not happen for tool calls). Using the very recent llama-b8192-bin-ubuntu-vulkan-x64.tar.gz release.
EDIT: Seems
--swa-fullflagsolvedimproved it.EDIT2: Nope not solved.
EDIT3: Switched from OpenCode to pi.dev and still same issue. I have a big penalty to steering the agent as context grows. llama.cpp is otherwise running incredibly well on my RX590 Vulkan GPU.
EDIT4: Removed
--flash-attn onfrom parameters, feels improved but not fixed. Not sure under what conditions full prompt re-processing happens seems somewhat random.KillerX629 commentedon Mar 5, 2026
I'm sorry, I'm using the last commit and I don't see this error fixed. what are the parameters that fix this in llama-server?
EDIT: User error: apparently claude code just alters the context constantly unless you put CLAUDE_CODE_ATTRIBUTION_HEADER=0. If you're having problems with claude code and qwen 3.5, try this env var and see if it works. it does for me now!
iseeboys commentedon Mar 6, 2026
Confirming this affects Qwen3.5-35B-A3B with --mmproj on b8192 (Windows/CUDA, RTX 5090).
We're running llama-server with 2 slots (16K ctx each), --slot-prompt-similarity 0.5, --cache-type-k q8_0
--cache-type-v q8_0. System prompt is ~11K tokens.
Without --mmproj: Cache reuse works perfectly — follow-up messages are 2.4x faster (7.4s cold → 3.0s warm on 10K token
prompts). Confirmed via metrics.
With --mmproj: Cache reuse completely broken — every turn recomputes the full prompt. Prometheus metrics show 19:1
prompt-to-generation token ratio over thousands of requests. This causes context overflow (400 errors) in long
conversations as there's no headroom left in the slot.
We've had to disable mmproj entirely to keep conversations stable. Eagerly awaiting PR #19877 for multi-modal prompt
caching so we can re-enable vision. Happy to test any builds.
intermittentnrg commentedon Mar 6, 2026
It's already merged and included in releases since https://github.com/ggml-org/llama.cpp/releases/tag/b8153
iseeboys commentedon Mar 6, 2026
Thanks for the heads up! We're actually on b8192 so we do have it. Turns out our issue was --cache-ram 0 — we'd added
it months ago to work around a GatedDeltaNet hybrid cache serialisation segfault (Qwen 3.5-35B-A3B). That flag was
silently disabling all cross-request prompt caching, so we were recomputing the full system prompt every turn (19:1
prompt:gen ratio). Removed it today and cache reuse is working perfectly now, mmproj and all. The segfault it was
preventing seems to be resolved in recent builds. Leaving this here in case anyone else hits the same thing with
hybrid recurrent+attention models.
fix: prevent full prompt re-processing for hybrid SSM models