arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2510.02758cs.LG
收藏

TokenFlow:通过抢占式调度在请求突发场景下实现响应式LLM文本流式服务

TokenFlow: Responsive LLM Text Streaming Serving under Request Burst via Preemptive Scheduling

Shanghai Jiao Tong University(上海交通大学);George Mason University(乔治·马歇尔大学);China Telecom Corporation Limited Shanghai Branch(中国电信股份有限公司上海分公司)

Junyi Chen, Chuheng Du, Renyuan Liu, Shuochao Yao, Dingtian Yan, Jiang Liao, Shengzhong Liu, Fan Wu, Guihai Chen

AI总结:

针对请求突发下标准LLM服务系统响应性差、并行度低的问题,提出基于抢占式调度与主动KV缓存管理的TokenFlow系统,可在不降低整体令牌吞吐量的同时大幅提升有效吞吐量并缩短首令牌时间。

摘要:

实时大语言模型(LLM)交互需要流式令牌生成,即文本令牌逐步生成并交付给用户,同时需平衡两大目标:响应性(即低首令牌时间)和稳定生成(即满足令牌间间隔时间要求)。标准LLM服务系统因非抢占式请求调度和被动式内存管理导致灵活性不足,在请求突发场景下会出现资源利用率低、请求处理并行度差的问题。为此,我们提出TokenFlow——一种新型LLM服务系统,通过抢占式请求调度和主动式键值(KV)缓存管理提升文本流式性能。TokenFlow基于实时令牌缓冲区占用率和令牌消耗率动态调整请求优先级,同时在后台主动在GPU与CPU内存间传输KV缓存,并将I/O与计算重叠以最小化请求抢占开销。在Llama3-8B和Qwen2.5-32B模型上,跨RTX 4090、A6000、H200多款GPU开展的大量实验表明,TokenFlow在不降低整体令牌吞吐量的前提下,有效吞吐量(计入实际用户消耗量)最高提升82.5%,同时P99首令牌时间(TTFT)最高降低80.2%。

英文摘要:

Real-time LLM interactions demand streamed token generations, where text tokens are progressively generated and delivered to users while balancing two objectives: responsiveness (i.e., low time-to-first-token) and steady generation (i.e.,required time-between-tokens). Standard LLM serving systems suffer from the inflexibility caused by non-preemptive request scheduling and reactive memory management, leading to poor resource utilization and low request processing parallelism under request bursts. Therefore, we present TokenFlow, a novel LLM serving system with enhanced text streaming performance via preemptive request scheduling and proactive key-value (KV) cache management. TokenFlow dynamically prioritizes requests based on real-time token buffer occupancy and token consumption rate, while actively transferring KV cache between GPU and CPU memory in the background and overlapping I/O with computation to minimize request preemption overhead. Extensive experiments on Llama3-8B and Qwen2.5-32B across multiple GPUs (RTX 4090, A6000, H200) demonstrate that TokenFlow achieves up to 82.5% higher effective throughput (accounting for actual user consumption) while reducing P99 TTFT by up to 80.2%, without degrading overall token throughput.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑