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

LoongTrain:基于头-上下文并行性的长序列LLM高效训练

LoongTrain: Efficient Training of Long-Sequence LLMs with Head-Context Parallelism

Diandian Gu, Peng Sun, Qinghao Hu, Ting Huang, Xun Chen, Yingtong Xiong, Guoteng Wang, Qiaoling Chen, Shangchun Zhao, Jiarui Fang, Yonggang Wen, Tianwei Zhang, Xin Jin, Xuanzhe Liu

AI总结:

提出LoongTrain系统,通过2D-Attention机制结合头并行与上下文并行,并引入Double-Ring-Attention等技术,解决了长序列LLM训练的可扩展性与效率问题,训练速度及MFU显著优于现有基线。

摘要:

使用长序列高效训练LLM非常重要,但面临着巨大的计算和内存需求挑战。目前已提出序列并行性来解决这些问题,但现有方法在可扩展性或效率上存在不足。我们提出了LoongTrain,一种能够大规模高效训练长序列LLM的新系统。LoongTrain的核心是2D-Attention机制,该机制结合了头并行和上下文并行技术,在保持效率的同时打破可扩展性限制。我们引入了Double-Ring-Attention并分析了设备放置策略的性能以进一步加速训练。我们利用混合ZeRO和Selective Checkpoint++技术实现了LoongTrain。实验结果表明,LoongTrain在端到端训练速度和可扩展性上均优于DeepSpeed-Ulysses和Megatron Context Parallelism等最先进基线,并将模型FLOPs利用率(MFU)提升至2.88倍。

英文摘要:

Efficiently training LLMs with long sequences is important yet challenged by the massive computation and memory requirements. Sequence parallelism has been proposed to tackle these problems, but existing methods suffer from scalability or efficiency issues. We propose LoongTrain, a novel system to efficiently train LLMs with long sequences at scale. The core of LoongTrain is the 2D-Attention mechanism, which combines both head-parallel and context-parallel techniques to break the scalability constraints while maintaining efficiency. We introduce Double-Ring-Attention and analyze the performance of device placement strategies to further speed up training. We implement LoongTrain with the hybrid ZeRO and Selective Checkpoint++ techniques. Experiment results show that LoongTrain outperforms state-of-the-art baselines, i.e., DeepSpeed-Ulysses and Megatron Context Parallelism, in both end-to-end training speed and scalability, and improves Model FLOPs Utilization (MFU) by up to 2.88x.

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

↑