[Paper Review] Distributed Inference and Fine-tuning of Large Language Models Over The Internet
The paper introduces Petals, a fault-tolerant, decentralized system for distributed inference and fine-tuning of very large language models over the Internet, achieving up to 10x faster interactive generation than local offloading and working across unreliable, geodistributed devices.
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.
Motivation & Objective
- Motivate cost-efficient usage of 50B+ parameter LLMs by pooling idle compute resources across institutions and volunteers.
- Develop fault-tolerant inference algorithms that survive abrupt device disconnections.
- Create load-balancing protocols for partitioning model blocks across heterogeneous, joining/leaving devices.
- Enable parameter-efficient fine-tuning within a distributed, decentralized setting.
- Demonstrate practicality on real-world models (Llama 2 70B and BLOOM 176B) and simulated/real networks.
Proposed method
- Propose a fault-tolerant autoregressive inference algorithm that uses server-side and client-side attention caches to recover from server failures.
- Use a decentralized load-balancing mechanism where servers announce block ownership and throughput in a distributed hash table to maximize system throughput.
- Model latency via shortest-path routing (D* Lite) across a chain of servers hosting consecutive model blocks.
- Apply parameter-efficient fine-tuning (adapters/soft prompts) with client-held trainable parameters and server-side gradient flow, enabling multi-task fine-tuning without updating server weights.
- Employ quantization (8-bit/4-bit) and gradient checkpointing to fit large models on commodity hardware and reduce inter-server communication.
- Implement practical communication optimizations where servers can directly exchange activations to reduce client bottlenecks.
Experimental results
Research questions
- RQ1How can inference and fine-tuning of LLMs be reliably performed when any participating device may disconnect unexpectedly?
- RQ2How can large transformer models be partitioned and executed across heterogeneous, joining/leaving devices to maximize throughput?
- RQ3What are the performance implications of distributed Internet-scale inference compared to traditional offloading to high-end hardware?
- RQ4Can parameter-efficient fine-tuning be effectively supported in a decentralized, fault-tolerant setting without updating server-side parameters?
- RQ5What practical optimizations (quantization, caching, pipeline parallelism) enable real-world deployment across geo-distributed volunteers?
Key findings
- A fault-tolerant inference algorithm with dual attention caches enables long-sequence generation despite server failures.
- Petals enables Llama 2 (70B) and BLOOM (176B) to run over the Internet with substantially higher throughput than local offloading in realistic conditions.
- Distributed inference achieves up to ≥10x speedups over offloading for interactive generation under realistic network speeds and latencies.
- Automatic load balancing via a decentralized hash table and continual rebalancing maintains high system throughput even as nodes join/leave or fail.
- Parameter-efficient fine-tuning can be performed with client-held trainable parameters while servers compute gradients, avoiding server-side parameter updates.
- Quantization and memory-saving techniques (8/4-bit, gradient checkpointing) render 50B+ models feasible on commodity hardware in a distributed setup.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.