Inferenza Distribuita e Fine-tuning di Modelli Linguistici di Grande Scala su Internet
Distributed Inference and Fine-tuning of Large Language Models Over The Internet
December 13, 2023
Autori: Alexander Borzunov, Max Ryabinin, Artem Chumachenko, Dmitry Baranchuk, Tim Dettmers, Younes Belkada, Pavel Samygin, Colin Raffel
cs.AI
Abstract
I grandi modelli linguistici (LLM) sono utili in molti compiti di NLP e diventano più capaci all'aumentare delle dimensioni, con i migliori modelli open-source che superano i 50 miliardi di parametri. Tuttavia, l'utilizzo di questi modelli da 50B+ richiede hardware di fascia alta, rendendoli inaccessibili alla maggior parte dei ricercatori. In questo lavoro, indaghiamo metodi per l'inferenza e il fine-tuning efficienti in termini di costi degli LLM, confrontando strategie locali e distribuite. Osserviamo che un modello sufficientemente grande (50B+) può funzionare in modo efficiente anche su dispositivi geodistribuiti in una rete di livello consumer. Ciò potrebbe consentire di eseguire LLM in modo efficiente aggregando risorse di calcolo inutilizzate di più gruppi di ricerca e volontari. Affrontiamo due problemi aperti: (1) come eseguire inferenza e fine-tuning in modo affidabile se qualsiasi dispositivo può disconnettersi bruscamente e (2) come partizionare gli LLM tra dispositivi con hardware disomogeneo, che si uniscono e lasciano il sistema a piacimento. Per fare ciò, sviluppiamo algoritmi di inferenza tolleranti ai guasti e protocolli di bilanciamento del carico che assegnano automaticamente i dispositivi per massimizzare la produttività totale del sistema. Mostriamo questi algoritmi in Petals, un sistema decentralizzato che esegue Llama 2 (70B) e BLOOM (176B) su Internet fino a 10 volte più velocemente rispetto all'offloading per la generazione interattiva. Valutiamo le prestazioni del nostro sistema in condizioni simulate e in un setup reale che copre due continenti.
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.