Skip to content

DAG-KV v0.7.0: Breaking the 0% Prefix Cache Cliff Across vLLM, SGLang, DeepSeek MLA, 32B Models, and 100GbE RoCE RDMA

DAG-KV v0.7.0 is out now — an Apache-2.0 open-source position-decoupled graph KV cache engine, PyPI package (pip install dag-kv), zero-fork vLLM v1 plugin, and arXiv preprint.

Standard prefix caching (vLLM Automatic Prefix Caching, SGLang RadixAttention) relies on strict left-to-right token matching from sequence index 0. The moment a RAG reranker reorders passages [Doc_B, Doc_A, Doc_C] or an AI coding assistant edits one function near the top of a file, prefix cache hit rates collapse to 0%, forcing full quadratic \(O(N^2)\) prefill recomputation.

DAG-KV replaces prefix trees with a 100% read-only, position-decoupled Directed Acyclic Graph (DAG) of canonical KV blocks using three core ideas:

  1. Query-Side Adjoint RoPE in \(\mathrm{SO}(2)\) (Zero-Copy HBM): Instead of mutating cached keys in HBM (which breaks Copy-on-Write multi-tenant sharing), Triton kernels counter-rotate only the active query in SRAM registers: $\(\big\langle \tilde{q}_{\text{global}}, \mathcal{R}(\Delta_b)\tilde{k}_{\text{canon}} \big\rangle = \big\langle \mathcal{R}(-\Delta_b)\tilde{q}_{\text{global}}, \tilde{k}_{\text{canon}} \big\rangle\)$ Physical KV blocks remain 100% immutable and globally shareable across arbitrary chunk orders and concurrent tenants.
  2. Exact Layer-1 \(Q_1\) LSE + Submodular Pyramid Bridge Repair (4% → 1.5%): Rather than blindly recomputing 15% of tokens like CacheBlend, DAG-KV bounds exact cross-chunk attention output drift via online Log-Sum-Exp (\(\alpha_i = \sigma(\ell_{i\to\text{prior}} - \ell_i^{\text{local}})\)), selects spatially diverse bridge tokens with 1D NMS (4.0% → 1.5%), and writes repairs into request-private Copy-on-Write shadow blocks.
  3. Absorbed DeepSeek MLA + AST-Delta Caching + 100GbE RoCE RDMA: Extends the adjoint identity to DeepSeek-V2/V3 compressed latent KV (8.89× smaller cache, counter-rotating only the 64-dim decoupled RoPE slice \(q_R\)), re-prefills only edited AST functions/classes (92.7% token reuse), and transfers KV blocks GPU-to-GPU over physical 100GbE RoCE NICs at 10.44 GB/s (83.50 Gbps).

Verified v0.7.0 Headline Benchmarks (NVIDIA H200 NVL 141 GB & RTX PRO 6000 Blackwell 96 GB)

1. Live 3-Way H200 Head-to-Head: vLLM 0.34.0 APC vs. SGLang 1.0.0 RadixAttention vs. DAG-KV

Workload (NVIDIA H200 NVL sm_90) vLLM 0.34.0 APC SGLang 1.0.0 RadixAttn DAG-KV (K8V4) Speedup vs. vLLM / SGLang
Qwen2.5-3B 9.2K Permuted RULER 121.89 ms (0%) 103.26 ms (0%) 37.36 ms (100%) 3.26× / 2.76× (3/3 EM)
Qwen2.5-3B 18.5K Permuted RULER 298.16 ms (0%) 263.95 ms (0%) 99.52 ms (100%) 3.00× / 2.65× (3/3 EM)
Qwen2.5-3B 18.5K Same-Order Prefix Hit 32.28 ms 24.57 ms 25.04 ms (Bypass) 1.29× vs vLLM (within 0.47 ms of SGLang)
Qwen2.5-14B 9.2K Permuted RULER 487.09 ms (0%) 437.92 ms (0%) 102.06 ms (100%) 4.77× / 4.29× (3/3 EM)
Qwen2.5-14B 18.5K Permuted RULER 1,168.91 ms (0%) 1,000.38 ms (0%) 292.18 ms (100%) 4.00× / 3.42× (3/3 EM)
Qwen2.5-14B Live IDE Edit (pytorch_fallbacks.py) 157.36 ms 68.27 ms 71.15 ms (92.7% AST) 2.21× vs vLLM

2. Standardized Real LongBench (N = 111, Qwen2.5-14B, K8V4) vs. CacheBlend HKVD 15%

Task (N) Dense Oracle Isolated 0% CacheBlend 15% DAG-KV 4% → 1.5% Speedup vs. Dense / CB-15%
HotpotQA (28, F1) 29.72 (405.0 ms) 35.14 (40.9 ms) 37.86 (145.7 ms) 35.14 (42.5 ms) 9.52× / 3.42×
2WikiMQA (29, F1) 58.65 (370.9 ms) 26.77 (26.4 ms) 30.72 (144.2 ms) 30.22 (43.2 ms) 8.59× / 3.34×
MuSiQue (24, F1) 30.47 (425.8 ms) 38.34 (28.4 ms) 39.74 (156.6 ms) 38.69 (42.3 ms) 10.06× / 3.70×
RepoBench-P (30, Edit-Sim) 55.90 (439.3 ms) 60.52 (212.0 ms) 53.10 (296.5 ms) 58.74 (225.0 ms) 1.95× / 1.32×
Macro Avg (111) 43.69 (410.3 ms) 40.19 (76.9 ms) 40.36 (185.7 ms) 40.70 (88.3 ms) Beats CB-15% @ 2.10× faster / 4.65× Dense

3. 32B Scaling, Real DeepSeek-V2-Lite Absorbed MLA, vLLM v1 Plugin & 100GbE RoCE RDMA

  • Qwen/Qwen2.5-32B-Instruct (64 GB FP16 on 1× H200): Native FP8 hits 10.03× (8.4K: 119.6 ms vs 1,199.6 ms), 8.09× (17.0K), and 7.00× (33.8K: 963.7 ms vs 6,741.3 ms) — 3/3 (100%) EM on every context length — plus 242.0 tok/s (6.50×, lossless) Prompt-Lookup speculative decoding.
  • Real deepseek-ai/DeepSeek-V2-Lite-Chat Absorbed MLA (DeepSeekMLADAGKVEngine): 8.89× native KV compression, Latent-Space Query-Guided CoW MLA Bridge lifts permuted 6-doc RAG from 1/3 (0% isolated) → 3/3 (100%) EM, and scales 8.48× faster at 32.0K (199.8 ms vs 1,695.1 ms).
  • Live 2-Node 100GbE RoCE RDMA (gpunode2 H200 → gpunode1 Blackwell, bnxt_re0): 10.01 GB/s (64 MB, 6.25 ms) → 10.44 GB/s (83.50 Gbps) at 256 MB (91.8% of 91.0 Gbps ib_write_bw ceiling, 107× faster than 1GbE HTTP, bit-exact checksum verified).
  • Live H200 vLLM 0.34.0 v1 Plugin Verification: Zero-fork KVConnectorBase_V1 + vllm.v1.attention.backend.AttentionBackend — 0.0 KV roundtrip max diff, 0.000488 AttentionImpl parity.

Try It in 30 Seconds

pip install dag-kv
dag-kv info
from transformers import AutoModelForCausalLM, AutoTokenizer
from dag_kv import patch_hf_model

model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B-Instruct")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-3B-Instruct")

dag_model = patch_hf_model(model, tokenizer, quantization="k8v4")
doc_a = dag_model.prefill_chunk("Service A: ...")
doc_b = dag_model.prefill_chunk("Service B: ...")

# 100% KV reuse in ANY order!
print(dag_model.generate([doc_b, doc_a], prompt_suffix="How do A and B interact?"))

Community Launch Copy

Show HN / Technical Post

Show HN: DAG-KV v0.7.0 – Order-invariant graph KV caching that beats vLLM, SGLang, and CacheBlend on H200

Standard prefix caching (vLLM APC, SGLang RadixAttention) hits 0% cache reuse whenever RAG passages are reranked or an IDE edits a function near the top of a file.

I built DAG-KV (Apache-2.0, pip install dag-kv) to make cached KV blocks 100% read-only and reusable in any permutation: - Query-Side Adjoint RoPE counter-rotates queries in Triton SRAM registers (\(\mathcal{R}(-\Delta_b)q\)) instead of mutating keys in HBM. - Layer-1 \(Q_1\) LSE + Submodular Pyramid Bridge Repair (4% → 1.5%) repairs cross-chunk attention into CoW shadow blocks. - Real DeepSeek-V2-Lite Absorbed MLA (8.89× smaller KV), zero-fork vLLM v1 plugin, AST-delta code chunking (92.7% reuse), and 100GbE RoCE RDMA (10.44 GB/s).

Live H200 benchmarks: 4.0×–4.77× faster than vLLM 0.34.0, 3.42×–4.29× faster than SGLang 1.0.0 on permuted 14B prompts (and matches SGLang within 0.47 ms on 18.5K prefix hits), beats CacheBlend-15% in macro score on real LongBench (N=111) at 2.10× lower TTFT, and scales Qwen2.5-32B up to 33.8K at 7×–10× speedup (3/3 EM).

Repo: https://github.com/kaushalnandaniya/dag-kv | Paper: paper/dag_kv_arxiv_preprint.pdf

r/LocalLLaMA / X Thread Opener

Prefix caching breaks the second your RAG reranker reorders documents or you edit one function in a 10K-token file — hit rate drops straight to 0%.

Introducing DAG-KV v0.7.0 (Apache 2.0, pip install dag-kv): - 4.77× faster than vLLM 0.34 & 4.29× faster than SGLang 1.0 on H200 Qwen2.5-14B permuted prompts (3/3 EM) - Beats CacheBlend-15% on real LongBench (N=111) at 2.10× lower TTFT - Scales Qwen2.5-32B (7×–10× TTFT, 242 tok/s lossless spec decode) & real DeepSeek-V2-Lite Absorbed MLA (8.89× KV compression, 8.48× at 32K) - 10.44 GB/s (83.5 Gbps) Hopper H200 → Blackwell RTX PRO 6000 KV transfer over live 100GbE RoCE RDMA - Drop-in Hugging Face wrapper, zero-fork vLLM v1 plugin, MCP server, and Turing/Ampere/Hopper/Blackwell + Apple Silicon/CPU support!


GitHub Release v0.7.0 Draft Notes

Highlights

  • Live 3-Way Production Engine Validation (H200 NVL): Beats live vLLM 0.34.0 APC (4.77× / 4.00×) and SGLang 1.0.0 RadixAttention (4.29× / 3.42×) on Qwen2.5-14B permuted prompts while matching SGLang within 0.47 ms on 18.5K prefix hits.
  • Standardized LongBench (N=111) vs. CacheBlend-15%: 40.70 vs 40.36 macro score at 2.10× lower TTFT (88.3 ms vs 185.7 ms) and 4.65× faster than Dense Oracle.
  • Real DeepSeekMLADAGKVEngine (deepseek-ai/DeepSeek-V2-Lite-Chat): Absorbed W_UK/W_UV MLA + Latent-Space Query-Guided CoW Bridge Repair (8.89× KV compression, 3/3 EM, 8.48× @ 32K).
  • Qwen2.5-32B-Instruct Single-H200 Scaling: 10.03× (8.4K) / 7.00× (33.8K, 3/3 EM) in Native FP8 + 242.0 tok/s (6.50×) lossless speculative decoding.
  • Native vLLM v1 (0.8+/0.34.0) Plugin: Full 7-method KVConnectorBase_V1 + vllm.v1.attention.backend.AttentionBackend verified live on H200 (0.0 KV roundtrip diff).
  • 100GbE RoCE Direct RDMA (NCCLRDMAKVStore + BinaryStreamKVStore): 10.44 GB/s (83.50 Gbps, 107× vs HTTP) Hopper H200 → Blackwell RTX PRO 6000 over bnxt_re0.
  • Camera-Ready arXiv Preprint & Tarball: paper/dag_kv_arxiv_preprint.pdf (10 pages) + paper/dag_kv_arxiv.tar.gz + refreshed paper/dag_kv_paper.pdf.