arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.04677cs.DS
收藏

基于前缀重用和延迟约束的LLM查询调度

LLM Query Scheduling with Prefix Reuse and Latency Constraints

LinkedIn(领英);Nubank

Gregory Dexter, Shao Tang, Ata Fatahi Baarzi, Qingquan Song, Tejas Dharamsi, Aman Gupta

AI总结:

本文提出k-LPM算法,通过平衡前缀重用与公平性,改进LLM查询调度的TTFT性能。

摘要:

大规模语言模型(LLM)在在线环境中的高效部署需要在严格延迟约束下优化推理性能,特别是时间到第一个token(TTFT)和每个输出token的时间(TPOT)。本文聚焦于具有前缀重用的LLM推理查询调度问题,这是一种利用查询间共享前缀以减少计算开销的技术。我们的工作揭示了现有先到先得(FCFS)和最长前缀匹配(LPM)调度策略在满足延迟约束方面的未知限制。我们提出了一个形式理论框架,用于在RadixAttention下进行LLM查询调度,这是一种存储和重用中间表示的前缀重用机制,采用基数树结构。我们的分析证明了在TTFT约束下具有前缀重用的调度问题的NP难性,并提出了一种新的调度算法k-LPM,通过平衡前缀重用和查询处理的公平性来扩展现有方法。理论保证证明,在由数据生成模型捕捉的现实交通模式下,k-LPM实现了改进的TTFT性能。在现实服务环境中的实证评估验证了我们的发现,显示与基线方法相比,P99 TTFT显著减少。

英文摘要:

The efficient deployment of large language models (LLMs) in online settings requires optimizing inference performance under stringent latency constraints, particularly the time-to-first-token (TTFT) and time-per-output-token (TPOT). This paper focuses on the query scheduling problem for LLM inference with prefix reuse, a technique that leverages shared prefixes across queries to reduce computational overhead. Our work reveals previously unknown limitations of the existing first-come-first-serve (FCFS) and longest-prefix-match (LPM) scheduling strategies with respect to satisfying latency constraints. We present a formal theoretical framework for LLM query scheduling under RadixAttention, a prefix reuse mechanism that stores and reuses intermediate representations in a radix tree structure. Our analysis establishes the NP-hardness of the scheduling problem with prefix reuse under TTFT constraints and proposes a novel scheduling algorithm, $k$-LPM, which generalizes existing methods by balancing prefix reuse and fairness in query processing. Theoretical guarantees demonstrate that $k$-LPM achieves improved TTFT performance under realistic traffic patterns captured by a data generative model. Empirical evaluations in a realistic serving setting validates our findings, showing significant reductions in P99 TTFT compared to baseline methods.

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

↑