Why Decode Dominates (82–93%) While Unbounded Prefix Caches Trigger a 99.75% LRU Cliff
Synthesizing H200/RTX3070 KV offload, KCC 43K-req trace capacity curves, MARA closed-API negative probes, B200 GraphKV co-scheduling (1,200 reqs + 320 E0 trials), AgenticOS lab-s11..25 decode attribution, and LLMServingSim DP2 locality loss.
Headline result: H200 14.8× TTFT → 0.2% @ 99.75% LRU cliff · Decode 82–93% of wall · GraphKV B0/B1/B2 p=0.625 (Holm fail)
On this page (7 sections)
- 1. Motivation: The KV-Cache vs End-to-End Agent Reality Gap
- 2. Hypothesis, Falsification & Experimental Mechanism
- 3. Multi-Testbed Environment Summary
- 4. Visual Evidence & Quantitative Synthesis
- 5. Mechanism Breakdown: Why Caching Wins Pre-Fill Yet Fails to Rescue Tail E2E
- 6. Key Findings & Transferable Insights
- 7. Scope Limits & Blocked Hardware Work (yw-pow.3)
Pre-registered Hypothesis, Falsification Criteria & Environment Manifest
- Hypothesis
- Across multi-turn graph-agent serving pipelines, prefix KV caching and Rust graph-KV co-scheduling substantially reduce end-to-end tail latency across offered request rates.
- Falsification Criteria
- If prefix hit rates collapse near capacity cliffs or fail to appear in hosted APIs, co-scheduling policies fail Holm significance gates because DB lookups are sub-millisecond compared to LLM validator/decode latency, or constrained decoding halves token throughput, client/scheduler complexity alone cannot cure serving tail latency.
- Host / Compute
- NVIDIA H200 / Shared B200 (Qwen3-14B vLLM 0.29.0) / RTX 3070 (Qwen2.5-1.5B LMCache 0.5.4) / MARA Cloud / ASTRA-Sim
- Runtime
- vLLM 0.29.0 + SGLang 0.5.21 + LMCache 0.5.4 + Rust GraphKV scheduler + LLMServingSim
- Workload / Dataset
- Qwen Trace A (43,058 reqs) & Trace B (172,800 reqs); HotpotQA+SQuAD (n=1,200); GRBench colocated (n=90); TauBench proxy traces
- Sample Size / Repeats
- n=5 paired runs/arm (B0/B1/B2, 1,200 req); 280 E0 transfer + 40 control trials (PARTIAL); n=48–96 colocated sessions
1. Motivation: The KV-Cache vs End-to-End Agent Reality Gap
Every LLM serving deck shows 10×–15× TTFT wins from KV prefix caching. Yet when we built multi-turn GraphRAG agents across local GPUs (H200, B200, RTX 3070), production trace replays (KCC 43K), and hosted APIs (MARA), three hard bottlenecks repeatedly blunted those headline speedups: LRU working-set eviction cliffs, decode/validator wall dominance (82–93%), and cross-replica prefix fragmentation.
2. Hypothesis, Falsification & Experimental Mechanism
We tested whether prefix caching and Graph-KV co-scheduling materially lower tail latency under multi-turn GraphRAG load (Mixed: massive prefill gains vanish at LRU cliffs and fail Holm gates under validator/decode walls).
3. Multi-Testbed Environment Summary
- Trace & Capacity Analysis (
kcc2026-tutorial,lmcache_contributor,AIsummit26):qwen_traceA_blksz_16:43,058requests (100.38Minput /18.54Moutput tokens;53.58%singleton blocks;2.00 MiB/block), replayed from0.031 → 16.0 GiBLRU. Also verifiedlmcache_contributorproxy reuse rates acrossopenai_agents(54.9%prefix /81.0%substring),mem0(27.4% / 47.4%,1,876Neo4j queries), andgraphiti(43.0% / 80.4%,p95 = 217.6ms Neo4j) with explicit caveat that those numbers areo200k_basetrace proxies rather than live inference measurements.H200gpt-oss-120bprefix sweep (1.8K → 54.5Ktokens) +RTX 3070Qwen2.5-1.5BLMCache0.5.4.
- Hosted & Serverless Checks (
mara,kcc2026-tutorial): MARA2K–16KpairedstablevsbustTTFT probes (N=10at 2K,N=6C=4 at 4K/8K/16K); TensorMeshQwen3.6-27B-FP8N=6AIPerf (0.25 rps). (Note earlier TensorMesh runs suffered4/6–5/6HTTP 429 failures, tracked honestly in lessons-learned.) - Co-Scheduling & Precision (
graphkv-cosched,seocho-room,LLMServingSim): B200real-matrix-v2(1,200HTTP 200 reqs across B0/B1/B2),real-robustness(800reqs cutting token budget8192 → 4096),E0native engine H2D study (280transfer trials +40graph-only controls =320total; separate Nsight CUPTI smoke probe verified125,829,120-byte H2D memcpy, statusPARTIAL),AgenticOS lab-s11..25b, and ASTRA-Sim DP2×TP2 simulations.
4. Visual Evidence & Quantitative Synthesis
Full Size ↗
| Study & System | Baseline / Uncached | Treatment / Constrained | Quantitative Finding & Caveat |
|---|---|---|---|
KCC Trace LRU (n=43,058 reqs) | Infinite cache: 59.40% block hits | 16 GiB (8,192-blk) LRU: 16.15% | 53.58% singleton blocks erode finite LRU hit rates |
H200 Prefix Sweep (gpt-oss-120b) | Cold 54.5K TTFT: 2.314 s | Warm 54.5K: 0.157 s (14.76×) | At 99.75% full (1.631M / 1.635M tok) -> 0.2% hits (1.83s) |
RTX 3070 LMCache 0.5.4 (Qwen-1.5B) | Absent fetch: 0.693 s | Evicted CPU fetch: 0.094 s (7.4×) | layerwise=True crashed (EngineDeadError); H200 600G hung |
MARA Prefix Sweep (2K–16K paired) | Unique bust prompt | Identical stable prompt | 0 cache telemetry samples; M2.7 bimodal routing 147 vs 428ms |
Graph-Agent Prefix (vLLM vs SGLang) | Cache OFF (52.3K tok) | Cache ON: 92.95% / 93.33% reuse | Under 55.8K-tok pressure, cached tokens drop 2000 → 0 / 3 |
GraphKV Policy (n=1,200, B200) | B0 FIFO p95 8,489.7 ms (r=16) | B2 Deadline p95 7,869.5 ms (+6.0% paired med / -7.3% cell) | Failed Holm (p=0.625); budget 4096 drops F1 0.717 → 0.574 |
GraphKV E0 H2D Contention (280+40) | Sequential restore alone | Joint Graph + 125–251 MB H2D | PARTIAL: H2D ratio 0.998–1.002×; no contention mechanism established |
AgenticOS (lab-s19/s21 & B200 FP8) | Prefix OFF 10.30s; BF16 4.52s | Prefix ON 8.62s; FP8 3.10s | Grammar cuts scope errors (46→50/90) but TPOT 26.7 → 49.4 ms |
LLMServingSim (Qwen3-30B proxy) | 1× RTXPRO6000 (88.42% prefix) | 4× DP2×TP2 (86.35% prefix) | Cross-DP splits cut reuse; E2E p50 11.0s → 12.8s at 1 rps |
5. Mechanism Breakdown: Why Caching Wins Pre-Fill Yet Fails to Rescue Tail E2E
- Non-linear LRU thrashing at saturation: Prefix caching assumes hot blocks stay ahead of eviction. On
H200, adding just0.25%headroom strain (1,631,304vs1,635,338KV capacity) turned54.5K14.8×speedups into near-zero (0.2%) reuse (1.83 sTTFT). OnB200vLLM (32KKV), injecting a single55,801-token request evicted100%of the resident2,000-token prefix (2,000 → 0). - Decode + validator serialization overwhelms graph DB latency: In
real-stage-summary.json, graph execution takes under0.9ms (0.61–0.87ms), whereas intent validation + dispatch takes816–3,885ms and decoding takes78–1,122ms. Even cleanly ordering queue entries (B1/B2) cannot clear the pre-registered Holm threshold (p=0.625) when external validator waits and serial autoregressive decode absorb>99%of request lifetime—and cutting evidence token budgets from8,192to4,096to speed decode immediately dropsanswer_f1from0.717to0.574and spikes partial truncations7.5% → 42.5%. - Closed vs local API observability: Hosted MARA probes returned empty
prompt_tokens_details={}(cache_usage={}) from2Kto16K, proving simulated reuse rates (86.35%hit inLLMServingSim) do not automatically translate across black-box API load balancers unless session affinity is explicit.
6. Key Findings & Transferable Insights
Distilled via multi-agent deliberation (Codex + Claude from KV traces, H200 sweeps, and e0_findings.md):
- Prefill TTFT gains (
14.76×) shrink by an order of magnitude at end-to-end wall level (~1.19×): While warm prefix caching slashes54.5KTTFT (2.31 → 0.16 s), full agent sessions saw end-to-end wall latency shift10.30 → 8.62 s(~1.19×) because autoregressive decode eats82.2–92.5%of request duration. Rule: Do not cut evidence budgets (8,192 → 4,096) to speed decode—F1 dropped0.717 → 0.574and partial truncations surged7.5% → 42.5%. - Size KV headroom against eviction cliffs, not infinite reuse assumptions:
16 GiBfinite LRU hits collapsed59.40% → 16.15%, H200 hits crashed to0.2%at99.75%capacity, and one55.8Knoisy turn evicted100%of a resident2Kprefix. Start with15–20%capacity slack as an empirical policy and validate under mixed-length eviction stress. - Profile stage shares before building complex schedulers (
B0/B1/B2p=0.625) & keepE0scoped honestly: Graph lookup<0.9 mscannot rescue816–3,885 msvalidator+dispatch stalls, ande0_findings.mdkeeps statusPARTIAL(280 transfer trials without calibrated DMA comparison endpoints—so shorter joint host critical paths are not claimed as proven hidden DMA).
7. Scope Limits & Blocked Hardware Work (yw-pow.3)
- Blocked KV offload & prefetch API paths (
yw-pow.3):graphkv-coschedpoliciesB3/B4/B5remainRESULT_PENDINGbecause vLLM lacks an external per-prefix GPU-prefetch hook; the400-case real QA matrix failed on Pythonsocket EPERM; H200600 GBLMCache offload hung >10 min; and RTX 3070layerwise=Truecrashed on request #1. - E0 & Simulation boundaries:
E0trial blocks were not independent engine restarts, NUMA placement order was fixed (local then remote), observer overhead was unmeasured, and large-graph DRAM saturation remains untested (e0_findings.md).LLMServingSimsubstitutedQwen3-30B-A3Bhardware LUTs forgpt-ossandMiniMaxworkloads due to unprofiled alternating/M2 layers.