新框架LAMPS优化带外部数据的大模型推理,显著降低响应延迟。
Fast Inference for Augmented Large Language Models
- 按请求内存消耗动态排序,统一调度生成与API调用
- 相比现有系统,端到端延迟降低27%-85%,首字延迟降4%-96%
- 适合需要低延迟响应的实时交互式大模型应用
增强型大语言模型通过API调用整合外部数据源以提升能力。在交互式应用中,高效调度对保持低请求完成时间至关重要。然而,这类增强引入了调度挑战,因需管理有限的键值缓存(KV caches)内存。传统基于大小的调度算法(如最短作业优先)在最小化完成时间方面效果下降。现有工作仅关注API调用期间的内存保留、丢弃或交换,未考虑请求调度策略。本文提出LAMPS,一种面向增强型LLM的新推理框架。该框架通过统一调度方法,同时考虑请求总长度及其在API调用中的处理策略,最小化完成时间。鉴于LLM推理受内存限制,我们根据请求随时间的内存消耗进行排序,其取决于输出大小及在API调用期间的管理方式。LAMPS预测能最小化内存浪费的策略,优于现有方法。还提出防止饥饿的机制和优化以降低调度开销。我们在vLLM上实现LAMPS,并与基线系统对比,结果显示端到端延迟降低27%-85%,首令牌时间(TTFT)减少4%-96%,相较现有增强型系统和vLLM均有更优表现。
原文摘要 · Abstract (English)
Augmented Large Language Models (LLMs) enhance the capabilities of standalone LLMs by integrating external data sources through API calls. In interactive LLM applications, efficient scheduling is crucial for maintaining low request completion times, directly impacting user engagement. However, these augmentations introduce scheduling challenges due to the need to manage limited memory for cached information (KV caches). As a result, traditional size-based scheduling algorithms, such as Shortest Job First (SJF), become less effective at minimizing completion times. Existing work focuses only on handling requests during API calls by preserving, discarding, or swapping memory without considering how to schedule requests with API calls. In this paper, we propose LAMPS, a novel LLM inference framework for augmented LLMs. LAMPS minimizes request completion time through a unified scheduling approach that considers the total length of requests and their handling strategies during API calls. Recognizing that LLM inference is memory-bound, our approach ranks requests based on their consumption of memory over time, which depends on both the output sizes and how a request is managed during its API calls. To implement our scheduling, LAMPS predicts the strategy that minimizes memory waste of a request during its API calls, aligning with but improving upon existing approaches. We also propose starvation prevention techniques and optimizations to mitigate the overhead of our scheduling. We implement LAMPS on top of vLLM and evaluate its performance against baseline LLM inference systems, demonstrating improvements in end-to-end latency by 27%-85% and reductions in TTFT by 4%-96% compared to the existing augmented-LLM system, with even greater gains over vLLM.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。