インターネットを介した大規模言語モデルの分散推論とファインチューニング
Distributed Inference and Fine-tuning of Large Language Models Over The Internet
December 13, 2023
著者: Alexander Borzunov, Max Ryabinin, Artem Chumachenko, Dmitry Baranchuk, Tim Dettmers, Younes Belkada, Pavel Samygin, Colin Raffel
cs.AI
要旨
大規模言語モデル(LLM)は多くの自然言語処理(NLP)タスクにおいて有用であり、モデルサイズが大きくなるほど性能が向上し、最も優れたオープンソースモデルは500億以上のパラメータを有しています。しかし、これらの500億パラメータを超えるモデルを使用するにはハイエンドのハードウェアが必要であり、ほとんどの研究者にとってアクセスが困難です。本研究では、LLMのコスト効率の良い推論とファインチューニングの方法を調査し、ローカル戦略と分散戦略を比較します。我々は、十分に大きなモデル(500億パラメータ以上)であっても、消費者向けネットワーク上の地理的に分散したデバイスで効率的に実行できることを観察しました。これにより、複数の研究グループやボランティアのアイドル状態の計算リソースをプールすることで、LLMを効率的に実行できる可能性があります。我々は二つの未解決問題に取り組みます:(1)どのデバイスも突然切断される可能性がある状況下で、信頼性の高い推論とファインチューニングをどのように行うか、(2)ハードウェアが不均一なデバイス間でLLMをどのように分割し、自由に参加・離脱できるようにするか。これらを実現するために、特別なフォールトトレラントな推論アルゴリズムと、システム全体のスループットを最大化するためにデバイスを自動的に割り当てるロードバランシングプロトコルを開発しました。これらのアルゴリズムを、Llama 2(700億パラメータ)とBLOOM(1760億パラメータ)をインターネット上で実行する分散システム「Petals」で実証し、インタラクティブ生成においてオフロードよりも最大10倍高速に動作することを示します。我々は、シミュレーション環境と2大陸にまたがる実世界のセットアップでシステムの性能を評価しました。
English
Large language models (LLMs) are useful in many NLP tasks and become more
capable with size, with the best open-source models having over 50 billion
parameters. However, using these 50B+ models requires high-end hardware, making
them inaccessible to most researchers. In this work, we investigate methods for
cost-efficient inference and fine-tuning of LLMs, comparing local and
distributed strategies. We observe that a large enough model (50B+) can run
efficiently even on geodistributed devices in a consumer-grade network. This
could allow running LLM efficiently by pooling together idle compute resources
of multiple research groups and volunteers. We address two open problems: (1)
how to perform inference and fine-tuning reliably if any device can disconnect
abruptly and (2) how to partition LLMs between devices with uneven hardware,
joining and leaving at will. In order to do that, we develop special
fault-tolerant inference algorithms and load-balancing protocols that
automatically assign devices to maximize the total system throughput. We
showcase these algorithms in Petals - a decentralized system that runs Llama 2
(70B) and BLOOM (176B) over the Internet up to 10x faster than offloading for
interactive generation. We evaluate the performance of our system in simulated
conditions and a real-world setup spanning two continents.