Skip to content

decode() failed: structured KV live groups alias one F16 stage slot with --cache-reuse + --slot-prompt-similarity on concurrent shared-prefix streams #130

Description

@seanyourhighness

Describe the bug

With --cache-reuse 256 --slot-prompt-similarity 0.5 enabled on a multi-slot
unified-KV server, 4 concurrent chat-completion requests that share an identical
system prompt fail decode with:

E srv  update_slots: decode() failed: structured KV live groups alias one F16 stage slot
E srv    send_error: task id = N, error: decode() failed: structured KV live groups alias one F16 stage slot

All 4 tasks are then cancelled (stop: cancel task). Reproduced on two fresh
server restarts with the prose workload. A code-workload batch with identical
flags passed once after a failed batch, so it may be prompt-shape dependent.
Without --cache-reuse/--slot-prompt-similarity the same 4-stream load runs
cleanly (aggregate ~2.2x single-stream throughput).

Environment

  • beellama.cpp v0.4.3 (ba27edad2), native CUDA 13 / sm_120a build
  • RTX 5090 32 GB
  • Qwen3.8-27B IQ4_NL + mmproj-F16 vision
  • -ctk kvarn4 -ctv kvarn4 --kv-tail-tokens 1024 --kv-tail-type f16
  • spec draft-mtp, n-max 3, draft K/V q4_0
  • -c 262144 --parallel 4 --kv-unified --no-cache-idle-slots -b 2048 -ub 1024 -ngl all -fa on

Reproduction

Server flags (relevant subset):

llama-server -m Qwen3.8-27B-IQ4_NL.gguf --mmproj mmproj-F16.gguf \
  -c 262144 --parallel 4 --kv-unified --no-cache-idle-slots \
  -ctk kvarn4 -ctv kvarn4 --kv-tail-tokens 1024 --kv-tail-type f16 \
  --spec-type draft-mtp --spec-draft-n-max 3 \
  --spec-draft-type-k q4_0 --spec-draft-type-v q4_0 \
  -ngl all -fa on -b 2048 -ub 1024 \
  --cache-reuse 256 --slot-prompt-similarity 0.5

Fire 4 simultaneous /v1/chat/completions requests, each with the same
~200-token system message and distinct user messages (no shared user-prompt
prefix beyond the system message).

Expected: 4 concurrent generations complete.
Actual: all 4 fail with the error above; slots release with
n_tokens = ~1300-1450, truncated = 0.

Suspected cause

Interaction between KVarN structured KV live groups and prompt-reuse/similarity
slot selection: when multiple concurrently-processing slots share a common
prefix that gets reused via KV shifting/aliasing, live groups alias a single F16
tail-stage slot. Related context: the fork already carries a fix for unified
KVarN capacity sharing (856598ad1), which suggests this area is sensitive.

Happy to provide the harness script used to reproduce on request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions