Skip to main content
QUICK REVIEW

[论文解读] Distributed Inference and Fine-tuning of Large Language Models Over The Internet

Alexander Borzunov, Max Ryabinin|arXiv (Cornell University)|Dec 13, 2023
Ferroelectric and Negative Capacitance DevicesEngineering被引用 13
一句话总结

论文介绍 Petals,一种容错去中心化的系统,用于通过互联网进行分布式推理和对超大型语言模型的微调,在互联网上实现比本地卸载快十倍的交互生成,并能够在不可靠的、地理分布的设备上工作。

ABSTRACT

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.

研究动机与目标

  • 通过在机构与志愿者之间汇聚闲置计算资源,推动对50B+参数的大型语言模型的高效使用。
  • 开发能够在设备突然断开时仍然工作的容错推理算法。
  • 为跨异质加入/离线设备分区模型块创建负载均衡协议。
  • 在分布式去中心化环境中实现参数高效的微调。
  • 在真实世界模型(Llama 2 70B 和 BLOOM 176B)以及模拟/真实网络上展示其实用性。

提出的方法

  • 提出一种容错自回归推理算法,利用服务器端和客户端的注意力缓存从服务器失败中恢复。
  • 使用去中心化的负载均衡机制,服务器在分布式哈希表中宣布块所有权和吞吐率,以最大化系统吞吐量。
  • 通过在承载连续模型块的服务器链上使用最短路径路由(D* Lite)建模延迟。
  • 应用参数高效微调(适配器/软提示),由客户端持有可训练参数和服务器端梯度流,实现多任务微调而不更新服务器权重。
  • 使用量化(8位/4位)和梯度检查点来使大模型适应普通硬件并减少服务器之间的通信。
  • 实施实际的通信优化,使服务器能够直接交换激活,减少客户端瓶颈。)

实验结果

研究问题

  • RQ1当任一参与设备可能意外断开时,如何可靠地进行LLM的推理和微调?
  • RQ2如何在异质的加入/离开的设备上对大型变换模型进行分区和执行以最大化吞吐量?
  • RQ3与传统将任务卸载到高端硬件相比,分布式互联网规模推理的性能含义是什么?
  • RQ4在去中心化、容错环境中,是否可以在不更新服务器端参数的情况下有效支持参数高效微调?
  • RQ5哪些实际优化(量化、缓存、流水线并行)能实现跨地理分布志愿者的现实部署?

主要发现

  • 具有双注意力缓存的容错推理算法,即使服务器失败也能实现长序列生成。
  • Petals 使 Llama 2 (70B) 和 BLOOM (176B) 能在互联网上运行,在真实条件下的吞吐量明显高于本地卸载。
  • 分布式推理在现实网络速度与延迟下,对互动生成的加速达到甚至超过10倍。
  • 通过去中心化哈希表的自动负载均衡和持续再平衡,即使节点加入/离开或失败,也能维持高系统吞吐量。
  • 参数高效微调可在客户端持有可训练参数、服务器端计算梯度时进行,避免服务器端参数更新。
  • 量化和内存节省技术(8/4-bit、梯度检查点)使50B+模型在分布式普通硬件上变得可行。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。