[论文解读] Mooncake: A KVCache-centric Disaggregated Architecture for LLM Serving
Mooncake 提出一个以 KVCache 为中心的解耦 LLM 服务架构,带有 KVCache 调度器,实现超载感知调度,在真实工作负载下带来高吞吐量提升并处理更多请求。
Mooncake is the serving platform for Kimi, a leading LLM service provided by Moonshot AI. It features a KVCache-centric disaggregated architecture that separates the prefill and decoding clusters. It also leverages the underutilized CPU, DRAM, and SSD resources of the GPU cluster to implement a disaggregated cache of KVCache. The core of Mooncake is its KVCache-centric scheduler, which balances maximizing overall effective throughput while meeting latency-related Service Level Objectives (SLOs). Unlike traditional studies that assume all requests will be processed, Mooncake faces challenges due to highly overloaded scenarios. To mitigate these, we developed a prediction-based early rejection policy. Experiments show that Mooncake excels in long-context scenarios. Compared to the baseline method, Mooncake can achieve up to a 525% increase in throughput in certain simulated scenarios while adhering to SLOs. Under real workloads, Mooncake's innovative architecture enables Kimi to handle 75% more requests.
研究动机与目标
- 在兼顾延迟相关 SLO(TTFT 和 TBT)的前提下,最大化面向 MaaS 的 LLM 服务的整体有效吞吐量。
- 利用解耦的硬件资源(CPU、DRAM、SSD、RDMA)在靠近 GPU 的位置构建可扩展的 KVCache 池。
- 开发一个以 KVCache 为中心的调度器(Conductor),在不同负载下平衡重用、分组与 SLO 合规。
- 通过基于预测的早期拒绝策略应对过载场景,以避免浪费的计算。
- 提出包含用于长上下文预填充的 CPP、分层预填充、KVCache 复制等架构和机制,以提升 MFU 并降低 TTFT。
提出的方法
- 将 GPU 集群资源解耦为 prefill 与 decoding 池,并在 CPU 内存、DRAM、SSD 以及 RDMA 传输(Messenger)上实现一个 KVCache 支撑的解耦缓存。
- 引入一个全局调度器(Conductor),根据 KVCache 前缀匹配、传输成本和预测的 prefill 时间来选择 prefill/decoding 实例,以满足 TTFT/TBT SLO。
- 对长上下文 prefill 使用分块流水线并行(CPP)以降低 TTFT 并使 KVCache 传输与计算重叠。
- 实现分层 prefill,使 KVCache 的加载/存储与计算重叠并最小化 VRAM 占用。
- 部署以 KVCache 为中心的调度算法,结合热点复制和 KVCache 传输决策,以平衡缓存重用与实例负载。
- 提出一个用于过载的早期拒绝策略,在短期负载预测的帮助下避免浪费的计算,并研究其对系统稳定性的影响。
实验结果
研究问题
- RQ1KVCache 为中心的解耦架构如何在满足 TTFT 与 TBT SLO 的同时提升 LLM 服务吞吐量?
- RQ2哪些调度策略和缓存管理策略(包括复制)在过载条件下如何在 KVCache 重用、网络传输和计算之间达到最佳平衡?
- RQ3分块 prefill 和分层 prefill 是否在不牺牲 MFU 的前提下降低长上下文输入的 TTFT?
- RQ4基于预测负载的早期拒绝策略对总体 goodput 和资源利用率有何影响?
- RQ5开源的真实世界请求跟踪结构是什么,它如何支持 KVCache 重用的研究?
主要发现
- Mooncake 在仿真场景中在满足 SLO 的同时,相对于基线方法实现高达 525% 的吞吐量提升。
- 在真实工作负载下,Mooncake 使 Kimi 能处理多出 75% 的请求。
- 长上下文场景充分体现出基于 KVCache 的解耦设计与调度的显著收益。
- 提供一个样本化的真实世界请求跟踪,包含 23,608 条目和 KVCache 块哈希,用于可重复的重用分析。
- 分层 prefill 与 CPP 在长上下文输入场景下降低 TTFT,通过将 KVCache 传输与计算重叠来提升 MFU。
- 在短期负载预测引导下的早期拒绝策略缓解了过载条件下的浪费计算。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。