S-LoRA: Serving Thousands of Concurrent LoRA Adapters

要約

「事前トレーニングしてから微調整する」パラダイムは、大規模な言語モデルのデプロイメントで一般的に採用されています。
パラメーター効率の高い微調整方法である低ランク適応 (LoRA) は、基本モデルを多数のタスクに適応させるためによく使用され、その結果、1 つの基本モデルから派生した LoRA アダプターの実質的なコレクションが得られます。
このパラダイムは、サービス提供中にバッチ推論の重要な機会を提供することがわかりました。
これらの機会を活用するために、多くの LoRA アダプターをスケーラブルに提供できるように設計されたシステムである S-LoRA を紹介します。
S-LoRA は、すべてのアダプタをメイン メモリに保存し、現在実行中のクエリで使用されているアダプタを GPU メモリにフェッチします。
GPU メモリを効率的に使用し、断片化を軽減するために、S-LoRA は統合ページングを提案します。
ユニファイド ページングは​​、ユニファイド メモリ プールを使用して、さまざまなランクの動的アダプターの重みと、さまざまなシーケンス長の KV キャッシュ テンソルを管理します。
さらに、S-LoRA は、新しいテンソル並列処理戦略と、LoRA 計算の異種バッチ処理のために高度に最適化されたカスタム CUDA カーネルを採用しています。
これらの機能を総合すると、S-LoRA は、わずかなオーバーヘッドで単一の GPU または複数の GPU 上で数千の LoRA アダプターにサービスを提供できるようになります。
HuggingFace PEFT や vLLM (LoRA サービスの単純なサポート付き) などの最先端のライブラリと比較して、S-LoRA はスループットを最大 4 倍向上させ、サービスされるアダプターの数を数桁増やすことができます。
その結果、S-LoRA は、多くのタスク固有の微調整されたモデルのスケーラブルな提供を可能にし、大規模なカスタマイズされた微調整サービスの可能性を提供します。
コードは https://github.com/S-LoRA/S-LoRA で入手できます。

要約(オリジナル)

The ‘pretrain-then-finetune’ paradigm is commonly adopted in the deployment of large language models. Low-Rank Adaptation (LoRA), a parameter-efficient fine-tuning method, is often employed to adapt a base model to a multitude of tasks, resulting in a substantial collection of LoRA adapters derived from one base model. We observe that this paradigm presents significant opportunities for batched inference during serving. To capitalize on these opportunities, we present S-LoRA, a system designed for the scalable serving of many LoRA adapters. S-LoRA stores all adapters in the main memory and fetches the adapters used by the currently running queries to the GPU memory. To efficiently use the GPU memory and reduce fragmentation, S-LoRA proposes Unified Paging. Unified Paging uses a unified memory pool to manage dynamic adapter weights with different ranks and KV cache tensors with varying sequence lengths. Additionally, S-LoRA employs a novel tensor parallelism strategy and highly optimized custom CUDA kernels for heterogeneous batching of LoRA computation. Collectively, these features enable S-LoRA to serve thousands of LoRA adapters on a single GPU or across multiple GPUs with a small overhead. Compared to state-of-the-art libraries such as HuggingFace PEFT and vLLM (with naive support of LoRA serving), S-LoRA can improve the throughput by up to 4 times and increase the number of served adapters by several orders of magnitude. As a result, S-LoRA enables scalable serving of many task-specific fine-tuned models and offers the potential for large-scale customized fine-tuning services. The code is available at https://github.com/S-LoRA/S-LoRA

arxiv情報

著者 Ying Sheng,Shiyi Cao,Dacheng Li,Coleman Hooper,Nicholas Lee,Shuo Yang,Christopher Chou,Banghua Zhu,Lianmin Zheng,Kurt Keutzer,Joseph E. Gonzalez,Ion Stoica
発行日 2023-11-07 06:59:33+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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