提出混合离线在线调度法,提升大模型推理吞吐与硬件利用率。
Hybrid Offline-online Scheduling Method for Large Language Model Inference Optimization
- 结合离线装箱优化与在线抢占调度,动态调整预填充和解码任务顺序。
- 实测硬件利用率从80.2%升至89.1%,总推理时间缩短至190.58秒。
- 适合高并发大模型服务场景,尤其关注资源效率的部署系统。
随着大语言模型(LLMs)的发展,优化硬件使用并提升吞吐量变得日益重要。本文研究部署在服务系统中的大模型推理优化问题。为提升系统吞吐与最大化硬件利用率,我们将该问题建模为混合整数规划(MIP),并提出一种混合离线-在线调度方法。离线阶段通过引入最小化完成时间装箱问题(Minimizing Makespan Bin Packing Problem)优化大规模推理系统,并提供理论下界计算方法。在线阶段采用排序与抢占式调度策略,利用拉格朗日方法评估每轮迭代中插入预填充阶段与解码阶段的成本效益,动态决定是否抢占解码任务以插入预填充任务。基于真实世界数据,使用LLaMA-65B模型和GSM8K数据集的实验表明,系统利用率从80.2%提升至89.1%,总推理时间由201.00秒降至190.58秒。100例对比测试显示,本方法平均提升利用率8.0%。最后,讨论未来方向,包括随机建模、基于强化学习的调度器及动态决策策略。
原文摘要 · Abstract (English)
With the development of large language models (LLMs), it has become increasingly important to optimize hardware usage and improve throughput. In this paper, we study the inference optimization of the serving system that deploys LLMs. To optimize system throughput and maximize hardware utilization, we formulate the inference optimization problem as a mixed-integer programming (MIP) model and propose a hybrid offline-online method as solution. The offline method improves large-scale inference systems by introducing a Minimizing Makespan Bin Packing Problem. We further provide a theoretical lower bound computation method. Then, we propose an online sorting and preemptive scheduling method to better utilize hardware. In the online iteration scheduling process, a Lagrangian method is applied to evaluate the cost efficiency of inserting prefill stages versus decode stages at each iteration and dynamically determine when to preempt decoding tasks and insert prefill tasks. Experiments using real-world data from the LLaMA-65B model and the GSM8K dataset demonstrate that system utilization improves from 80.2% to 89.1%, and the total inference time decreases from 201.00 to 190.58 seconds. A 100-cases study shows that our method consistently outperforms the baseline method and improves the utilization rate by 8.0% on average. Finally, we discuss potential future extensions, including stochastic modeling, reinforcement learning-based schedulers, and dynamic decision-making strategies for system throughput and hardware utilization.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。