arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.17264cs.LGcs.DC
收藏

没有被遗漏的请求:通过Medha解决长上下文LLM推理中的异质性

No Request Left Behind: Tackling Heterogeneity in Long-Context LLM Inference with Medha

Microsoft(微软公司);Georgia Institute of Technology(佐治亚理工学院);UC San Diego(圣地亚哥大学)

Amey Agrawal, Haoran Qiu, Junda Chen, Íñigo Goiri, Chaojie Zhang, Rayyan Shahid, Ramachandran Ramjee, Alexey Tumanov, Esha Choukse

AI总结:

Medha 通过引入细粒度抢占式调度和新型并行策略,有效解决长上下文LLM推理中的异质性问题,显著提升系统吞吐量和响应效率。

摘要:

部署百万标记的大语言模型(LLM)具有挑战性,因为生产工作负载高度异质,混合了短查询和长文档。这种异质性与注意力的二次复杂性相结合,会产生严重的 convoy 效应,其中长时间运行的请求会阻碍短而交互的请求,从而降低系统响应性。我们提出了Medha,一个服务系统,通过引入细粒度、预emption(抢占式)调度来消除这些 convoy。Medha 通过一组共同设计的机制使预emption 变得可行——包括自适应分块和流管道并行,这些机制克服了分块的感知效率和扩展挑战。此外,我们提出了一种新的并行策略 KV-缓存并行,以减少解码延迟并在非常长的上下文中实现交互性。这些机制由一个长度感知的相对空闲(LARS)调度器协调,这是一种 deadline 和异质性感知的调度策略,可以防止 convoy 效应和简单策略中出现的饥饿问题。在异构工作负载下,Medha 相比于最先进的非抢占式系统,吞吐量提高了 5.7 倍,中位数和 99 百分位数延迟分别减少了 30 倍和 174 倍。

英文摘要:

Deploying million-token Large Language Models (LLMs) is challenging because production workloads are highly heterogeneous, mixing short queries and long documents. This heterogeneity, combined with the quadratic complexity of attention, creates severe convoy effects where long-running requests stall short, interactive ones, degrading system responsiveness. We present Medha, a serving system that eliminates these convoys by introducing fine-grained, preemptive scheduling to LLM inference. Medha makes preemption practical with a co-designed set of mechanisms -- including Adaptive Chunking and Stream Pipeline Parallel that overcome the perceived inefficiencies and scaling challenges of chunking. Additionally, we present a new parallelism strategy KV-Cache Parallelism to reduce the decode latency and afford interactivity despite very long context. These mechanisms are orchestrated by a Length-Aware Relative Slack (LARS) scheduler, a deadline and heterogeneity-aware scheduling policy that prevents both the convoy effect and the starvation that plagues simpler policies. Under a heterogeneous workload, Medha improves throughput by 5.7x while reducing median and 99th percentile latency by 30x and 174x, respectively, compared to state-of-the-art non-preemptive systems.

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

↑