arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2407.05347cs.NI
收藏

从排队论角度探讨具有可变令牌长度的低延迟LLM推理

A Queueing Theoretic Perspective on Low-Latency LLM Inference with Variable Token Length

School of Information Science and Technology, Fudan University(复旦大学信息科学与技术学院);Center for Cyber Security and Privacy, University of Oregon(俄勒冈大学网络安全与隐私中心)

Yuqing Yang, Yuedong Xu, Lei Jiao

AI总结:

本文从排队论角度研究了LLM推理中可变令牌长度对低延迟的影响,提出数学模型优化最大令牌限制并分析不同批量策略的排队延迟。

摘要:

大型语言模型(LLMs)推动了交互式AI应用的繁荣,如ChatGPT所展示的,这些应用需要及时响应推理服务。然而,LLM推理是计算密集型和内存密集型的,LLM平台上的不当参数配置可能会加剧推理时间。在本文中,我们分析了LLM输出令牌分布对推理排队延迟的影响,其中考虑了最大令牌截断和批量推理。通过建立M/G/1模型,我们观察到在极小比例的推理请求上强制实施最大输出令牌限制可以显著减少排队延迟,且我们的模型有助于选择最佳限制。对于批量推理,我们将服务过程建模为一个批量队列,其中批量处理时间受批量大小和该批量内最大令牌大小的共同影响。推导了所有缓冲请求的排队(动态批量)、固定数量请求的排队(固定批量)以及无批次内等待的排队(弹性批量)的排队延迟。实验结果表明,我们的数学模型与事件驱动模拟结果吻合良好。

英文摘要:

Large language models (LLMs) propel the prosperity of interactive AI applications showcased by ChatGPT that demand timely response of inference services. However, LLM inference is computation intensive and memory intensive, and improper parameter configuration at LLM platforms may exacerbate the inference time. In this paper, we analyze the impact of LLM output token distribution on the inference queueing delay, where the max-token clipping and the batched inference are considered. By formulating an M/G/1 model, we observe that enforcing a maximum output token limit on a very small fraction of inference requests can significantly reduce the queueing delay, and our model facilitates the selection of the optimal limit. For the batch inference, we model the service process as a bulk queue in which the batch processing time is affected by the batch size and the maximum token size inside this batch jointly. The queueing delays of the batching of all buffered requests (dynamic batching), the batching of constant number of requests (fixed batching), and the batching without intra-batch waiting (elastic batching) are derived. Experimental results show that our mathematical models coincide with the event-driven simulations well.

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

↑