Skip to content

Eval bug: Qwen3.6-35B-A3B MoE — slot hangs in TG after multi-turn cache invalidation; no log output after create context checkpoint #22450

Description

@ormandj

Name and Version

$ /app/llama-server --version
version: 8948 (42401c72b)
built with GNU 13.3.0 for Linux x86_64

Also reproduced on build 8902 (commit 15b243e).

Operating systems

Linux

GGML backends

CUDA

Hardware

  • 3x NVIDIA GeForce RTX 3090, compute capability 8.6, 24126 MiB VRAM each
  • AMD EPYC 7663
  • llama-server runs in a container, no NVLink, no P2P
  • GGML_CUDA_NO_PEER_COPY=1, NCCL_P2P_DISABLE=1

Models

  • bartowski/Qwen_Qwen3.6-35B-A3B-GGUF Q8_0
  • mmproj mmproj-Qwen_Qwen3.6-35B-A3B-f16.gguf

Problem description & steps to reproduce

After multi-turn requests where the prior cache is invalidated ("forcing full prompt re-processing due to lack of cache data"), llama_decode does not return tokens. The slot stays is_processing=true, llamacpp:tokens_predicted_total does not increment, no further log lines appear after create context checkpoint until the client cancels the request.

Only Qwen3.6-35B-A3B (MoE + hybrid attention) hangs. Qwen3.6-27B (dense, also hybrid) hits the same "forcing full prompt re-processing" path repeatedly and decodes normally.

The hang triggers reliably during agent workflows that send multi-turn requests with growing context (e.g. aider's --tries 2 retry sending compiler/test errors back). It does not reproduce when the same final prompt is sent as a single user message without any prior conversation in the same slot.

Server flags:

/app/llama-server
  --model /models/Qwen_Qwen3.6-35B-A3B-Q8_0.gguf
  --mmproj /models/mmproj-Qwen_Qwen3.6-35B-A3B-f16.gguf
  --port 5800
  --ctx-size 262144
  --n-gpu-layers 999
  --parallel 1
  --flash-attn on
  --cache-type-k q8_0
  --cache-type-v q8_0
  -sm layer
  -b 2048
  -ub 2048
  --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.0
  --chat-template-kwargs '{"preserve_thinking":true}'
  --cache-prompt
  --cache-ram -1
  --slot-save-path /models/.cache/lc-qwen3.6-35b-a3b-q8
  --jinja
  --reasoning-format deepseek
  --metrics

Reproduction (observed via aider polyglot benchmark, Rust language slice):

  1. Start server with the flags above.
  2. Send a code-writing user message + assistant code reply + user follow-up containing compiler/test errors. (See aider 0.86.3 benchmark/benchmark.py driving the polyglot-benchmark Rust exercises with --edit-format whole --threads 1 --tries 2.)
  3. After ~3-5 successful exercises, a request hangs.

Hang triggers reliably on these polyglot-benchmark/rust exercises against this model: simple-cipher, alphametics, doubly-linked-list (different exercises depending on prior cache state).

First Bad Commit

Not bisected. Reproduced on 8948 and 8902 (the two builds tested).

Relevant log output

Hang case (task 80862, exact log copy):

slot launch_slot_: id  0 | task 80862 | processing task, is_child = 0
slot update_slots: id  0 | task 80862 | new prompt, n_ctx_slot = 262144, n_keep = 0, task.n_tokens = 6190
slot update_slots: id  0 | task 80862 | n_past = 3, slot.prompt.tokens.size() = 5875, seq_id = 0, pos_min = 5874, n_swa = 0
slot update_slots: id  0 | task 80862 | Checking checkpoint with [3009, 3009] against 3...
slot update_slots: id  0 | task 80862 | Checking checkpoint with [965, 965] against 3...
slot update_slots: id  0 | task 80862 | 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)
slot update_slots: id  0 | task 80862 | erased invalidated context checkpoint (pos_min = 965, pos_max = 965, n_tokens = 966, n_swa = 0, pos_next = 0, size = 62.813 MiB)
slot update_slots: id  0 | task 80862 | erased invalidated context checkpoint (pos_min = 3009, pos_max = 3009, n_tokens = 3010, n_swa = 0, pos_next = 0, size = 62.813 MiB)
slot update_slots: id  0 | task 80862 | n_tokens = 0, memory_seq_rm [0, end)
slot update_slots: id  0 | task 80862 | prompt processing progress, n_tokens = 2048, batch.n_tokens = 2048, progress = 0.330856
slot update_slots: id  0 | task 80862 | n_tokens = 2048, memory_seq_rm [2048, end)
slot update_slots: id  0 | task 80862 | prompt processing progress, n_tokens = 4096, batch.n_tokens = 2048, progress = 0.661712
slot update_slots: id  0 | task 80862 | n_tokens = 4096, memory_seq_rm [4096, end)
slot update_slots: id  0 | task 80862 | prompt processing progress, n_tokens = 4142, batch.n_tokens = 46, progress = 0.669144
slot update_slots: id  0 | task 80862 | n_tokens = 4142, memory_seq_rm [4142, end)
slot update_slots: id  0 | task 80862 | prompt processing progress, n_tokens = 6186, batch.n_tokens = 2044, progress = 0.999354
slot create_check: id  0 | task 80862 | created context checkpoint 1 of 32 (pos_min = 4141, pos_max = 4141, n_tokens = 4142, size = 62.813 MiB)
slot update_slots: id  0 | task 80862 | n_tokens = 6186, memory_seq_rm [6186, end)
slot init_sampler: id  0 | task 80862 | init sampler, took 0.79 ms, tokens: text = 6190, total = 6190
slot update_slots: id  0 | task 80862 | prompt processing done, n_tokens = 6190, batch.n_tokens = 4
slot create_check: id  0 | task 80862 | created context checkpoint 2 of 32 (pos_min = 6185, pos_max = 6185, n_tokens = 6186, size = 62.813 MiB)
[~9 minutes of silence; tokens_predicted_total counter does not increment; slot.is_processing remains true]
[client (litellm) cancels with "net/http: timeout awaiting response headers"]
2026/04/28 00:38:52 http: proxy error: net/http: timeout awaiting response headers
srv          stop: cancel task, id_task = 80862
srv  log_server_r: done request: POST /v1/chat/completions 127.0.0.1 200
slot      release: id  0 | task 80862 | stop processing: n_tokens = 113490, truncated = 0

The next log line after created context checkpoint 2 of 32 should be decoding batch, n_tokens = N (debug) followed by the per-token decode pattern. Instead the server is silent. tokens_predicted_total from /metrics confirmed flat at 9544 for the entire interval (sampled every 5 s).

For comparison, the same model + flags decoded successfully on the first request (no prior cache to invalidate, task 7103: 7566 tokens at 120 tok/s) and on the second request after one cache invalidation (task 14684: 1978 tokens at 123 tok/s). The hang appears on a subsequent multi-turn request after additional cache invalidations.

Related issues

Tested workarounds that did not fix the hang on this build:

  • --swa-full
  • --reasoning-budget 8192
  • --chat-template-kwargs '{"preserve_thinking":true}'
  • Bumping request_timeout from 600 to 3600 (just delays the eventual client cancel)

The same prompt body posted directly as a single user message (no prior turns in the slot) does not hang — it generates 16000 reasoning tokens to completion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions