打破MLPerf训练:优化BERT的案例研究
Breaking MLPerf Training: A Case Study on Optimizing BERT
AI总结:
本研究提出基于数据集分层预排序和桶式梯度裁剪的优化方法,结合ADAM优化器,在1,024个A100 GPU上实现25.1秒的MLPerf BERT训练,显著提升分布式训练性能。
摘要:
加速大规模分布式训练具有挑战性,因为它需要改进训练的各个组成部分,包括负载均衡、通信、优化器等。我们提出了针对BERT模型快速大规模训练的新方法,这些方法分别改善每个组成部分,从而将BERT训练性能提升到新的水平。在分布式BERT训练中,负载均衡至关重要,因为其训练数据集的特点是样本长度各异。通信成本与分布式训练的规模成正比,需要通过有用的计算来隐藏。此外,优化器(如ADAM、LAMB等)需要在大规模分布式训练的背景下仔细重新评估。我们提出了两个新想法:(1)基于数据集分层的本地预排序以实现负载均衡,以及(2)在allreduce之前进行桶式梯度裁剪,这使我们能够从梯度计算与同步的重叠以及allreduce前梯度裁剪的快速训练中受益。我们还通过超参数优化重新评估了现有优化器,并利用ADAM,这也通过比现有方法更大的批次促进了快速训练。我们提出的方法综合起来,在1,024个NVIDIA A100 GPU上实现了25.1(22.3)秒的最快MLPerf BERT训练,比MLPerf v1.1(v2.0)的其他前两名(一名)提交快1.33倍(1.13倍)和1.57倍。我们的实现和评估结果可在MLPerf v1.1~v2.1中获得。
英文摘要:
Speeding up the large-scale distributed training is challenging in that it requires improving various components of training including load balancing, communication, optimizers, etc. We present novel approaches for fast large-scale training of BERT model which individually ameliorates each component thereby leading to a new level of BERT training performance. Load balancing is imperative in distributed BERT training since its training datasets are characterized by samples with various lengths. Communication cost, which is proportional to the scale of distributed training, needs to be hidden by useful computation. In addition, the optimizers, e.g., ADAM, LAMB, etc., need to be carefully re-evaluated in the context of large-scale distributed training. We propose two new ideas, (1) local presorting based on dataset stratification for load balancing and (2) bucket-wise gradient clipping before allreduce which allows us to benefit from the overlap of gradient computation and synchronization as well as the fast training of gradient clipping before allreduce. We also re-evaluate existing optimizers via hyperparameter optimization and utilize ADAM, which also contributes to fast training via larger batches than existing methods. Our proposed methods, all combined, give the fastest MLPerf BERT training of 25.1 (22.3) seconds on 1,024 NVIDIA A100 GPUs, which is 1.33x (1.13x) and 1.57x faster than the other top two (one) submissions to MLPerf v1.1 (v2.0). Our implementation and evaluation results are available at MLPerf v1.1~v2.1.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。