arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.16355cs.LG
收藏

RedCoast:一款在任意 GPU/TPU 上自动化 LLM 分布式训练的轻量级工具

RedCoast: A Lightweight Tool to Automate Distributed Training of LLMs on Any GPU/TPUs

Carnegie Mellon University(卡内基梅隆大学);Google Research(谷歌研究院);Petuum Inc.(Petuum公司);UC San Diego(加利福尼亚大学圣迭戈分校);Mohamed bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学)

Bowen Tan, Yun Zhu, Lijuan Liu, Hongyi Wang, Yonghao Zhuang, Jindong Chen, Eric Xing, Zhiting Hu

AI总结:

本文提出轻量级工具 RedCoast,通过两条张量并行规则和仅需定义三个函数的机制,自动化 LLM 在任意 GPU/TPU 上的分布式训练与推理,显著降低 MLSys 门槛并减少代码量。

摘要:

人工智能的近期进展在很大程度上可归功于大语言模型(LLMs)。然而,它们不断增长的内存需求给机器学习(ML)研究者和工程师带来了挑战。要解决这一问题,开发者需要将一个大模型切分并分布到多个 GPU 或 TPU 上。使用现有的模型并行工具(如 Megatron-LM、DeepSpeed 和 Alpa)需要大量的编码工作和复杂的配置工作。这些工具要求用户具备机器学习系统(MLSys)方面的专业知识,这成为 LLM 开发中的一个瓶颈,尤其是对于没有 MLSys 背景的开发者而言。在本文中,我们提出了 RedCoast(Redco),这是一款轻量级且用户友好的工具,旨在自动化 LLM 的分布式训练和推理,并简化 ML 流水线开发。Redco 的设计强调两个关键方面。首先,为了实现模型并行自动化,我们的研究识别出两条简单的规则,用于为任意给定的 LLM 生成张量并行策略。将这些规则集成到 Redco 中,可以轻松实现分布式 LLM 训练和推理,无需额外的编码或复杂配置。我们通过将 Redco 应用于一组 LLM 架构(如 GPT-J、LLaMA、T5 和 OPT,规模最大达 66B)来证明其有效性。其次,我们提出了一种机制,仅通过定义三个函数即可定制多样化的 ML 流水线,从而避免冗余和公式化的代码,例如与多主机相关的处理。该机制被证明适用于一系列 ML 算法,从基础的语言建模到元学习和强化学习等复杂算法。因此,与官方对应实现相比,Redco 实现的代码行数显著更少。

英文摘要:

The recent progress of AI can be largely attributed to large language models (LLMs). However, their escalating memory requirements introduce challenges for machine learning (ML) researchers and engineers. Addressing this requires developers to partition a large model to distribute it across multiple GPUs or TPUs. This necessitates considerable coding and intricate configuration efforts with existing model parallel tools, such as Megatron-LM, DeepSpeed, and Alpa. These tools require users' expertise in machine learning systems (MLSys), creating a bottleneck in LLM development, particularly for developers without MLSys background. In this work, we present RedCoast (Redco), a lightweight and user-friendly tool crafted to automate distributed training and inference for LLMs, as well as to simplify ML pipeline development. The design of Redco emphasizes two key aspects. Firstly, to automate model parallelism, our study identifies two straightforward rules to generate tensor parallel strategies for any given LLM. Integrating these rules into Redco facilitates effortless distributed LLM training and inference, eliminating the need of additional coding or complex configurations. We demonstrate the effectiveness by applying Redco on a set of LLM architectures, such as GPT-J, LLaMA, T5, and OPT, up to the size of 66B. Secondly, we propose a mechanism that allows for the customization of diverse ML pipelines through the definition of merely three functions, avoiding redundant and formulaic code like multi-host related processing. This mechanism proves adaptable across a spectrum of ML algorithms, from foundational language modeling to complex algorithms like meta-learning and reinforcement learning. As a result, Redco implementations exhibit significantly fewer lines of code compared to their official counterparts.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑