Skip to main content
QUICK REVIEW

[Paper Review] Petals: Collaborative Inference and Fine-tuning of Large Models

Alexander Borzunov, Dmitry Baranchuk|arXiv (Cornell University)|Sep 2, 2022
Topic ModelingComputer Science6 citations
TL;DR

Petals enables collaborative inference and fine-tuning of large language models (e.g., BLOOM-176B) by distributing model layers across multiple participants' GPUs over the internet. It achieves ~1 token per second inference on consumer hardware using dynamic load balancing, 8-bit quantization, and low-latency routing, while exposing hidden states for research-grade fine-tuning via adapters and prompt tuning.

ABSTRACT

Many NLP tasks benefit from using large language models (LLMs) that often have more than 100 billion parameters. With the release of BLOOM-176B and OPT-175B, everyone can download pretrained models of this scale. Still, using these models requires high-end hardware unavailable to many researchers. In some cases, LLMs can be used more affordably via RAM offloading or hosted APIs. However, these techniques have innate limitations: offloading is too slow for interactive inference, while APIs are not flexible enough for research that requires access to weights, attention or logits. In this work, we propose Petals - a system for inference and fine-tuning of large models collaboratively by joining the resources of multiple parties. We demonstrate that this strategy outperforms offloading for very large models, running inference of BLOOM-176B on consumer GPUs with $\approx$ 1 step per second, which is enough for many interactive LLM applications. Unlike most inference APIs, Petals also natively exposes hidden states of served models, allowing to train and share custom model extensions based on efficient fine-tuning methods.

Motivation & Objective

  • To address the high computational and memory costs of running billion-parameter language models like BLOOM-176B and OPT-175B.
  • To overcome limitations of RAM/SSD offloading (too slow for interactive use) and hosted APIs (lack of access to internal states and flexibility).
  • To enable researchers and practitioners to collaboratively perform inference and parameter-efficient fine-tuning without requiring high-end hardware or trusted central servers.
  • To support sharing of fine-tuned model extensions (e.g., adapters) via a model hub, enabling collaborative model improvement.

Proposed method

  • Distributes model layers across multiple participants' GPUs, with clients forming chains of servers to execute inference in pipeline-parallel fashion.
  • Uses 8-bit quantization to reduce memory requirements and enable inference on consumer-grade GPUs.
  • Employs dynamic routing to select low-latency server chains and load balance across servers to minimize inference latency.
  • Supports parameter-efficient fine-tuning via adapters and prompt tuning, with trained submodules shared on a model hub.
  • Exposes hidden states and attention mechanisms during inference, enabling research-level analysis and customization.
  • Uses cryptographic hashing of inputs and outputs to detect and deter malicious or faulty servers, with economic incentives for correctness.

Experimental results

Research questions

  • RQ1Can large language models with over 100 billion parameters be efficiently and interactively inferred using only consumer-grade GPUs through collaborative distribution?
  • RQ2How can hidden states and attention mechanisms be exposed in a decentralized inference system to support research-grade fine-tuning?
  • RQ3What system-level optimizations (e.g., routing, quantization, load balancing) are necessary to achieve interactive inference speeds on decentralized hardware?
  • RQ4How can fine-tuned model extensions (e.g., adapters) be securely shared and reused across a decentralized network of participants?
  • RQ5What mechanisms can ensure correctness and prevent cheating in a decentralized, trustless inference environment?

Key findings

  • Petals enables interactive inference of BLOOM-176B at approximately 1 token per second using only consumer GPUs, outperforming RAM offloading in speed.
  • The system achieves this performance through 8-bit quantization, dynamic low-latency routing, and efficient load balancing across distributed servers.
  • Hidden states and attention mechanisms are natively exposed during inference, enabling advanced research applications such as prompt tuning and adapter training.
  • Parameter-efficient fine-tuning methods like adapters and prompt tuning can be performed collaboratively and shared via a model hub, enabling community-driven model adaptation.
  • Cryptographic hashing of inputs and outputs provides a verifiable mechanism to detect and disincentivize malicious or faulty servers, improving system integrity.
  • The system supports versioned model updates and fine-tuned adapter tagging, enabling future support for model versioning and incremental improvements.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.