HiFC: High-efficiency Flash-based KV Cache Swapping for Scaling LLM Inference

Inho Jeong, Sunghyeon Woo, Sol Namkung, Dongsuk JeonNeurIPS 2025

TL;DR

Running large language models (LLMs) with long contexts requires massive memory for the Key-Value (KV) cache, usually forcing expensive upgrades to host DRAM. HiFC is a novel DRAM-free swapping system that offloads the KV cache directly from the GPU to commodity NVMe SSDs. By leveraging GPU Direct Storage and SSD pseudo-SLC regions, it achieves DRAM-like inference speeds while slashing memory expansion costs by over 4.5×.

The KV Cache Bottleneck

During LLM inference, models store the representations of past tokens in a Key-Value (KV) cache to avoid recomputing them. As batch sizes and context lengths grow—such as when analyzing whole books or codebases—this KV cache quickly exceeds the capacity of the GPU's High-Bandwidth Memory (HBM).

To prevent out-of-memory errors, current frameworks like vLLM "swap" excess KV cache to the host CPU's DRAM. However, outfitting servers with terabytes of DRAM is incredibly expensive and power-hungry. An alternative is offloading to cheaper, high-capacity NVMe SSDs. Unfortunately, traditional SSD offloading routes data through the CPU and host DRAM, creating a massive PCIe bandwidth bottleneck. Furthermore, the random read/write patterns of KV swapping quickly wear out standard flash memory, destroying the SSD's lifespan. HiFC was built to solve this: using cheap SSDs but performing like expensive DRAM.

Methods: How HiFC Works

HiFC (High-efficiency Flash Cache) is a DRAM-free architecture integrated directly into the vLLM framework. It relies on three key technical pillars:

HiFC System Architecture
  1. GPU-SSD Direct Swapping: HiFC uses NVIDIA's GPU Direct Storage (GDS) to create a direct data path between the GPU and the SSD. This completely bypasses the host CPU and DRAM, eliminating intermediate bottlenecks and redundant memory copies.
  2. Flash-Aware Block Management: SSDs suffer severe performance and lifespan penalties from random writes. HiFC replaces vLLM's standard memory allocator with a Flash Cache block allocator that uses an "append-only" strategy. It writes evicted KV blocks in strict physical order, ensuring highly efficient sequential I/O.
  3. pSLC Utilization: Instead of using the standard TLC (Triple-Level Cell) mode of commodity SSDs, HiFC restricts its operations to the drive's pseudo-SLC (Single-Level Cell) region. This mode stores only 1 bit per cell, which drastically increases sequential throughput and improves write endurance.

Key Insights

  • The "Stall Budget" Hides Latency: The biggest "aha" moment is that SSDs don't actually need to be as fast as DRAM to feel as fast. Because modern LLM serving uses deep sequence pipelining, there is natural slack (a "stall budget") in the computation schedule. As long as the SSD swap happens within this window, the I/O latency is completely hidden from the end-user.
  • Sequential Writes Save the Drive: By forcing KV cache evictions to act like an append-only log, HiFC achieves a Write Amplification Factor (WAF) of 1.02. This means for every 1 byte the system asks to write, the SSD physically writes exactly 1.02 bytes. Standard random workloads often have a WAF of 1.4 or higher, which burns through the drive's lifespan.
  • Commodity Hardware is Enough: You don't need highly specialized, expensive Computational Storage Drives (CSDs) to scale LLMs. By cleverly exploiting the pSLC cache already present on standard Gen4 NVMe SSDs, you can get enterprise-grade endurance and speed.

Key Results

The system was evaluated using several long-context datasets (Qasper, GovReport, NarrativeQA) to simulate heavy KV cache loads.

Throughput comparison between HiFC and DRAM swapping
  • Performance: HiFC achieves end-to-end inference throughput within 1–2% of DRAM-based swapping across multiple models (DeepSeek-Qwen-32B, Llama-8B, Mistral-7B) and datasets.
  • Cost Reduction: Over a 3-year deployment, replacing 128 GiB of DRAM with a 1 TiB pSLC-configured SSD reduces capital and operational memory expansion costs by 4.5× (and up to 6.1× based on late-2025 market projections).
  • Endurance: Thanks to the pSLC mode and sequential write strategy, the estimated lifespan of the commodity SSD under heavy, sustained LLM serving load is 8.3 years—likely outlasting the GPUs themselves.
  • Faster Initialization: HiFC speeds up LLM session initialization by up to 2.8× for large (100 GiB) KV caches, because it utilizes pre-generated flash files rather than allocating massive DRAM tensors from scratch.

Limitations and Future Work

While HiFC is highly effective for long-context and high-throughput batching, flash access latency might still introduce delays for very short-context or highly latency-sensitive workloads where there isn't enough computation to hide the I/O. Additionally, in setups where multiple GPUs share a single SSD, efficient bandwidth scheduling becomes critical to avoid traffic jams.

Getting the most out of HiFC currently requires domain-specific expertise to properly configure the SSD's pSLC regions and tune the filesystem. Future work will explore hybrid Flash-DRAM caching schemes to maintain stable performance across a wider, more unpredictable variety of workloads.

Summary updated

BibTeX
@inproceedings{jeong2025hifc,
  author = {Inho Jeong and Sunghyeon Woo and Sol Namkung and Dongsuk Jeon},
  title = {{HiFC: High-efficiency Flash-based KV Cache Swapping for Scaling LLM Inference}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=onhjdWCxZY},
}
Figure