Petals: Collaborative Inference and Fine-tuning of Large Models

Alexander Borzunov, Dmitry Baranchuk, Tim Dettmers, Max Ryabinin, Younes Belkada +3 more
9/2/2022
176 citations
cs.LGcs.DC

Official code: learning-at-home/hivemind (2,555 stars, Python, MIT, PyTorch, last commit 2026-01-11).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

PyTorchMIT

Decentralized deep learning in PyTorch. Built to train models on thousands of volunteers across the world.

2,555236Python, DockerfileFeb 27, 202010 months agoMIT
asynchronous-programmingasynciodeep-learningdhtdistributed-systems+7 more

Similar Papers

Cite this paper

@article{borzunov2022petals,
  title  = {Petals: Collaborative Inference and Fine-tuning of Large Models},
  author = {Alexander Borzunov and Dmitry Baranchuk and Tim Dettmers and Max Ryabinin and Younes Belkada and Artem Chumachenko and Pavel Samygin and Colin Raffel},
  year   = {2022},
  eprint = {2209.01188},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2209.01188}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2209.01188.svg)](https://codeofpaper.com/paper/2209.01188)

Discussion