Gandalf: Flash Shall Not Die! Increasing Flash Storage Lifetime for KV Cache Offloading in LLM Serving
作者: Maharani A. P. Irawan, Kuntai Du, Jiayi Yao, Dongjoo Seo, Yuyang Huang, Haryadi S. Gunawi, Junchen Jiang
分类: cs.LG
发布日期: 2026-10-22
💡 一句话要点
提出Gandalf以提高SSD在LLM服务中的使用寿命
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: SSD寿命 KV缓存 大型语言模型 写入优化 注意力机制 存储管理 性能提升
📋 核心要点
- 现有方法在多轮对话等工作负载中,KV缓存的写入量超出SSD容量,导致SSD寿命大幅缩短。
- Gandalf通过结合历史访问模式和应用级信息,优先处理全注意力KV缓存,减少写入次数。
- 实验结果显示,Gandalf平均延长SSD使用寿命7.3倍,同时对缓存命中率影响极小。
📝 摘要(中文)
KV缓存可以降低大型语言模型(LLMs)的服务成本,但随着KV缓存占用空间的增加,超出了GPU和主机内存的容量。因此,使用SSD扩展KV缓存存储容量成为一种选择。然而,在多轮对话和LLM代理等生产工作负载中,KV缓存的写入量显著超过SSD的容量,导致SSD的使用寿命从几年缩短到几个月。为此,本文提出了Gandalf,这是第一个具有SSD使用寿命意识的SSD KV缓存卸载系统,通过考虑访问模式和应用级信息(如注意力类型)来减少KV缓存写入,从而显著提高SSD的使用寿命,同时保持缓存命中率不变。实验表明,Gandalf平均延长SSD使用寿命7.3倍,且对缓存命中率影响微乎其微。
🔬 方法详解
问题定义:本文旨在解决在大型语言模型服务中,KV缓存写入量过大导致SSD使用寿命显著缩短的问题。现有方法未能有效平衡KV缓存的写入频率与SSD的耐用性。
核心思路:Gandalf的核心思想是通过考虑历史访问模式和应用级信息(如注意力类型),来优化KV缓存的写入策略,从而减少对SSD的写入压力。
技术框架:Gandalf系统的整体架构包括缓存管理模块、访问模式分析模块和SSD写入调度模块。缓存管理模块负责管理KV缓存的存储和访问,访问模式分析模块用于分析历史访问数据,而SSD写入调度模块则根据分析结果优化写入策略。
关键创新:Gandalf的主要创新在于其SSD使用寿命意识的设计,通过优先处理全注意力KV缓存,显著提高SSD的耐用性,与传统方法相比,减少了不必要的写入。
关键设计:在设计中,Gandalf设置了特定的参数以识别不同类型的注意力缓存,并采用了动态调整的写入策略,以确保在不牺牲缓存命中率的情况下,最大限度地延长SSD的使用寿命。
🖼️ 关键图片
📊 实验亮点
Gandalf在多个工作负载跟踪和广泛的硬件容量下,平均延长SSD使用寿命7.3倍,同时对缓存命中率的影响微乎其微,显示出其在实际应用中的有效性和可靠性。
🎯 应用场景
Gandalf的研究成果在大型语言模型的服务中具有广泛的应用潜力,尤其是在需要高效存储和快速访问的场景中,如智能对话系统和实时数据处理。通过延长SSD的使用寿命,Gandalf能够降低硬件成本,提高系统的整体性能,具有重要的实际价值和未来影响。
📄 摘要(原文)
KV caching reduces the serving cost of large language models (LLMs), but the growing KV cache footprint is increasingly exceeds GPU and host-memory capacity. Therefore, people use SSD to expand the KV cache storage capacity with high I/O bandwidth. However, in production LLM workload, such as multi-round conversation and LLM agents, the total amount of KV cache writes significantly exceeds SSD capacity, shortening SSD lifetime from years to months. To improve SSD lifetime, a natural solution is to reduce the KV cache writes by gating the KV cache writes via historical access patterns. However, that significantly lowers the KV cache hit rate (and increase the LLM serving cost) since KV caches from different attention types might have identical historical access pattern but different future access patterns. Our insight is that, to reduce KV cache writes without hurting KV cache hit rate, one need to not only consider the access pattern, but also application-level information such as the attention type of KV cache. Leveraging this observation, we propose Gandalf , the first SSD KV cache offloading system with SSD life time awareness. Gandalf prioritize the admission of full-attention KV cache into SSD over the cache generated by other types of attention, which significantly increases SSD lifetime without sacrificing cache hit rate. Our evaluation shows that Gandalf extends the SSD lifetime by 7.3X on average, while having negligible impact on cache hit rate across multiple workload traces and wide range of hardware capacity. Gandalf design can be extended to other flash-based storage, such as High Bandwidth Flash (HBF).