llama.cpp Patch Speeds Up DeepSeek Quantized KV Cache by 15% at 48K Context

pmttyji · reddit · 2026-11-25

llama.cpp PR #32795 reads the quantized indexer K in place when fusedidx is set for DeepSeek-V4.1-Flash, with a full A/B benchmark.

Setup: DeepSeek V4.1 Flash, q80 KV cache, np1, 65k context, cold boots, 4x RTX 4000 Ada, tensor split, identical build flags and prompts on both sides.

| prompt | PP gain | TG gain |

|---|---|---|

| 7k | +2% | +2% |

| 16k | +4% | +4% |

| 28k | +9% | +8% |

| 48k | +15% | +15% |

Gains grow with context length. Testing: test-backend-ops -o LIGHTNINGINDEXER (194 cases, CUDA + CPU) all pass; server A/B against e6d624b9a with identical output sha on greedy probes; PPL and greedy-flip A/B repeated on a second deepseek41 model (382B variant, experts on CPU) with the same conclusion; f16/bf16 caches are a no-op by construction since the guard only fires for quantized types. The author tested only Ada NVIDIA cards and two IQ-quantized models, and asks others to verify on AMD/Intel GPUs and at 128K/256K context.

Original post →

More from Infra

Infra channel →