High network communication cost for synchronizing gradients and parameters is the well-known bottleneck of distributed training. In this work, we propose TernGrad that uses ternary gradients to accelerate distributed deep learning in data parallelism. Our approach requires only three numerical levels {−1, 0, 1}, which can aggressively reduce the communication time. We mathematically prove the convergence of TernGrad under the assumption of a bound on gradients. Guided by the bound, we propose layer-wise ternarizing and gradient clipping to improve its convergence. Our experiments show that applying TernGrad on AlexNet doesn't incur any accuracy loss and can even improve accuracy. The accuracy loss of GoogLeNet induced by TernGrad is less than 2% on average. Finally, a performance model is proposed to study the scalability of TernGrad. Experiments show significant speed gains for various deep neural networks. Our source code is available 1 .
translated by 谷歌翻译
深度学习在广泛的AI应用方面取得了有希望的结果。较大的数据集和模型一致地产生更好的性能。但是,我们一般花费更长的培训时间,以更多的计算和沟通。在本调查中,我们的目标是在模型精度和模型效率方面提供关于大规模深度学习优化的清晰草图。我们调查最常用于优化的算法,详细阐述了大批量培训中出现的泛化差距的可辩论主题,并审查了解决通信开销并减少内存足迹的SOTA策略。
translated by 谷歌翻译
现代深度学习模型通常在分布式机器集合中并行培训,以减少训练时间。在这种情况下,机器之间模型更新的通信变成了一个重要的性能瓶颈,并且已经提出了各种有损的压缩技术来减轻此问题。在这项工作中,我们介绍了一种新的,简单但理论上和实践上有效的压缩技术:自然压缩(NC)。我们的技术分别应用于要进行压缩的更新向量的所有条目,并通过随机舍入到两个的(负或正)两种功能,可以通过忽略Mantissa来以“自然”方式计算。我们表明,与没有压缩相比,NC将压缩向量的第二刻增加不超过微小因子$ \ frac {9} {8} $,这意味着NC对流行训练算法的收敛速度的影响,例如分布式SGD,可以忽略不计。但是,NC启用的通信节省是可观的,导致$ 3 $ - $ 4 \ times $ $改善整体理论运行时间。对于需要更具侵略性压缩的应用,我们将NC推广到自然抖动,我们证明这比常见的随机抖动技术要好得多。我们的压缩操作员可以自行使用,也可以与现有操作员结合使用,从而产生更具侵略性的结合效果,并在理论和实践中提供新的最先进。
translated by 谷歌翻译
数据爆炸和模型尺寸的增加推动了大规模机器学习的显着进步,但也使模型训练时间耗时和模型存储变得困难。为了解决具有较高计算效率和设备限制的分布式模型培训设置中的上述问题,仍然存在两个主要困难。一方面,交换信息的沟通成本,例如,不同工人之间的随机梯度是分布式培训效率的关键瓶颈。另一方面,较少的参数模型容易用于存储和通信,但是损坏模型性能的风险。为了同时平衡通信成本,模型容量和模型性能,我们提出了量化的复合镜下降自适应亚基(QCMD Adagrad),并量化正规化双平均平均自适应亚级别(QRDA ADAGRAD)进行分布式培训。具体来说,我们探讨了梯度量化和稀疏模型的组合,以降低分布式培训中每次迭代的通信成本。构建了基于量化梯度的自适应学习率矩阵,以在沟通成本,准确性和模型稀疏性之间达到平衡。此外,从理论上讲,我们发现大量化误差会引起额外的噪声,从而影响模型的收敛性和稀疏性。因此,在QCMD Adagrad和QRDA Adagrad中采用了具有相对较小误差的阈值量化策略,以提高信噪比并保留模型的稀疏性。理论分析和经验结果都证明了所提出的算法的功效和效率。
translated by 谷歌翻译
二阶优化方法,尤其是D-KFAC(分布式Kronecker近似曲率)算法,在加速GPU簇上加速了深神经网络(DNN)训练方面已获得了吸引力。但是,现有的D-KFAC算法需要计算和传达大量二阶信息,即Kronecker因素(KFS),在预处理梯度之前,导致大量计算和通信开销以及高存储器足迹。在本文中,我们提出了DP-KFAC,这是一种新颖的分布式预处理方案,该方案将不同DNN层的KF构造任务分配给不同的工人。 DP-KFAC不仅保留了现有D-KFAC算法的收敛性属性,而且还可以带来三个好处:减少计算开销在构造KFS中,没有KFS的通信和低内存足迹。在64-GPU群集上进行的广泛实验表明,DP-KFAC将开销的计算开销降低了1.55 x-1.65x,通信成本降低2.79x-3.15x,并且内存足迹在每秒二阶更新中降低1.14x-1.47 x与最先进的D-KFAC方法相比。
translated by 谷歌翻译
Training large neural networks requires distributing learning across multiple workers, where the cost of communicating gradients can be a significant bottleneck. SIGNSGD alleviates this problem by transmitting just the sign of each minibatch stochastic gradient. We prove that it can get the best of both worlds: compressed gradients and SGD-level convergence rate. The relative 1 / 2 geometry of gradients, noise and curvature informs whether SIGNSGD or SGD is theoretically better suited to a particular problem. On the practical side we find that the momentum counterpart of SIGNSGD is able to match the accuracy and convergence speed of ADAM on deep Imagenet models. We extend our theory to the distributed setting, where the parameter server uses majority vote to aggregate gradient signs from each worker enabling 1-bit compression of worker-server communication in both directions. Using a theorem by Gauss (1823) we prove that majority vote can achieve the same reduction in variance as full precision distributed SGD. Thus, there is great promise for sign-based optimisation schemes to achieve fast communication and fast convergence. Code to reproduce experiments is to be found at https://github.com/jxbz/signSGD.
translated by 谷歌翻译
Parallel implementations of stochastic gradient descent (SGD) have received significant research attention, thanks to its excellent scalability properties. A fundamental barrier when parallelizing SGD is the high bandwidth cost of communicating gradient updates between nodes; consequently, several lossy compresion heuristics have been proposed, by which nodes only communicate quantized gradients. Although effective in practice, these heuristics do not always converge. In this paper, we propose Quantized SGD (QSGD), a family of compression schemes with convergence guarantees and good practical performance. QSGD allows the user to smoothly trade off communication bandwidth and convergence time: nodes can adjust the number of bits sent per iteration, at the cost of possibly higher variance. We show that this trade-off is inherent, in the sense that improving it past some threshold would violate information-theoretic lower bounds. QSGD guarantees convergence for convex and non-convex objectives, under asynchrony, and can be extended to stochastic variance-reduced techniques. When applied to training deep neural networks for image classification and automated speech recognition, QSGD leads to significant reductions in end-to-end training time. For instance, on 16GPUs, we can train the ResNet-152 network to full accuracy on ImageNet 1.8× faster than the full-precision variant. time to the same target accuracy is 2.7×. Further, even computationally-heavy architectures such as Inception and ResNet can benefit from the reduction in communication: on 16GPUs, QSGD reduces the end-to-end convergence time of ResNet152 by approximately 2×. Networks trained with QSGD can converge to virtually the same accuracy as full-precision variants, and that gradient quantization may even slightly improve accuracy in some settings. Related Work. One line of related research studies the communication complexity of convex optimization. In particular, [40] studied two-processor convex minimization in the same model, provided a lower bound of Ω(n(log n + log(1/ ))) bits on the communication cost of n-dimensional convex problems, and proposed a non-stochastic algorithm for strongly convex problems, whose communication cost is within a log factor of the lower bound. By contrast, our focus is on stochastic gradient methods. Recent work [5] focused on round complexity lower bounds on the number of communication rounds necessary for convex learning.Buckwild! [10] was the first to consider the convergence guarantees of low-precision SGD. It gave upper bounds on the error probability of SGD, assuming unbiased stochastic quantization, convexity, and gradient sparsity, and showed significant speedup when solving convex problems on CPUs. QSGD refines these results by focusing on the trade-off between communication and convergence. We view quantization as an independent source of variance for SGD, which allows us to employ standard convergence results [7]. The main differences from Buckw
translated by 谷歌翻译
Large-scale distributed training requires significant communication bandwidth for gradient exchange that limits the scalability of multi-node training, and requires expensive high-bandwidth network infrastructure. The situation gets even worse with distributed training on mobile devices (federated learning), which suffers from higher latency, lower throughput, and intermittent poor connections. In this paper, we find 99.9% of the gradient exchange in distributed SGD are redundant, and propose Deep Gradient Compression (DGC) to greatly reduce the communication bandwidth. To preserve accuracy during this compression, DGC employs four methods: momentum correction, local gradient clipping, momentum factor masking, and warm-up training. We have applied Deep Gradient Compression to image classification, speech recognition, and language modeling with multiple datasets including Cifar10, ImageNet, Penn Treebank, and Librispeech Corpus. On these scenarios, Deep Gradient Compression achieves a gradient compression ratio from 270× to 600× without losing accuracy, cutting the gradient size of ResNet-50 from 97MB to 0.35MB, and for DeepSpeech from 488MB to 0.74MB. Deep gradient compression enables large-scale distributed training on inexpensive commodity 1Gbps Ethernet and facilitates distributed training on mobile. The code is available at: https://github.com/synxlin/ deep-gradient-compression.
translated by 谷歌翻译
培训广泛和深度神经网络(DNN)需要大量的存储资源,例如内存,因为在转发传播期间必须在存储器中保存中间激活数据,然后恢复以便向后传播。然而,由于硬件设计约束,诸如GPU之类的最先进的加速器(例如GPU)仅配备了非常有限的存储容量,这显着限制了在训练大规模DNN时的最大批量大小和性能加速。传统的记忆保存技术均受性能开销或受限互连带宽或特定互连技术的约束。在本文中,我们提出了一种新颖的记忆高效的CNN训练框架(称为Comet),利用错误界限的损耗压缩来显着降低训练的内存要求,以允许培训更大的模型或加速培训。不同于采用基于图像的有损压缩机(例如JPEG)的最先进的解决方案来压缩激活数据,我们的框架故意采用严格的错误控制机制来采用错误界限的损耗压缩。具体而言,我们对从改变的激活数据传播到梯度的压缩误差传播的理论分析,并经验探讨改变梯度对训练过程的影响。基于这些分析,我们优化了误报的损耗压缩,并提出了一种用于激活数据压缩的自适应误差控制方案。我们评估我们对最先进的解决方案的设计,其中包含五个广泛采用的CNN和Imagenet DataSet。实验表明,我们所提出的框架可以在基线训练中显着降低13.5倍,并分别在另一个最先进的基于压缩框架上的1.8倍,几乎没有准确性损失。
translated by 谷歌翻译
扩展培训工作负载的能力是深度学习的关键性能推动者之一。主要缩放方法是基于数据并行GPU的培训,该培训已经被硬件和软件支持高效地支持高效的GPU通信,特别是通过带宽过度曝光。此支持以A价格出现:相对于其“消费者级”对应物,“云级”服务器之间存在幅度成本差异,但相对于其“消费者级”对应物,虽然服务器级和消费者级GPU可以具有类似的计算信封。在本文中,我们调查了昂贵的硬件过度控制方法是否可以通过算法和系统设计所涵盖,并提出称为CGX的框架,为通信压缩提供有效的软件支持。我们认为,在没有硬件支持的情况下,该框架能够从消费者级多GPU系统中删除通信瓶颈:在没有硬件支持的情况下:在培训现代模型和全部准确性方面时,我们的框架可以在商品上进行2-3倍的自动加速系统使用8个消费者级NVIDIA RTX 3090 GPU,并使其超越NVIDIA DGX-1服务器的吞吐量,其具有类似的峰值闪光,但是从带宽过度提供的益处。
translated by 谷歌翻译
当前的深度神经网络(DNN)容易受到对抗性攻击的影响,在这种攻击中,对输入的对抗扰动可以改变或操纵分类。为了防御此类攻击,已证明一种有效而流行的方法,称为对抗性训练(AT),可通过一种最小的最大强大的训练方法来减轻对抗攻击的负面影响。尽管有效,但尚不清楚它是否可以成功地适应分布式学习环境。分布式优化对多台机器的功能使我们能够扩展大型型号和数据集的强大训练。我们提出了这一点,我们提出了分布式的对抗训练(DAT),这是在多台机器上实施的大批量对抗训练框架。我们证明DAT是一般的,它支持对标记和未标记的数据,多种类型的攻击生成方法以及梯度压缩操作的培训。从理论上讲,我们在优化理论中的标准条件下提供了DAT与一般非凸面设置中一阶固定点的收敛速率。从经验上讲,我们证明DAT要么匹配或胜过最先进的稳健精度,并实现了优美的训练速度(例如,在ImageNet下的Resnet-50上)。代码可在https://github.com/dat-2022/dat上找到。
translated by 谷歌翻译
随着大数据的快速增长,分布式机器学习(ML)已广泛应用于培训大型模型。随机梯度下降(SGD)可以说是ML的Workhorse算法。 SGD培训的分布式ML型号涉及大量的梯度通信,这限制了分布式ML的可扩展性。因此,压缩梯度以减少通信是重要的。在本文中,我们提出了FastSGD,一种用于分布式ML的快速压缩的SGD框架。为了以低成本实现高压缩比,FastSGD表示梯度作为键值对,并在线性时间复杂度压缩梯度键和值。对于梯度值压缩,FASTSGD首先使用互焦数映射器将原始值转换为互焦值,然后,它利用对数量化来进一步将互焦值减少到小整数。最后,FastSGD通过给定阈值过滤减少梯度整数。对于渐变键压缩,FastSGD提供了一种自适应细粒度的Δ编码方法,用于存储具有更少位的渐变键。实际ML模型和数据集的广泛实验证明,与最先进的方法相比,FastSGD实现了高达4个级别的压缩比,并加速了高达8倍的收敛时间。
translated by 谷歌翻译
深度学习领域目睹了对极端计算和内存密集型神经网络的显着转变。这些较新的较大模型使研究人员能够推进各种领域的最先进的工具。这种现象刺激了在更多的硬件加速器上产生了针对神经网络的分布式训练的算法。在本文中,我们讨论并比较了当前的最先进的框架,以实现大规模的分布式深度学习。首先,我们调查分布式学习中的当前实践,并确定所使用的不同类型的并行性。然后,我们提出了对大型图像和语言培训任务的性能进行了经验结果。此外,我们解决了他们的统计效率和内存消耗行为。根据我们的结果,我们讨论了阻碍性能的每个框架的算法和实现部分。
translated by 谷歌翻译
SOTA decentralized SGD algorithms can overcome the bandwidth bottleneck at the parameter server by using communication collectives like Ring All-Reduce for synchronization. While the parameter updates in distributed SGD may happen asynchronously there is still a synchronization barrier to make sure that the local training epoch at every learner is complete before the learners can advance to the next epoch. The delays in waiting for the slowest learners(stragglers) remain to be a problem in the synchronization steps of these state-of-the-art decentralized frameworks. In this paper, we propose the (de)centralized Non-blocking SGD (Non-blocking SGD) which can address the straggler problem in a heterogeneous environment. The main idea of Non-blocking SGD is to split the original batch into mini-batches, then accumulate the gradients and update the model based on finished mini-batches. The Non-blocking idea can be implemented using decentralized algorithms including Ring All-reduce, D-PSGD, and MATCHA to solve the straggler problem. Moreover, using gradient accumulation to update the model also guarantees convergence and avoids gradient staleness. Run-time analysis with random straggler delays and computational efficiency/throughput of devices is also presented to show the advantage of Non-blocking SGD. Experiments on a suite of datasets and deep learning networks validate the theoretical analyses and demonstrate that Non-blocking SGD speeds up the training and fastens the convergence. Compared with the state-of-the-art decentralized asynchronous algorithms like D-PSGD and MACHA, Non-blocking SGD takes up to 2x fewer time to reach the same training loss in a heterogeneous environment.
translated by 谷歌翻译
在联合学习(FL)的新兴范式中,大量客户端(例如移动设备)用于在各自的数据上训练可能的高维模型。由于移动设备的带宽低,分散的优化方法需要将计算负担从那些客户端转移到计算服务器,同时保留隐私和合理的通信成本。在本文中,我们专注于深度,如多层神经网络的培训,在FL设置下。我们提供了一种基于本地模型的层状和维度更新的新型联合学习方法,减轻了非凸起和手头优化任务的多层性质的新型联合学习方法。我们为Fed-Lamb提供了一种彻底的有限时间收敛性分析,表征其渐变减少的速度有多速度。我们在IID和非IID设置下提供实验结果,不仅可以证实我们的理论,而且与最先进的方法相比,我们的方法的速度更快。
translated by 谷歌翻译
Mini-batch stochastic gradient descent (SGD) is state of the art in large scale distributed training. The scheme can reach a linear speedup with respect to the number of workers, but this is rarely seen in practice as the scheme often suffers from large network delays and bandwidth limits. To overcome this communication bottleneck recent works propose to reduce the communication frequency. An algorithm of this type is local SGD that runs SGD independently in parallel on different workers and averages the sequences only once in a while. This scheme shows promising results in practice, but eluded thorough theoretical analysis.We prove concise convergence rates for local SGD on convex problems and show that it converges at the same rate as mini-batch SGD in terms of number of evaluated gradients, that is, the scheme achieves linear speedup in the number of workers and mini-batch size. The number of communication rounds can be reduced up to a factor of T 1/2 -where T denotes the number of total steps-compared to mini-batch SGD. This also holds for asynchronous implementations.Local SGD can also be used for large scale training of deep learning models. The results shown here aim serving as a guideline to further explore the theoretical and practical aspects of local SGD in these applications.
translated by 谷歌翻译
亚当是训练深神经网络的最具影响力的自适应随机算法之一,即使在简单的凸面设置中,它也被指出是不同的。许多尝试,例如降低自适应学习率,采用较大的批量大小,结合了时间去相关技术,寻求类似的替代物,\ textit {etc。},以促进Adam-type算法融合。与现有方法相反,我们引入了另一种易于检查的替代条件,这仅取决于基础学习率的参数和历史二阶时刻的组合,以确保通用ADAM的全球融合以解决大型融合。缩放非凸随机优化。这种观察结果以及这种足够的条件,对亚当的差异产生了更深刻的解释。另一方面,在实践中,无需任何理论保证,广泛使用了迷你ADAM和分布式ADAM。我们进一步分析了分布式系统中的批次大小或节点的数量如何影响亚当的收敛性,从理论上讲,这表明迷你批次和分布式亚当可以通过使用较大的迷你批量或较大的大小来线性地加速节点的数量。最后,我们应用了通用的Adam和Mini Batch Adam,具有足够条件来求解反例并在各种真实世界数据集上训练多个神经网络。实验结果完全符合我们的理论分析。
translated by 谷歌翻译
深度学习在许多应用中取得了巨大成功。然而,其在实践中的部署已经受到两个问题的困扰:由于通常在地理上分布的大量数据传输,必须集中聚合的数据的隐私。解决这两个问题都是具有挑战性的,并且大多数现有工程无法提供有效的解决方案。在本文中,我们开发FEDPC,是隐私保存和沟通效率的联邦深度学习框架。该框架允许在多个私有数据集中学习模型,同时不显示培训数据的任何信息,即使是中间数据。该框架还可以最大限度地减少更新模型的数据量。我们正式证明培训FEDPC及其隐私保留财产时学习模型的融合。我们对大量实验进行了广泛的实验,以评估FEDPC的性能,以近似到上限的性能(培训集中时)和通信开销。结果表明,当数据分配到10个计算节点时,FEDPC在8.5 \%$ 8.5 \%$ 8.5 \%$ 8.5 \%$ 8.5 \%$ 8.5 \%$ 8.5 \%。与现有工程相比,FEDPC还将通信开销降低至42.20±20美元。
translated by 谷歌翻译
Distributed training of massive machine learning models, in particular deep neural networks, via Stochastic Gradient Descent (SGD) is becoming commonplace. Several families of communication-reduction methods, such as quantization, largebatch methods, and gradient sparsification, have been proposed. To date, gradient sparsification methods-where each node sorts gradients by magnitude, and only communicates a subset of the components, accumulating the rest locally-are known to yield some of the largest practical gains. Such methods can reduce the amount of communication per step by up to three orders of magnitude, while preserving model accuracy. Yet, this family of methods currently has no theoretical justification. This is the question we address in this paper. We prove that, under analytic assumptions, sparsifying gradients by magnitude with local error correction provides convergence guarantees, for both convex and non-convex smooth objectives, for data-parallel SGD. The main insight is that sparsification methods implicitly maintain bounds on the maximum impact of stale updates, thanks to selection by magnitude. Our analysis and empirical validation also reveal that these methods do require analytical conditions to converge well, justifying existing heuristics.
translated by 谷歌翻译
由于培训数据集的大小爆炸,分布式学习近年来受到了日益增长的兴趣。其中一个主要瓶颈是中央服务器和本地工人之间的沟通成本。虽然已经证明错误反馈压缩以通过随机梯度下降(SGD)降低通信成本,但在培训大规模机器学习方面广泛用于培训的通信有效的适应性梯度方法楷模。在本文中,我们提出了一种新的通信 - 压缩AMSGRAD,用于分布式非透明的优化问题,可提供有效的效率。我们所提出的分布式学习框架具有有效的渐变压缩策略和工人侧模型更新设计。我们证明所提出的通信有效的分布式自适应梯度方法会聚到具有与随机非凸化优化设置中的未压缩的vanilla amsgrad相同的迭代复杂度的一阶静止点。关于各种基准备份我们理论的实验。
translated by 谷歌翻译