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

论分布式训练的性能与内存占用:一项针对 Transformers 的实证研究

On the Performance and Memory Footprint of Distributed Training: An Empirical Study on Transformers

Zhengxian Lu, Fangyu Wang, Zhiwei Xu, Fei Yang, Tao Li

AI总结:

本文针对 Transformer 分布式训练,提出兼顾架构、并行策略与计算内存开销的分析框架,并通过理论与实验比较证明流水线并行的优势及划分、通信因素的影响。

摘要:

Transformer 模型已成为应对众多跨学科挑战的有效方案。然而,Transformer 架构的部署受到其巨大计算与内存需求的严重阻碍,因此必须依赖先进的高效分布式训练方法。已有研究探讨了分布式训练相关的性能瓶颈,旨在揭示这些瓶颈并提出优化方向。但此类分析往往忽视了 Transformer 模型特有的三个方面:专用架构、对各种分布式策略的依赖,以及平衡计算与内存开销的需求。本文旨在弥补这一空白,结合理论分析与实证研究,全面考察 Transformer 模型分布式训练中固有的性能瓶颈。我们提出了一个针对 Transformers 这些独特方面定制的分析框架,以支持对模型架构、分布式策略和资源消耗的整体评估。基于该分析框架,我们对理论性能进行了比较分析,并进一步系统探索各种分布式训练策略在真实场景中的表现。大多数实验结果都可以由该分析框架得出的分析结果很好地解释。值得注意的是,我们的发现表明,对于 Transformer 模型,流水线并行相比数据并行具有优势。此外,我们还揭示了一些意外结果,例如流水线并行中模型划分不佳可能导致总内存开销增加。同时,我们强调了通信块大小和等待时间对于进一步提升性能的重要性。

英文摘要:

Transformer models have emerged as potent solutions to a wide array of multidisciplinary challenges. The deployment of Transformer architectures is significantly hindered by their extensive computational and memory requirements, necessitating the reliance on advanced efficient distributed training methodologies. Prior research has delved into the performance bottlenecks associated with distributed training, aiming to unravel these bottlenecks and suggest optimization directions. However, such analyses often overlook three aspects unique to Transformer models: the specialized architecture, the dependency on various distributed strategies, and the requirement to balance computational and memory overhead. This paper aims to bridge this gap by offering a comprehensive examination of the performance bottlenecks inherent in distributed training of Transformer models, leveraging both theoretical analysis and empirical investigation. We propose an analytical framework tailored to these unique aspects of Transformers, facilitating a holistic evaluation of model architectures, distributed strategies, and resource consumption. Based on this analytical framework, we conduct a comparative analysis of theoretical performances and further systematically explore how various distributed training strategies fare in real-world scenarios. Most of the experimental results can be well explained by the analytical outcomes derived from the analytical framework. Notably, our findings suggest an advantage of pipeline parallelism over data parallelism for Transformer models. Moreover, we shed light on some unexpected outcomes, such as the potential for increased total memory overhead due to suboptimal model partitioning within pipeline parallelism. Additionally, we underscore the significance of communication block size and waiting time to further enhance performance.

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

↑