[論文レビュー] SARATHI: Efficient LLM Inference by Piggybacking Decodes with Chunked Prefills
Sarathiは chunked-prefills と decode-maximal batching を導入し、prefill にデコードを乗せることでデコードとエンドツーエンドのスループットを向上させ、モデルやハードウェア全体でパイプラインのバブルを減らす。
Large Language Model (LLM) inference consists of two distinct phases - prefill phase which processes the input prompt and decode phase which generates output tokens autoregressively. While the prefill phase effectively saturates GPU compute at small batch sizes, the decode phase results in low compute utilization as it generates one token at a time per request. The varying prefill and decode times also lead to imbalance across micro-batches when using pipeline parallelism, resulting in further inefficiency due to bubbles. We present SARATHI to address these challenges. SARATHI employs chunked-prefills, which splits a prefill request into equal sized chunks, and decode-maximal batching, which constructs a batch using a single prefill chunk and populates the remaining slots with decodes. During inference, the prefill chunk saturates GPU compute, while the decode requests 'piggyback' and cost up to an order of magnitude less compared to a decode-only batch. Chunked-prefills allows constructing multiple decode-maximal batches from a single prefill request, maximizing coverage of decodes that can piggyback. Furthermore, the uniform compute design of these batches ameliorates the imbalance between micro-batches, significantly reducing pipeline bubbles. Our techniques yield significant improvements in inference performance across models and hardware. For the LLaMA-13B model on A6000 GPU, SARATHI improves decode throughput by up to 10x, and accelerates end-to-end throughput by up to 1.33x. For LLaMa-33B on A100 GPU, we achieve 1.25x higher end-to-end-throughput and up to 4.25x higher decode throughput. When used with pipeline parallelism on GPT-3, SARATHI reduces bubbles by 6.29x, resulting in an end-to-end throughput improvement of 1.91x.
研究の動機と目的
- prefill と decode 計算の不一致に起因する LLM 推論の非効率を解消する。
- 均一で計算飽和したバッチを作成して、パイプライン並列展開におけるパイプラインバブルを削減する。
- デコードを prefills に乗せることを可能にする技術を導入して全体のスループットを向上させる。
- スケーラビリティと実用性を示すため、モデルとハードウェア全体で性能を評価する。
提案手法
- prefill リクエストを等サイズの計算サイズのチャンクに分割する chunked-prefills を導入する。
- 1つの prefill チャンクを含むバッチを形成し、残りのスロットにデコードを乗せる decode-maximal batching を提案する。
- デコードの線形演算を prefills と融合して、デコード時間をメモリ依存から計算依存へ変換する。
- P:D 比とタイルサイズの考慮を用いて、prefill チャンクサイズと piggybacked decode 数のトレードオフを分析する。
- nanoGPT をベースに実装を提供し、Orca のようなイテレーションレベルのスケジューリングと比較する。
実験結果
リサーチクエスチョン
- RQ1Sarathi が異なるシーケンス長、バッチサイズ、P:D 比の下でデコードスループットとエンドツーエンドの LLM スループットに与える影響は何か?
- RQ2Orca のような既存のイテレーションレベルのスケジューリング機構と比較して、Sarathi はスループットと効率の点でどうか?
- RQ3GPU パイプラインバブルとパイプライン並列モデルのスループットに対する Sarathi の影響は何か?
- RQ4chunked-prefills と decode-maximal batching に関連するオーバーヘッドは何で、それらはどのようにスケールするか?
主な発見
- A6000 での LLaMA-13B のデコードスループットは最大 10×向上し、エンドツーエンドのスループットは最大 1.33×。
- A100 での LLaMA-33B のデコードスループットは最大 4.25×、エンドツーエンドのスループットは最大 1.25×。
- GPT-3 のパイプライン並列で使用した場合、パイプラインバブルは 6.29×削減され、エンドツーエンドのスループットは 1.91×向上。
- 評価シナリオ全体で、Sarathi はモデルとハードウェア全体でデコードスループットとエンドツーエンドのスループットに顕著な改善を示す。
- Decode-maximal batching は、モデル重みを再利用し計算を融合することにより、デコード作業をメモリ依存から計算依存へ変換する。
- Chunked-prefills と decode-maximal batching は、単一の prefill から複数のハイブリッドバッチを可能にし、piggyback するデコードのカバー率を改善する。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。