arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.07719cs.LGcs.AI
收藏

USP:一种面向长上下文生成式AI的统一序列并行方法

USP: A Unified Sequence Parallelism Approach for Long Context Generative AI

Tencent(腾讯)

Jiarui Fang, Shangchun Zhao

AI总结:

本文提出统一序列并行方法USP,融合DeepSpeed-Ulysses与Ring-Attention的优势,提升对模型架构和网络拓扑的鲁棒性,并在208K长序列LLAMA3-8B训练中实现47% MFU。

摘要:

序列并行(SP)将输入张量的序列维度划分到多个计算设备上,正成为释放生成式AI模型长上下文能力的关键。本文研究了最先进的SP方法,即DeepSpeed-Ulysses和Ring-Attention,并提出一种统一的SP方法,该方法对Transformer模型架构和网络硬件拓扑具有更强的鲁棒性。本文比较了SP与现有并行方式(包括数据/张量/ZeRO/流水线并行)的通信和内存开销,并讨论了设计包含SP的混合4D并行的最佳实践。我们使用SP在两个8xA800节点上以208K序列长度训练LLAMA3-8B模型,实现了47%的MFU。我们的代码已在https://github.com/feifeibear/long-context-attention公开。

英文摘要:

Sequence parallelism (SP), which divides the sequence dimension of input tensors across multiple computational devices, is becoming key to unlocking the long-context capabilities of generative AI models. This paper investigates the state-of-the-art SP approaches, i.e. DeepSpeed-Ulysses and Ring-Attention, and proposes a unified SP approach, which is more robust to transformer model architectures and network hardware topology. This paper compares the communication and memory cost of SP and existing parallelism, including data/tensor/zero/pipeline parallelism, and discusses the best practices for designing hybrid 4D parallelism involving SP. We achieved 47% MFU on two 8xA800 nodes using SP for the LLAMA3-8B model training using sequence length 208K. Our code is publicly available at https://github.com/feifeibear/long-context-attention.

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

↑