FairBatching:面向LLM推理的公平性感知批处理形成机制
FairBatching: Fairness-Aware Batch Formation for LLM Inference
AI总结:
针对LLM推理中解码优先导致的计算不公平问题,提出FairBatching调度器,通过自适应批容量和公平动态批形成算法,实现预填充与解码间公平资源分配,显著降低TTFT尾部延迟并提升系统容量。
摘要:
大语言模型(LLM)推理系统在最小化新请求的首词时间(TTFT)延迟与维持持续请求的高且稳定的令牌生成速率(即每输出令牌时间,TPOT)之间面临根本性矛盾。Sarathi提出的现有无停顿批处理调度器虽然能有效防止解码停顿,却引入了显著的计算不公平性。它们过度优先处理解码任务,同时导致解码松弛未被充分利用以及不必要的预填充排队延迟,这些因素共同降低了系统的整体服务质量(QoS)。\n本研究揭示了这种不公平性的根本原因:令牌间时间(TBT)作为调度指标的非单调性,以及无法适应动态工作负载突发的僵化解码优先策略。因此,我们提出了FairBatching,一种新颖的LLM推理调度器,它在预填充和解码任务之间强制实现公平的资源分配。它具备自适应批处理容量确定机制,动态调整计算预算以提高GPU利用率而不触发SLO违规。其公平且动态的批处理形成算法突破了解码优先范式,允许从突发的解码任务中回收计算资源以服务预填充激增,从而实现全局公平性。此外,FairBatching提供了一种新颖的负载估计方法,能够更有效地与上层调度器协调。在真实轨迹上实现和评估后,FairBatching将TTFT尾部延迟显著降低了最多2.29倍,同时稳健地维持TPOT SLO,实现了单节点容量整体提升20.0%,集群级容量提升54.3%。
英文摘要:
Large language model (LLM) inference systems face a fundamental tension between minimizing Time-to-First-Token (TTFT) latency for new requests and maintaining a high, steady token generation rate (low Time-Per-Output-Token, or TPOT) for ongoing requests. Existing stall-free batching schedulers proposed by Sarathi, while effective at preventing decode stalls, introduce significant computational unfairness. They prioritize decode tasks excessively, simultaneously leading to underutilized decode slack and unnecessary prefill queuing delays, which collectively degrade the system's overall quality of service (QoS). This work identifies the root cause of this unfairness: the non-monotonic nature of Time-Between-Tokens (TBT) as a scheduling metric and the rigid decode-prioritizing policy that fails to adapt to dynamic workload bursts. We therefore propose FairBatching, a novel LLM inference scheduler that enforces fair resource allocation between prefill and decode tasks. It features an adaptive batch capacity determination mechanism, which dynamically adjusts the computational budget to improve the GPU utilization without triggering SLO violations. Its fair and dynamic batch formation algorithm breaks away from the decode-prioritizing paradigm, allowing computation resources to be reclaimed from bursting decode tasks to serve prefill surges, achieving global fairness. Furthermore, FairBatching provides a novel load estimation method, enabling more effective coordination with upper-level schedulers. Implemented and evaluated on realistic traces, FairBatching significantly reduces TTFT tail latency by up to 2.29x while robustly maintaining TPOT SLOs, achieving overall 20.0% improvement in single-node capacity and 54.3% improvement in cluster-level capacity.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。