提出统一的分段前缀缓存池,提升长文本大模型服务吞吐与缓存效率。
TokenLake: A Unified Segment-level Prefix Cache Pool for Fine-grained Elastic Long-Context LLM Serving
- 按分段管理前缀缓存,通过声明式接口实现跨实例高效共享
- 实测吞吐提升2.6倍,缓存命中率翻倍,显著降低内存碎片
- 适合需要弹性调度的高并发长文本生成场景
前缀缓存对加速多轮交互和具有共同前缀的请求至关重要。现有集群级缓存系统与请求调度紧密耦合,导致负载不均、数据冗余和内存碎片。为解决此问题,内存池化可使调度器脱离底层缓存管理,专注计算优化。但现有系统仅传递日益增长的前缀缓存,难以实现低延迟池化。为此,我们提出统一的分段级前缀缓存池 TokenLake,采用声明式缓存接口暴露查询张量、前缀缓存及缓存感知操作,支持以分段为单位管理缓存,并结合重热点感知负载均衡算法,实现更好的负载均衡、去重与防碎片。TokenLake还透明地最小化查询张量与新缓存的通信开销。基于 TokenLake,调度器可使用现有技术弹性调度请求,无需关心缓存管理。在真实工作负载上的评估显示,相比最先进的缓存感知路由与缓存中心型 PD 解耦方案,TokenLake 可分别将吞吐提升 2.6× 和 2.0×,缓存命中率提升 2.0× 和 2.1×。
原文摘要 · Abstract (English)
Prefix caching is crucial to accelerate multi-turn interactions and requests with shared prefixes. At the cluster level, existing prefix caching systems are tightly coupled with request scheduling to optimize cache efficiency and computation performance together, leading to load imbalance, data redundancy, and memory fragmentation of caching systems across instances. To address these issues, memory pooling is promising to shield the scheduler from the underlying cache management so that it can focus on the computation optimization. However, because existing prefix caching systems only transfer increasingly longer prefix caches between instances, they cannot achieve low-latency memory pooling. To address these problems, we propose a unified segment-level prefix cache pool, TokenLake. It uses a declarative cache interface to expose requests' query tensors, prefix caches, and cache-aware operations to TokenLake for efficient pooling. Powered by this abstraction, TokenLake can manage prefix cache at the segment level with a heavy-hitter-aware load balancing algorithm to achieve better cache load balance, deduplication, and defragmentation. TokenLake also transparently minimizes the communication volume of query tensors and new caches. Based on TokenLake, the scheduler can schedule requests elastically by using existing techniques without considering prefix cache management. Evaluations on real-world workloads show that TokenLake can improve throughput by up to 2.6$\times$ and 2.0$\times$ and boost hit rate by 2.0$\times$ and 2.1$\times$, compared to state-of-the-art cache-aware routing and cache-centric PD-disaggregation solutions, respectively.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。