用于提升大语言模型(LLM)推理吞吐量的多桶批处理
Multi-Bin Batching for Increasing LLM Inference Throughput
AI总结:
该研究针对LLM请求长度差异导致的资源利用率问题,提出多桶批处理方法,在静态批处理框架下提升了LLM推理吞吐量,量化了其与原生连续批处理的性能差距。
摘要:
随着大语言模型(LLM)因多样能力而日益普及,提升其推理系统的效率变得愈发关键。对LLM请求进行批处理是在服务器(如GPU)上调度推理作业的关键步骤,通过允许多个请求并行处理,使系统能够最大化吞吐量。然而,请求的生成长度往往各不相同,导致资源利用率不足,因为硬件必须等待批次中运行时间最长的请求完成后,才能处理下一批次。我们从排队论角度将该问题形式化,旨在设计一种在静态批处理框架下吞吐量最优的控制策略。我们提出了多桶批处理(Multi-Bin Batching),这是一种简单却有效的方法,可在该框架下通过将具有相似(预测)执行时间的请求分组到预定的桶中,显著提升LLM推理吞吐量。结合理论分析与实验,包括采用静态批处理和连续批处理基线的真实LLM推理场景,我们证明多桶批处理相比静态批处理大幅提升了吞吐量,并在理想长度信息和估计长度信息两种情况下,量化了其与原生连续批处理之间的剩余差距。
英文摘要:
As large language models (LLMs) grow in popularity for their diverse capabilities, improving the efficiency of their inference systems has become increasingly critical. Batching LLM requests is a critical step in scheduling the inference jobs on servers (e.g. GPUs), enabling the system to maximize throughput by allowing multiple requests to be processed in parallel. However, requests often have varying generation lengths, causing resource underutilization, as hardware must wait for the longest-running request in the batch to complete before moving to the next batch. We formalize this problem from a queueing-theoretic perspective, and aim to design a control policy which is throughput-optimal under a static-batching framework. We propose Multi-Bin Batching, a simple yet effective method that can provably improve LLM inference throughput under this framework by grouping requests with similar (predicted) execution times into predetermined bins. Through a combination of theoretical analysis and experiments, including real-world LLM inference scenarios with static and continuous-batching baselines, we demonstrate that multi-bin batching substantially improves throughput over static batching and quantify the remaining gap to native continuous batching under both oracle and estimated length information.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。