published fresh until

llama.cpp: which KV settings help 32 parallel requests?

Summary As of November 2026, first compare unified and separate KV layouts on the same workload to distinguish layout effects from precision changes. Get a bounded reading of one 32-request slowdown report, the v0.9.0 improvement, and contributor suggestions for precision and checkpointing (checked 2026-11-05).

Not for the whole prompt being processed again each turn, see llama-cpp-qwen-agent-full-prompt-reprocessing-preserve-thinking.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Compare KV layouts on the same workload before changing precision or concurrency; llama.cpp v0.9.0 ships a unified-cache optimization, while one reporter still sees a performance gap (official release, wsj040303's follow-up).

Do first: compare --no-kv-unified with --kv-unified --kv-unified-per-slot 2048; these are wsj040303's comparison flags, also documented in the v0.9.0 server README.

Choose the comparison

  • Layout: keep model and precision unchanged, with 65,536 total tokens and 2,048 per slot; restart between configurations and compare elapsed time/output lengths (wsj040303).
  • Precision: contributor am17an recommends F16. The official flags are --cache-type-k f16 --cache-type-v f16; changing precision is a separate comparison (November 5 advice, server README).
  • Checkpointing and concurrency: am17an suggests -cram 0 -ctxcp 0 and says optimization currently focuses on up to eight parallel sequences, with 16/32 on the roadmap. These are diagnostic suggestions, not universal defaults; the README defines -cram as RAM cache size and -ctxcp as checkpoints per slot (advice, README).

Findings and release status

wsj040303's November 5 report in ggml-org/llama.cpp #31711 says “finished requests leave holes”. Scope: Ubuntu 26.04 x86_64, RTX 5070 12 GB, CUDA 13.4, Qwen3-0.6B BF16 weights; initial measurements use 0.7.0-dev at October 24 commit 6b9ba4f2e8c1436511956f0b3c309e2c9e642071. The author attributes fragmented decode batches and poor CUDA Graph reuse to gaps in active slot IDs, reduced with unified KV.

The ggml-org/llama.cpp maintainers' November 4 v0.9.0 note includes #29510 and flash_attn_ext_rows: “more efficient unified KV for multi-seq”. That optimization is released. The non-unified fragmentation issue remains open (#31711); this is not evidence of a released repair to that path.

In a November 5 follow-up, wsj040303 reports v0.9.0 unified KV with BF16 KV taking 193.909 seconds with kv_rows disabled and 165.632 seconds enabled, over 256 requests in eight batches of 32. This is the same reporter, not independent replication.

am17an's reply suggests BF16 may fall back to CPU on CUDA, qualified with “AFAIK”; treat that mechanism as uncertain contributor advice, not an established explanation for this trace.

Limits

One reporter, one small model/GPU and one full run per initial configuration; no confidence bounds (report). Larger models, other backends and continuously refilled queues are outside this evidence; these timings do not rank engines generally. Precision changes alter numerical format.

Not for: Qwen reprocessing the full prompt each turn; see llama-cpp-qwen-agent-full-prompt-reprocessing-preserve-thinking.

Started from a post by @llama.cpp maintainers, packaged by the editor. Original post

Subjects

More in local models

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# llama.cpp: which KV settings help 32 parallel requests?
Summary: As of November 2026, first compare unified and separate KV layouts on the same workload to distinguish layout effects from precision changes. Get a bounded reading of one 32-request slowdown report, the v0.9.0 improvement, and contributor suggestions for precision and checkpointing (checked 2026-11-05).
Copy for agent
get the whatworks thread llama-cpp-parallel-32-kv-fragmentation-unified-cache-choice and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread llama-cpp-parallel-32-kv-fragmentation-unified-cache-choice
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp