Chiosa
Systems & Infrastructure

Why a shared prompt cache raised tail latency

When the KV Cache Is Slower Than the GPU: Scaling Remote KV Tiers for Context-Parallel Prefill · arXiv:2610.21500

3 min
Updated
Model (Eq. 1) against measurement for a 16k-token hit. T0 is fitted on the H5b median only; the single-instance runs were not used to fit. The dashed line is the measured recompute median.
Model (Eq. 1) against measurement for a 16k-token hit. T0 is fitted on the H5b median only; the single-instance runs were not used to fit. The dashed line is the measured recompute median.Figure 2 · When the KV Cache Is Slower Than the GPU: Scaling Remote KV Tiers for Context-Parallel Prefill · Muhammad Ibrahim · CC BY 4.0

In plain words

A language model can save the work it did on an earlier prompt and reuse that data when a new prompt starts the same way. This paper studies why fetching that saved data from a shared remote cache sometimes took longer than doing the work again.

The author built a model of the tradeoff and a cache store that spreads the data across GPUs. In one replay of a hit-heavy request stream, the complete design had much lower tail latency while still serving 98.5% of prompt tokens from the remote cache. The replay was run once on one isolated engine.

The research

A shared prompt cache is useful only if retrieving saved prompt data costs less time than recomputing it.

In this production workload, enabling the remote tier left median time to first token unchanged but sharply raised the p99 for 16k-token requests, leaving the practical question of why a cache hit could slow serving.

The paper models when remote cache hits beat recomputation, then shards cached data across GPUs to reduce stalls while preserving high cache use.

The production result raises a concrete question: why did a shared cache intended to avoid repeating prompt work make the slowest 16k-token requests slower? The author models cache-hit time as transfer plus fixed overhead, then compares the required bandwidth with what one remote store delivered.

The model’s break-even requirement exceeded the measured bandwidth, supporting the explanation that hits could lose to recomputation on this setup. A store split across ranks then spreads cache work.

In one hit-heavy replay, the full design had much lower p99 prefill latency than synchronous loading through one instance, while both served 98.5% of prompt tokens from cache.

The latency replay was run once on an isolated, prefill-only engine, using one prompt-length bucket and one engine as the cache client. The separate end-to-end deployment comparison changed other deployment conditions too, so it does not isolate the cache design’s effect.

What the evidence shows

  • When cache hits add delay

    The paper studies a shared remote key/value (KV) cache for GLM-5.3 serving with prompt processing split across eight GPUs. In production, enabling the remote tier left median time to first token unchanged but raised p99 time to first token from 3.96 to 17.3 seconds in the 16k-token workload cell. The question is why retrieving saved prompt data could make the tail slower.

  • Compare loading with recomputation

    To examine that question, the author models a cache hit as data transfer plus a fixed per-hit cost, and compares that with recomputing the prompt. For GLM-5.3 FP8 on one B300 node, the model estimates a break-even bandwidth of 2.53 GB/s per prompt.

    One Valkey instance serving eight ranks delivered at most 1.71 GB/s, supporting the explanation that remote hits could be slower than recomputation on this setup.

  • Spread work across ranks

    The design spreads cached chunks across the eight context-parallel ranks, so each rank stores and fetches its assigned chunks. The scheduler’s existing minimum-over-ranks lookup still finds the first missing chunk, and the load protocol makes ranks agree on which prefix is usable before they exchange data.

    These operations address both the single-rank I/O bottleneck and the need for ranks to stay in step.

  • Check latency against cache use

    A one-instance asynchronous control had lower p99 prefill latency than synchronous loading, but only 50.6% of prompt tokens came from the remote cache, down from 98.5%. The paper reports that 49% of requests timed out waiting for lookup and recomputed.

    This result shows that lower latency alone did not mean the hit-heavy stream was being served from cache.

  • Assess the complete design

    With eight instances, asynchronous loading, sharding and all client fixes together, the hit-heavy replay’s p99 was 0.67 seconds, compared with 83.32 seconds for one instance with synchronous loading and the rank-0 store.

    Both runs served 98.5% of prompt tokens from the remote cache. The result supports the combined design for this replay, while the single-run test cannot separate the contribution of each change.

Deep

Next paperEmber keeps oversized GPU workloads moving with adaptive placement