We introduce Gradient Agreement Filtering (GAF) to improve on gradient averaging in distributed deep learning optimization. Traditional distributed data-parallel stochastic gradient descent involves averaging gradients of microbatches to calculate a macrobatch gradient that is then used to update model parameters. We find that gradients across microbatches are often orthogonal or negatively correlated, especially in late stages of training, which leads to memorization of the training set, reducing generalization. In this paper, we introduce a simple, computationally effective way to reduce gradient variance by computing the cosine distance between micro-gradients during training and filtering out conflicting updates prior to averaging. We improve validation accuracy with significantly smaller microbatch sizes. We also show this reduces memorizing noisy labels. We demonstrate the effectiveness of this technique on standard image classification benchmarks including CIFAR-100 and CIFAR-100N-Fine. We show this technique consistently outperforms validation accuracy, in some cases by up to 18.2\% compared to traditional training approaches while reducing the computation required nearly an order of magnitude because we can now rely on smaller microbatch sizes without destabilizing training.
Experiments on Parallel Training of Deep Neural Network using Model Averaging
International Computer Science Institute(国际计算机科学研究所);University of California, Berkeley(加州大学伯克利分校);Nanyang Technological University(南洋理工大学)
在这项工作中,我们将模型平均应用于深度神经网络(DNN)的并行训练。以模型平均化的方式进行模型化。数据被分区并分发到不同的节点以进行本地模型更新,并且每隔几个小批进行跨节点的模型平均。我们使用多个GPU进行数据并行化,并使用消息传递接口(MPI)进行节点之间的通信,这使我们能够频繁地执行模型平均,而不会在通信上浪费太多时间。研究了自然梯度随机梯度下降(NG-SGD)和受限玻尔兹曼机(RBM)预训练在模型平均框架下并行训练的有效性,并根据不同的学习率调度、平均频率和小批量大小探索了最佳设置。结果表明,NG-SGD和RBM预训练有利于基于参数平均的模型训练。在300 h Switchboard数据集上,使用16个GPU实现了9.3倍的加速,使用32个GPU实现了17倍的加速,解码精度损失有限。
Parallel Restarted SGD with Faster Convergence and Less Communication: Demystifying Why Model Averaging Works for Deep Learning
Alibaba Group (U.S.) Inc.(阿里巴巴集团(美国)有限公司)
在深度神经网络的分布式训练中,并行小批量SGD被广泛用于通过使用多个工人来加速训练过程。它使用多个工人并行采样局部随机梯度,在单个服务器中聚合所有梯度以获得平均值,并使用平均梯度的SGD更新来更新每个工人的局部模型。理想情况下,与单个工作者上的SGD相比,并行小批量SGD可以实现训练时间的线性加速(相对于工作者的数量)。然而,这种线性可扩展性在实践中受到越来越多的工人参与的梯度通信需求的限制。模型平均,定期对在并行工作者上训练的单个模型进行平均,是自Zinkevich et al. 2010以来用于深度神经网络分布式训练的另一种常见做法(McDonald,Hall,and Mann 2010)。与并行小批量SGD相比,模型平均的通信开销显著降低。令人印象深刻的是,大量的实验工作已经证明,模型平均仍然可以实现良好的加速的训练时间,只要平均间隔是仔细控制。然而,为什么这样一个简单的启发式如此有效,在理论上仍然是一个谜。本文提供了一个彻底和严格的理论研究,为什么模型平均可以工作,以及并行小批量SGD显着减少通信开销。
Hierarchical Weight Averaging for Deep Neural Networks
The Chinese University of Hong Kong, Shenzhen(香港中文大学(深圳));Pengcheng Laboratory(鹏城实验室);Institute of High Performance Computing, Agency for Science, Technology and Research(新加坡科技研究局高性能计算研究所)
Trainable Weight Averaging: Accelerating Training and Improving Generalization
Shanghai Jiao Tong University(上海交通大学);KU Leuven(鲁汶大学);National Taiwan University(台湾大学);Mohamed bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学)