Online Scheduling for LLM Inference with KV Cache Constraints

要約

トレーニングされたモデルがユーザープロンプトに応じて一度に1つの単語を生成する大規模な言語モデル(LLM)推論は、レイテンシとリソースの使用率を最適化するための効率的なスケジューリングを必要とする計算的に集中的なプロセスです。
LLM推論の重要な課題は、冗長計算を削減しますが、メモリの制約を導入するキー値(KV)キャッシュの管理です。
この作業では、KVキャッシュ制約を理論的にLLM推論をモデル化し、KVキャッシュのメモリを効果的に管理しながら推論の遅延を最小限に抑える新しいバッチとスケジューリングアルゴリズムを提案します。
半実施モデルと完全なオンラインスケジューリングモデルの両方を分析し、結果は3つあります。
まず、半整列プロンプト到着モデルの平均レイテンシに関して正確な最適性を達成する多項式時間アルゴリズムを提供します。
第二に、確率的プロンプトが到着した完全なオンラインケースでは、絶えず後悔して効率的なオンラインスケジューリングアルゴリズムを導入します。
第三に、完全にオンラインの敵対的な設定で一定の競争比を達成できるアルゴリズム(決定論的またはランダム化)がないことを証明します。
A100 GPUでLLAMA-70Bモデルを使用して、パブリックLLM推論データセットでの実証評価は、このアプローチが現在実際に使用されているベンチマークアルゴリズムを大幅に上回り、エネルギー消費量を減らしながら低下を達成していることを示しています。
全体として、私たちの結果は、より持続可能で費用対効果の高いLLM展開への道を提供します。

要約(オリジナル)

Large Language Model (LLM) inference, where a trained model generates text one word at a time in response to user prompts, is a computationally intensive process requiring efficient scheduling to optimize latency and resource utilization. A key challenge in LLM inference is the management of the Key-Value (KV) cache, which reduces redundant computations but introduces memory constraints. In this work, we model LLM inference with KV cache constraints theoretically and propose novel batching and scheduling algorithms that minimize inference latency while effectively managing the KV cache’s memory. We analyze both semi-online and fully online scheduling models, and our results are threefold. First, we provide a polynomial-time algorithm that achieves exact optimality in terms of average latency in the semi-online prompt arrival model. Second, in the fully online case with a stochastic prompt arrival, we introduce an efficient online scheduling algorithm with constant regret. Third, we prove that no algorithm (deterministic or randomized) can achieve a constant competitive ratio in fully online adversarial settings. Our empirical evaluations on a public LLM inference dataset, using the Llama-70B model on A100 GPUs, show that our approach significantly outperforms benchmark algorithms used currently in practice, achieving lower latency while reducing energy consumption. Overall, our results offer a path toward more sustainable and cost-effective LLM deployment.

arxiv情報

著者 Patrick Jaillet,Jiashuo Jiang,Chara Podimata,Zijie Zhou
発行日 2025-03-05 14:43:01+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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