arXiv:2411.18424cs.LGcs.DC2024-11被引 9

提升大模型服务公平性,降低上下文切换开销。

FastSwitch: Optimizing Context Switching Efficiency in Fairness-aware Large Language Model Serving

  • 提出FastSwitch系统,优化上下文切换时的内存管理
  • 在不同尾部延迟下,速度提升1.4至11.2倍
  • 适合关注服务公平性和低延迟响应的部署场景

并发服务大量用户请求需保障大模型服务系统的公平性,确保在相同成本下满足更多用户的SLO(如首令牌时间TTFT、令牌间隔时间TBT),而非少数用户过度超限。现有基于抢占的调度策略通过动态调整请求优先级维持运行时平衡,但过度追求吞吐量,忽视了抢占引发的上下文切换开销,该开销对公平性至关重要。本文识别出三大问题:I/O利用率不足、GPU空闲、多轮对话中不必要的I/O传输。关键洞察是,现有系统采用块状KV缓存内存策略虽实现近乎零内存浪费,却导致缓存内存不连续且粒度不足。为此,我们提出FastSwitch,一种兼顾现有内存分配策略并减轻上下文切换开销的公平感知服务系统。评估显示,与当前最先进的vLLM相比,FastSwitch在不同尾部TTFT和TBT下实现了1.4–11.2倍的速度提升。

原文摘要 · Abstract (English)

Serving numerous users and requests concurrently requires good fairness in Large Language Models (LLMs) serving system. This ensures that, at the same cost, the system can meet the Service Level Objectives (SLOs) of more users , such as time to first token (TTFT) and time between tokens (TBT), rather than allowing a few users to experience performance far exceeding the SLOs. To achieve better fairness, the preemption-based scheduling policy dynamically adjusts the priority of each request to maintain balance during runtime. However, existing systems tend to overly prioritize throughput, overlooking the overhead caused by preemption-induced context switching, which is crucial for maintaining fairness through priority adjustments. In this work, we identify three main challenges that result in this overhead. 1) Inadequate I/O utilization. 2) GPU idleness. 3) Unnecessary I/O transmission during multi-turn conversations. Our key insight is that the block-based KV cache memory policy in existing systems, while achieving near-zero memory waste, leads to discontinuity and insufficient granularity in the KV cache memory. To respond, we introduce FastSwitch, a fairness-aware serving system that not only aligns with existing KV cache memory allocation policy but also mitigates context switching overhead. Our evaluation shows that FastSwitch outperforms the state-of-the-art LLM serving system vLLM with speedups of 1.4-11.2x across different tail TTFT and TBT.

大模型服务公平性上下文切换KV缓存

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。