缓解KV缓存竞争以提升LLM推理中的用户体验
Mitigating KV Cache Competition to Enhance User Experience in LLM Inference
AI总结:
针对LLM推理中KV缓存竞争导致的TTFT和TBT高延迟问题,提出CacheOPT系统,通过估计输出长度、主动分配与重用KVC、智能抢占及选择最短延迟策略,显著降低尾部延迟并提升SLO达成率。
摘要:
在大语言模型(LLM)服务中,KV缓存(KVC)瓶颈导致尾部首令牌时间(TTFT)和令牌间时间(TBT)较高,损害用户体验,尤其是在时间敏感的应用中。然而,同时满足TTFT和TBT的服务水平目标(SLO)具有挑战性。为了解决这个问题,我们基于测量中的关键见解,提出一个名为CacheOPT的系统,用于缓解KV缓存竞争,该系统包含新颖的组件。首先,它估计请求的输出长度,以高指定概率限制偏差,并根据请求到达率进行调整。其次,它将估计的KVC需求分配给请求,并重用其他请求已分配的KVC,以避免抢占并减少等待时间。第三,它主动在请求耗尽分配之前而非之时分配KVC,并全局保留KVC以防止抢占。第四,它选择具有长TBT SLO、长作业剩余时间和短抢占时间的请求进行抢占。第五,它选择交换和重计算之间最短延迟的策略进行抢占。实验表明,与最先进的方法相比,CacheOPT实现了尾部TBT和尾部TTFT分别降低高达3.29倍和2.83倍,TTFT和TBT SLO达成率分别提高47%和53%,并支持高达1.58倍的更高请求到达率。
英文摘要:
In Large Language Model (LLM) serving, the KV-cache (KVC) bottleneck causes high tail Time-to-First-Token (TTFT) and Time-Between-Tokens (TBT), impairing user experience, particularly in time-sensitive applications. However, satisfying both TTFT and TBT service-level objectives (SLOs) is challenging. To address this, we propose a system, named CacheOPT for mitigating KV Cache competition, based on key insights from our measurements, incorporating novel components. First, it estimates a request's output length, bounding the deviation with a high specified probability, adjusted based on the request arrival rate. Second, it allocates the estimated KVC demand to a request, and reuses other requests' allocated KVC to avoid preemptions while reducing waiting time. Third, it proactively allocates KVC before instead of at the time a request exhausts its allocation and reserves KVC globally to prevent preemptions. Fourth, it chooses a request that has long TBT SLO, long job remaining time and short preemption time to preempt. Fifth, it selects the shortest-latency strategy between swapping and recomputation for preemptions. Experiments show that CacheOPT achieves up to 3.29$\times$ and 2.83$\times$ lower tail TBT and tail TTFT, 47\% and 53\% higher TTFT and TBT SLO attainments, and supports up to 1.58$\times$ higher request arrival rate than the state-of-the-art methods.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。