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

超长序列分布式Transformer

Ultra-Long Sequence Distributed Transformer

Oak Ridge National Laboratory(橡树岭国家实验室);Agency for Science, Technology and Research(新加坡科技研究局)

Xiao Wang, Isaac Lyngaas, Aristeidis Tsaris, Peng Chen, Sajal Dash, Mayanka Chandra Shekar, Tao Luo, Hong-Jun Yoon, Mohamed Wahib, John Gouley

AI总结:

针对传统Transformer长序列训练计算内存需求高的问题,提出LSS Transformer分布式训练方法,通过序列分段、融合通信与双梯度平均技术,实现了更优的速度、内存效率与超大规模扩展能力。

摘要:

在长序列上训练的Transformer模型通常比短序列模型取得更高的准确率。遗憾的是,由于计算和内存需求过高,传统Transformer难以应对长序列训练。现有的长序列训练方法在速度提升和内存缩减方面效果有限,还可能损害准确率。本文提出一种新颖高效的分布式训练方法——长短序列Transformer(LSS Transformer),用于长序列Transformer的训练。该方法将长序列划分为多个片段分配到不同GPU,每个GPU为其负责的片段计算部分自注意力;随后采用融合通信与新型双梯度平均技术,无需聚合部分自注意力,最大限度降低通信开销。我们在Wikipedia enwik8数据集上对比了LSS Transformer与当前最优的Nvidia序列并行的性能。结果显示,在144块Nvidia V100 GPU上,所提方法的实现速度比当前最优序列并行快5.6倍,内存效率高10.2倍。此外,该算法可在3456块GPU上扩展至50112的极端序列长度,实现161%的超线性并行效率与32 petaflops的吞吐量。

英文摘要:

Transformer models trained on long sequences often achieve higher accuracy than short sequences. Unfortunately, conventional transformers struggle with long sequence training due to the overwhelming computation and memory requirements. Existing methods for long sequence training offer limited speedup and memory reduction, and may compromise accuracy. This paper presents a novel and efficient distributed training method, the Long Short-Sequence Transformer (LSS Transformer), for training transformer with long sequences. It distributes a long sequence into segments among GPUs, with each GPU computing a partial self-attention for its segment. Then, it uses a fused communication and a novel double gradient averaging technique to avoid the need to aggregate partial self-attention and minimize communication overhead. We evaluated the performance between LSS Transformer and the state-of-the-art Nvidia sequence parallelism on a Wikipedia enwik8 dataset. Results show that our proposed method lead to 5.6x faster and 10.2x more memory-efficient implementation compared to state-of-the-art sequence parallelism on 144 Nvidia V100 GPUs. Moreover, our algorithm scales to an extreme sequence length of 50,112 at 3,456 GPUs, achieving 161% super-linear parallel efficiency and a throughput of 32 petaflops.

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

↑