Skip to content
Xinyuanyi

How it works

How KV cache tiering works

In one sentence: keep the KV cache that overflows GPU memory and read it next time instead of recomputing it. This page follows a single request to show why that works, where it works and where it does not.

Updated

§ 01

The problem: GPU memory cannot hold every session

For every token an LLM processes it leaves a set of key and value tensors at each attention layer. That is the KV cache. With it, generating the next token does not require recomputing the preceding context. The longer the context, the larger the cache.

GPU memory is finite. Each AMD MI308X in the test platform on this site has 192 GB of HBM, which must hold the model weights and the KV cache of every active session. As sessions accumulate, older cache is evicted.

When an evicted session sends another request, the model has to prefill the whole context again. In measurements on a 480B model at concurrency 16, time to first token for such a full recompute is 149.5 s at p50R2.

§ 02

Three tiers: GPU memory, host RAM, external flash

KV cache tiering places cache on three media according to how hot it is. The first two tiers are managed by the inference framework; the third needs a dedicated storage device, and that is what the FX series provides.

  • Tier one, GPU memory: sessions that are active now. The lowest access latency of the three, and the least capacity.
  • Tier two, host RAM: sessions used recently, managed by LMCache.
  • Tier three, external flash: all historical sessions, shared by several inference instances.
  1. L1

    GPU memory (HBM)

    Sessions that are active right now

    Managed by vLLM

  2. L2

    Host RAM

    Sessions used recently

    Managed by LMCache

  3. L3

    FX all-flash array

    All historical sessions, shared across instances

    NVMe-oF · RoCEv2

§ 03

The path of one request

Every hit on the external cache saves one full prefill. That is the whole reason time to first token goes down.

  1. A request arrives and LMCache looks up existing KV cache by the prefix of the input tokens.
  2. If it is in GPU memory, it is used directly.
  3. If not, host RAM and external flash are checked in turn; on a hit the KV cache is read back into GPU memory and that part of prefill is skipped.
  4. Only when no tier has it does the GPU compute it, and the new KV cache is written to the tiers for later use.

§ 04

Measured: how much faster reading back is

The system under test is Qwen3-Coder-480B-FP8 deployed as one 8-GPU instance (TP=8), the production topology, on 8 × AMD MI308X under a long-context cold-recovery load. There are two baselines with different denominators, and they must not be mixed in one sentence.

Against full recompute without external storage: 8.6–20× fasterR2. At concurrency 16, TTFT p50 falls from 149.5 s to 11.85 s.

Against a single local NVMe drive: 29–40% more throughput and 26–32% lower TTFT p50R2R3. In other words, even when the KV cache is stored and read back either way, keeping it on FX100 is faster than keeping it on one NVMe drive inside the server.

Table 1 · Qwen3-Coder-480B-FP8 · TP=8 · 8 × MI308X · long-context cold-recovery load. TTFT is p50 in seconds; throughput in tok/s; full recompute was measured at concurrency 16 only. Source: R2
ConcurrencyFX100 TTFTLocal NVMe drive TTFTFull recompute TTFTFX100 tok/sLocal NVMe drive tok/sFull recompute tok/s
87.53 s10.17 s—56.643.9—
1611.85 s17.31 s149.48 s74.953.64.1
3226.35 s35.73 s—71.653.9—

§ 05

Why a networked array beats a local drive

Intuition says a local drive sits closer to the GPU and should be faster. But time to first token is not decided by the small extra protocol latency; it is decided by whether data can be returned to GPU memory fast enough under concurrent read-back.

In the measured setup, the baseline is one local NVMe drive (PCIe Gen4, 2 TB), while FX100 is a 4-drive RAID0 all-flash pool reached over RoCEv2 on one 100 GbE portR2. In software, the LMCache parallel-read patch raises single-GPU cold-read bandwidth from 0.98 GB/s to 5.23 GB/sR1.

An external pool also does something a local drive cannot: it lets several inference instances share one cache. Cross-instance hot sharing through the fs:// shared pool has been verifiedR3.

§ 06

Limits: when it does not help

The benefit comes from cache hits. In short, low-concurrency conversations, sessions are rarely evicted and rarely return, so the hit rate is low and this tier adds little.

Long contexts, multi-turn chat, agents and coding assistants recover sessions constantly and benefit the most. Which kind your workload is can only be known by measuring it with your own session-length distribution and concurrency. That is why we insist on testing before buying.

§ 07

Software stack and reproduction material

Adoption does not require rewriting the inference engine; it uses the open-source vLLM + LMCache combination. The measured versions are ROCm 7.2 and vLLM 0.20.1+rocm721, with LMCache built from upstream mainline source dated 2026-06-29R2.

The LMCache parallel-read patch we wrote is packaged as R8 together with the load client, orchestration scripts, forensic probe scripts and raw data, so a third party can rerun everything on its own clusterR8.

External references

  1. 01
    Efficient Memory Management for Large Language Model Serving with PagedAttention · arXiv (SOSP '23)

    vLLM's PagedAttention memory management and the motivation for paging the KV cache

  2. 02
    Mooncake: A KVCache-centric Disaggregated Architecture for LLM Serving · arXiv

    A KV-cache-centric disaggregated architecture and the trade-offs of reusing KV cache across nodes

  3. 03
    LMCache (GitHub repository) · LMCache Project

    LMCache source code, architecture and storage backends

  4. 04
    vLLM Documentation · vLLM Project

    Official documentation of vLLM deployment, prefix caching and tensor-parallel settings

  5. 05
    NVM Express Specifications · NVM Express, Inc.

    The official specifications of NVMe and NVMe over Fabrics

  6. 06
    RFC 5040: A Remote Direct Memory Access Protocol Specification · IETF

    The normative definition of the RDMA protocol

Test jointly first, decide afterwards

Test jointly first, decide afterwards

Every engagement starts with a gated joint test of about 10 weeks. Four gates are passed in sequence; if one is missed, the project stops there, so you never pay for a benefit that was not demonstrated.

Contact
Wang Limin
Phone
+86 131 6181 8898
Email
mingxin@agentmail.to

The inbox is monitored and triaged by AI around the clock