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

深度学习的大批量优化:76分钟内训练BERT

Large Batch Optimization for Deep Learning: Training BERT in 76 minutes

Google Brain(谷歌大脑);Google(谷歌);UC Berkeley(加州大学伯克利分校);UCLA(加州大学洛杉矶分校)

Yang You, Jing Li, Sashank Reddi, Jonathan Hseu, Sanjiv Kumar, Srinadh Bhojanapalli, Xiaodan Song, James Demmel, Kurt Keutzer, Cho-Jui Hsieh

摘要:

在海量数据集上训练大型深度神经网络在计算上非常具有挑战性。最近,人们对使用大批量随机优化方法来解决这个问题的兴趣激增。在这一研究领域最突出的算法是LARS,它通过采用分层自适应学习率,在几分钟内在ImageNet上训练ResNet。然而,LARS对于像BERT这样的注意力模型表现不佳,这表明它的性能增益在不同任务之间并不一致。在本文中,我们首先研究了一种原则性的分层自适应策略,以加速使用大型小批量的深度神经网络的训练。使用这种策略,我们开发了一种新的分层自适应大批量优化技术,称为LAMB,然后我们提供LAMB以及LARS的收敛性分析,显示收敛到一个固定点在一般的非凸设置。我们的实证结果证明了LAMB在各种任务(如BERT和ResNet-50训练)中的卓越性能,并且几乎没有超参数调整。特别是,对于BERT训练,我们的优化器可以使用32868的超大批量,而不会降低性能。通过将批量大小增加到TPUv 3 Pod的内存限制,BERT训练时间可以从3天缩短到76分钟(表1)。LAMB实现可在https://github.com/tensorflow/addons/blob/master/tensorflow_addons/optimizers/lamb.py上获得

英文摘要:

Training large deep neural networks on massive datasets is computationally very challenging. There has been recent surge in interest in using large batch stochastic optimization methods to tackle this issue. The most prominent algorithm in this line of research is LARS, which by employing layerwise adaptive learning rates trains ResNet on ImageNet in a few minutes. However, LARS performs poorly for attention models like BERT, indicating that its performance gains are not consistent across tasks. In this paper, we first study a principled layerwise adaptation strategy to accelerate training of deep neural networks using large mini-batches. Using this strategy, we develop a new layerwise adaptive large batch optimization technique called LAMB; we then provide convergence analysis of LAMB as well as LARS, showing convergence to a stationary point in general nonconvex settings. Our empirical results demonstrate the superior performance of LAMB across various tasks such as BERT and ResNet-50 training with very little hyperparameter tuning. In particular, for BERT training, our optimizer enables use of very large batch sizes of 32868 without any degradation of performance. By increasing the batch size to the memory limit of a TPUv3 Pod, BERT training time can be reduced from 3 days to just 76 minutes (Table 1). The LAMB implementation is available at https://github.com/tensorflow/addons/blob/master/tensorflow_addons/optimizers/lamb.py

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

↑