S-LoRA: Serving Thousands of Concurrent LoRA Adapters

要約

大規模な言語モデルのデプロイメントでは、「事前訓練-その後微調整」というパラダイムが一般的に採用されている。パラメータ効率に優れた微調整手法であるLoRA(Low-Rank Adaptation)は、ベースモデルを多数のタスクに適応させるために採用されることが多く、その結果、1つのベースモデルから派生したLoRAアダプタのコレクションが大量に生成される。我々は、このパラダイムが、サービス中にバッチ推論を行う重要な機会を提供することを観察している。この機会を生かすために、多数のLoRAアダプタをスケーラブルに提供するために設計されたシステム、S-LoRAを紹介する。S-LoRAは全てのアダプタをメインメモリに格納し、現在実行中のクエリで使用されるアダプタをGPUメモリにフェッチする。GPUメモリを効率的に使用し、断片化を減らすために、S-LoRAはユニファイドページングを提案します。Unified Pagingは、異なるランクの動的アダプタ重みと、シーケンス長が異なるKVキャッシュテンソールを管理するために、統一されたメモリプールを使用します。さらに、S-LoRAは、LoRA計算のヘテロジニアスバッチングのために、新しいテンソル並列戦略と高度に最適化されたカスタムCUDAカーネルを採用している。これらの機能を組み合わせることで、S-LoRAは1つのGPU上、あるいは複数のGPUにまたがる何千ものLoRAアダプタに、少ないオーバーヘッドで対応することができます。HuggingFace PEFTやvLLM(LoRAサービングを素朴にサポート)のような最先端のライブラリと比較して、S-LoRAはスループットを最大4倍向上させ、サービングされるアダプタの数を数桁増やすことができます。その結果、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.

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-06 17:26:17+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, DeepL

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