arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.08837cs.LGcs.AIcs.DCcs.NEstat.ML
收藏

循环数据并行:实现深度神经网络高效并行的方法

Cyclic Data Parallelism for Efficient Parallelism of Deep Neural Networks

Sorbonne Université(索邦大学);CNRS(法国国家科学研究中心);Flatiron Institute(弗拉蒂伦研究所)

Louis Fournier, Edouard Oyallon

AI总结:

针对现有数据并行方法中内存峰值和梯度通信瓶颈,提出循环数据并行范式,通过顺序执行微批次并统一延迟,实现恒定内存和平衡通信,减少GPU需求,并在CIFAR-10和ImageNet上验证了有效性。

摘要:

训练大型深度学习模型需要并行化技术来扩展规模。在现有的方法(如数据并行或ZeRO-DP)中,数据微批次被并行处理,这产生了两个缺点:存储模型激活值所需的总内存在前向传播结束时达到峰值,并且在后向传播步骤结束时必须同时平均梯度。我们提出了循环数据并行,这是一种新颖的范式,将微批次的执行从同时进行转变为顺序进行,并带有统一的延迟。以轻微的梯度延迟为代价,激活值占用的总内存保持恒定,并且梯度通信在训练步骤中得到平衡。结合模型并行,我们的技术通过跨微批次共享GPU减少了所需的GPU数量。在ZeRO-DP框架内,我们的技术允许使用点对点操作而非集体广播操作来通信模型状态。我们在CIFAR-10和ImageNet数据集上展示了我们方法的优势。

英文摘要:

Training large deep learning models requires parallelization techniques to scale. In existing methods such as Data Parallelism or ZeRO-DP, micro-batches of data are processed in parallel, which creates two drawbacks: the total memory required to store the model's activations peaks at the end of the forward pass, and gradients must be simultaneously averaged at the end of the backpropagation step. We propose Cyclic Data Parallelism, a novel paradigm shifting the execution of the micro-batches from simultaneous to sequential, with a uniform delay. At the cost of a slight gradient delay, the total memory taken by activations is constant, and the gradient communications are balanced during the training step. With Model Parallelism, our technique reduces the number of GPUs needed, by sharing GPUs across micro-batches. Within the ZeRO-DP framework, our technique allows communication of the model states with point-to-point operations rather than a collective broadcast operation. We illustrate the strength of our approach on the CIFAR-10 and ImageNet datasets.

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

↑