Optimizing LLM Inference: Fluid-Guided Online Scheduling with Memory Constraints

要約

大規模な言語モデル(LLM)は今日のアプリケーションでは不可欠ですが、それらの推論手順 – セグメントでテキストを処理し、メモリが多いキー値(kV)キャッシュを使用することにより応答を生成します – 特にメモリの制約の下で、重要な計算リソースが必要です。
このペーパーでは、LLM推論の最適化は、シーケンシャルプロンプトの到着とKVキャッシュの成長が従来のスケジューリングを非効率的にするマルチステージオンラインスケジューリングの問題として定式化します。
アルゴリズムの設計をガイドする扱いやすいベンチマークを提供するために、流体ダイナミクス近似を開発します。
これに基づいて、累積推論のしきい値(待機)アルゴリズムを待つことを提案します。これは、出力の長さがわかっているときに複数のしきい値を使用して着信プロンプトを最適にスケジュールし、出力の長さが不明なケースのネストされた待機に拡張します。
理論分析は、両方のアルゴリズムが、スループット、レイテンシ、および最初のトークン(TTFT)までのバランスをとる、交通量の多い状態での流体ベンチマークに対してほぼ最適なパフォーマンスを達成することを示しています。
合成データセットと実世界の両方のデータセットを使用して、A100 GPUでのLLAMA-7Bモデルを使用した実験は、VLLMやSarathiなどの確立されたベースラインと比較して、スループットとレイテンシの改善とレイテンシの改善を示しています。
この作業は、運用研究と機械学習を橋渡しし、メモリ制約の下でLLMを効率的に展開するための厳密なフレームワークを提供します。

要約(オリジナル)

Large Language Models (LLMs) are indispensable in today’s applications, but their inference procedure — generating responses by processing text in segments and using a memory-heavy Key-Value (KV) cache — demands significant computational resources, particularly under memory constraints. This paper formulates LLM inference optimization as a multi-stage online scheduling problem where sequential prompt arrivals and KV cache growth render conventional scheduling ineffective. We develop a fluid dynamics approximation to provide a tractable benchmark that guides algorithm design. Building on this, we propose the Waiting for Accumulated Inference Threshold (WAIT) algorithm, which uses multiple thresholds to schedule incoming prompts optimally when output lengths are known, and extend it to Nested WAIT for cases with unknown output lengths. Theoretical analysis shows that both algorithms achieve near-optimal performance against the fluid benchmark in heavy traffic conditions, balancing throughput, latency, and Time to First Token (TTFT). Experiments with the Llama-7B model on an A100 GPU using both synthetic and real-world datasets demonstrate improved throughput and reduced latency relative to established baselines like vLLM and Sarathi. This work bridges operations research and machine learning, offering a rigorous framework for the efficient deployment of LLMs under memory constraints.

arxiv情報

著者 Ruicheng Ao,Gan Luo,David Simchi-Levi,Xinshang Wang
発行日 2025-04-15 16:00:21+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.DC, cs.LG, math.OC, stat.ML パーマリンク