深度学习模型的计算复杂性不断增加,使他们在各种云和边缘平台上的培训和部署变得困难。用低位整数算术代替浮点算术是一种有希望的方法,可节省能量,记忆足迹和深度学习模型的延迟。因此,量化引起了近年来研究人员的注意。但是,没有详细研究使用整数数字形成功能齐全的整数训练管道,包括前进,后传播和随机梯度下降。我们的经验和数学结果表明,整数算术足以训练深度学习模型。与最近的建议不同,我们直接切换计算的数字表示。我们的新型训练方法形成了完全整数训练管道,与浮点相比,它不会改变损失和准确性的轨迹,也不需要任何特殊的超参数调整,分配调整或梯度剪辑。我们的实验结果表明,我们提出的方法在各种任务(包括视觉变压器),对象检测和语义分割等多种任务中有效。
translated by 谷歌翻译
基于变压器的模型用于实现各种深度学习任务的最新性能。由于基于变压器的模型具有大量参数,因此在下游任务上进行微调是计算密集型和饥饿的能量。此类型号的自动混合精液FP32/FP16微调以前已用于降低计算资源需求。但是,随着低位整数背面传播的最新进展,有可能进一步减少计算和记忆脚印。在这项工作中,我们探索了一种新颖的整数训练方法,该方法使用整数算术来进行正向传播和梯度计算,对基于变压器的模型中的线性,卷积,层和层和嵌入层的梯度计算。此外,我们研究了各种整数位宽度的效果,以找到基于变压器模型的整数微调所需的最小位宽度。我们使用整数层对流行的下游任务进行了微调和VIT模型。我们表明,16位整数模型与浮点基线性能匹配。将位宽度降低到10,我们观察到0.5平均得分下降。最后,将位宽度的进一步降低到8的平均得分下降为1.7分。
translated by 谷歌翻译
Recurrent neural networks (RNN) are the backbone of many text and speech applications. These architectures are typically made up of several computationally complex components such as; non-linear activation functions, normalization, bi-directional dependence and attention. In order to maintain good accuracy, these components are frequently run using full-precision floating-point computation, making them slow, inefficient and difficult to deploy on edge devices. In addition, the complex nature of these operations makes them challenging to quantize using standard quantization methods without a significant performance drop. We present a quantization-aware training method for obtaining a highly accurate integer-only recurrent neural network (iRNN). Our approach supports layer normalization, attention, and an adaptive piecewise linear (PWL) approximation of activation functions, to serve a wide range of state-of-the-art RNNs. The proposed method enables RNN-based language models to run on edge devices with $2\times$ improvement in runtime, and $4\times$ reduction in model size while maintaining similar accuracy as its full-precision counterpart.
translated by 谷歌翻译
代表低精度的深度神经网络(DNN)是一种有希望的方法来实现有效的加速和记忆力。以前的方法在低精度中培训DNN的方法通常在重量更新期间在高精度中保持重量的重量副本。由于低精度数字系统与学习算法之间的复杂相互作用,直接具有低精度重量的培训导致精度下降。为了解决这个问题,我们开发了一个共同设计的低精度训练框架,被称为LNS-MADAM,我们共同设计了对数号系统(LNS)和乘法权重算法(MADAM)。我们证明了LNS-MADAM在重量更新期间导致低量化误差,即使精度有限,也导致稳定的收敛。我们进一步提出了LNS-MADAM的硬件设计,可以解决实现LNS计算的有效数据路径的实际挑战。我们的实现有效地降低了LNS - 整数转换和部分总和累积所产生的能量开销。实验结果表明,LNS-MADAM为全精密对应物达到了可比的准确性,只有8位对流行的计算机视觉和自然语言任务。与全精密浮点实施相比,LNS-MADAM将能耗降低超过90。
translated by 谷歌翻译
数据剪辑对于降低量化操作中的噪声和提高量化感知训练(QAT)的准确性至关重要。当前的实践依靠启发式方法来设置剪接阈值标量,不能证明是最佳的。我们提出了最佳的剪切张量和向量(octav),这是一种递归算法,以确定MSE最佳的剪切标量。 OCTAV源自Fast Newton-Raphson方法,在QAT例程的每一个迭代中,都可以随时发现最佳的剪切标量。因此,QAT算法在每个步骤中都具有可证明的最小量化噪声配制。此外,我们揭示了QAT中常见梯度估计技术的局限性,并提出了幅度感知的分化,以进一步提高准确性。在实验上,启用了八度的QAT在多个任务上实现了最先进的精度。其中包括在ImageNet上进行训练,并在ImageNet上进行重新注册和Mobilenets,以及使用BERT模型进行微调,其中启用八叶速度的QAT始终以低精度(4到6位)保持准确性。我们的结果不需要对基线训练配方进行任何修改,除了在适当的情况下插入量化操作。
translated by 谷歌翻译
当量化神经网络以进行有效推断时,低位整数是效率的首选格式。但是,低位浮点数具有额外的自由度,分配了一些以指数级的工作。本文深入研究了神经网络推断的浮点格式的这种好处。我们详细介绍了可以为FP8格式做出的选择,包括对Mantissa和Exponent的位数的重要选择,并通过分析显示这些选择可以提供更好的性能。然后,我们展示了这些发现如何转化为真实网络,为FP8模拟提供有效的实现,以及一种新算法,该算法能够学习比例参数和FP8格式中的指数位数。我们的主要结论是,在对各种网络进行培训后量化时,就准确性而言,FP8格式优于INT8,并且指数位数量的选择是由网络中异常值的严重性驱动的。我们还通过量化感知训练进行实验,在训练网络以降低离群值的效果时,格式的差异消失。
translated by 谷歌翻译
深度学习在广泛的AI应用方面取得了有希望的结果。较大的数据集和模型一致地产生更好的性能。但是,我们一般花费更长的培训时间,以更多的计算和沟通。在本调查中,我们的目标是在模型精度和模型效率方面提供关于大规模深度学习优化的清晰草图。我们调查最常用于优化的算法,详细阐述了大批量培训中出现的泛化差距的可辩论主题,并审查了解决通信开销并减少内存足迹的SOTA策略。
translated by 谷歌翻译
我们使用所述环境中常用的量化实施了安全多方计算(MPC)中神经网络的培训。我们是第一个呈现MNIST分类器纯粹在MPC中训练的MNIST分类器,该分类器占据通过宣传计算训练的相同卷积神经网络准确性的0.2%。更具体地说,我们已经训练了一个在3.5小时内具有两个卷积和两个密集层至99.2%精度的网络(精度为99%的小时)。我们还为CIFAR-10实施了Alexnet,该Alexnet在几个小时内收敛。我们开发了用于指示和平方根逆的新方案。最后,我们在多达十个政党的一系列MPC安全模型中介绍了实验,包括诚实和不诚实的多数以及半honest和恶意安全。
translated by 谷歌翻译
Increasing the size of a neural network typically improves accuracy but also increases the memory and compute requirements for training the model. We introduce methodology for training deep neural networks using half-precision floating point numbers, without losing model accuracy or having to modify hyperparameters. This nearly halves memory requirements and, on recent GPUs, speeds up arithmetic. Weights, activations, and gradients are stored in IEEE halfprecision format. Since this format has a narrower range than single-precision we propose three techniques for preventing the loss of critical information. Firstly, we recommend maintaining a single-precision copy of weights that accumulates the gradients after each optimizer step (this copy is rounded to half-precision for the forward-and back-propagation). Secondly, we propose loss-scaling to preserve gradient values with small magnitudes. Thirdly, we use half-precision arithmetic that accumulates into single-precision outputs, which are converted to halfprecision before storing to memory. We demonstrate that the proposed methodology works across a wide variety of tasks and modern large scale (exceeding 100 million parameters) model architectures, trained on large datasets.
translated by 谷歌翻译
现代深度学习模型通常在分布式机器集合中并行培训,以减少训练时间。在这种情况下,机器之间模型更新的通信变成了一个重要的性能瓶颈,并且已经提出了各种有损的压缩技术来减轻此问题。在这项工作中,我们介绍了一种新的,简单但理论上和实践上有效的压缩技术:自然压缩(NC)。我们的技术分别应用于要进行压缩的更新向量的所有条目,并通过随机舍入到两个的(负或正)两种功能,可以通过忽略Mantissa来以“自然”方式计算。我们表明,与没有压缩相比,NC将压缩向量的第二刻增加不超过微小因子$ \ frac {9} {8} $,这意味着NC对流行训练算法的收敛速度的影响,例如分布式SGD,可以忽略不计。但是,NC启用的通信节省是可观的,导致$ 3 $ - $ 4 \ times $ $改善整体理论运行时间。对于需要更具侵略性压缩的应用,我们将NC推广到自然抖动,我们证明这比常见的随机抖动技术要好得多。我们的压缩操作员可以自行使用,也可以与现有操作员结合使用,从而产生更具侵略性的结合效果,并在理论和实践中提供新的最先进。
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 谷歌翻译
尽管低精度优化已被广泛用于加速深度学习,但低精度抽样仍未得到探索。结果,尽管在许多大规模的情况下,采样是不可行的,尽管对神经网络的概括和不确定性估计给予了显着的好处。在本文中,我们提供了低精确的随机梯度Langevin Dynamics(SGLD)的首次研究,这表明其成本可以大大降低而无需牺牲性能,因为它的内在能力处理了系统噪声。我们证明,低精度SGLD与完全精确的梯度累加器的收敛性比在强凸设置中的SGD对应物的量化误差的影响较小。为了进一步启用低精度梯度蓄能器,我们为SGLD开发了一个新的量化功能,该功能保留了每个更新步骤中的差异。我们证明,低精确的SGLD与完整精确的SGLD相当,只有8位在各种深度学习任务上。
translated by 谷歌翻译
模型量化已成为加速深度学习推理的不可或缺的技术。虽然研究人员继续推动量化算法的前沿,但是现有量化工作通常是不可否认的和不可推销的。这是因为研究人员不选择一致的训练管道并忽略硬件部署的要求。在这项工作中,我们提出了模型量化基准(MQBench),首次尝试评估,分析和基准模型量化算法的再现性和部署性。我们为实际部署选择多个不同的平台,包括CPU,GPU,ASIC,DSP,并在统一培训管道下评估广泛的最新量化算法。 MQBENCK就像一个连接算法和硬件的桥梁。我们进行全面的分析,并找到相当大的直观或反向直观的见解。通过对齐训练设置,我们发现现有的算法在传统的学术轨道上具有大致相同的性能。虽然用于硬件可部署量化,但有一个巨大的精度差距,仍然不稳定。令人惊讶的是,没有现有的算法在MQBench中赢得每一项挑战,我们希望这项工作能够激发未来的研究方向。
translated by 谷歌翻译
权重和激活的量化是减少深神经网络(DNN)训练的计算占地面积的主要方法之一。当前方法使得4位量化的前向阶段。但是,这仅构成了培训过程的三分之一。减少整个训练过程的计算占地面积需要定量神经梯度,即相对于中间神经层的输出的损耗梯度。在这项工作中,我们研究了在量化神经网络训练中具有无偏差值的重要性,以及如何维护它,以及如何。基于此,我们建议一个$ \ texit {logarithic unbiased量化} $(luq)方法,以将前向和向后阶段量化为4位,实现最先进的导致4位训练,没有开销。例如,在Imagenet的Reset50中,我们实现了1.18%的降级。我们进一步改善了这一点以降解仅在高精度微调的单一时期与差异减少方法结合后的单一时期 - 均增加与先前建议的方法相当的开销。最后,我们建议使用低精度格式的方法来避免在训练过程的三分之二期间乘法,从而减少乘法器使用的5倍。
translated by 谷歌翻译
由于其不断增加的资源需求,在低资源边缘设备上部署深层神经网络是具有挑战性的。最近的研究提出了无倍数的神经网络,以减少计算和记忆消耗。 Shift神经网络是这些减少的最有效工具之一。但是,现有的低位换档网络不如其完整的精度对应物准确,并且由于其固有的设计缺陷,无法有效地转移到广泛的任务中。我们提出了利用以下新颖设计的光泽网络。首先,我们证明低位移位网络中的零重量值既不有用,也不简化模型推断。因此,我们建议使用零移动机制来简化推理,同时增加模型容量。其次,我们设计了一个新的指标,以测量训练低位移位网络中的重量冻结问题,并提出一个符号尺度分解以提高训练效率。第三,我们提出了低变化的随机初始化策略,以提高模型在转移学习方案中的性能。我们对各种计算机视觉和语音任务进行了广泛的实验。实验结果表明,光泽网络明显胜过现有的低位乘法网络,并可以实现全精度对应物的竞争性能。它还表现出强大的转移学习表现,没有准确性下降。
translated by 谷歌翻译
While machine learning is traditionally a resource intensive task, embedded systems, autonomous navigation, and the vision of the Internet of Things fuel the interest in resource-efficient approaches. These approaches aim for a carefully chosen trade-off between performance and resource consumption in terms of computation and energy. The development of such approaches is among the major challenges in current machine learning research and key to ensure a smooth transition of machine learning technology from a scientific environment with virtually unlimited computing resources into everyday's applications. In this article, we provide an overview of the current state of the art of machine learning techniques facilitating these real-world requirements. In particular, we focus on deep neural networks (DNNs), the predominant machine learning models of the past decade. We give a comprehensive overview of the vast literature that can be mainly split into three non-mutually exclusive categories: (i) quantized neural networks, (ii) network pruning, and (iii) structural efficiency. These techniques can be applied during training or as post-processing, and they are widely used to reduce the computational demands in terms of memory footprint, inference speed, and energy efficiency. We also briefly discuss different concepts of embedded hardware for DNNs and their compatibility with machine learning techniques as well as potential for energy and latency reduction. We substantiate our discussion with experiments on well-known benchmark datasets using compression techniques (quantization, pruning) for a set of resource-constrained embedded systems, such as CPUs, GPUs and FPGAs. The obtained results highlight the difficulty of finding good trade-offs between resource efficiency and predictive performance.
translated by 谷歌翻译
我们介绍了正规化的弗兰克 - 沃尔夫(Frank-Wolfe),这是一种通用有效的算法,用于推断和学习密集的有条件随机场(CRF)。该算法使用Vanilla Frank-Wolfe优化了CRF推理问题的不连续放松,并具有近似更新,这相当于最大程度地减少正则能量函数。我们提出的方法是对现有算法(例如平均字段或凹形通用程序)的概括。这种观点不仅提供了对这些算法的统一分析,而且还允许一种简单的方法来探索不同的变体,这些变体可能会产生更好的性能。我们在标准语义分割数据集的经验结果中说明了这一点,在该数据集中,我们正规化的Frank-Wolfe优于均值均值推断的几个实例化,无论是独立的组件还是作为神经网络中的端到端可训练层。我们还表明,密集的CRF与我们的新算法相结合,对强CNN基准产生了重大改进。
translated by 谷歌翻译
由于神经网络变得更加强大,因此在现实世界中部署它们的愿望是一个上升的愿望;然而,神经网络的功率和准确性主要是由于它们的深度和复杂性,使得它们难以部署,尤其是在资源受限的设备中。最近出现了神经网络量化,以满足这种需求通过降低网络的精度来降低神经网络的大小和复杂性。具有较小和更简单的网络,可以在目标硬件的约束中运行神经网络。本文调查了在过去十年中开发的许多神经网络量化技术。基于该调查和神经网络量化技术的比较,我们提出了该地区的未来研究方向。
translated by 谷歌翻译
With the advent of deep learning application on edge devices, researchers actively try to optimize their deployments on low-power and restricted memory devices. There are established compression method such as quantization, pruning, and architecture search that leverage commodity hardware. Apart from conventional compression algorithms, one may redesign the operations of deep learning models that lead to more efficient implementation. To this end, we propose EuclidNet, a compression method, designed to be implemented on hardware which replaces multiplication, $xw$, with Euclidean distance $(x-w)^2$. We show that EuclidNet is aligned with matrix multiplication and it can be used as a measure of similarity in case of convolutional layers. Furthermore, we show that under various transformations and noise scenarios, EuclidNet exhibits the same performance compared to the deep learning models designed with multiplication operations.
translated by 谷歌翻译
混合精确的深神经网络达到了硬件部署所需的能源效率和吞吐量,尤其是在资源有限的情况下,而无需牺牲准确性。但是,不容易找到保留精度的最佳每层钻头精度,尤其是在创建巨大搜索空间的大量模型,数据集和量化技术中。为了解决这一困难,最近出现了一系列文献,并且已经提出了一些实现有希望的准确性结果的框架。在本文中,我们首先总结了文献中通常使用的量化技术。然后,我们对混合精液框架进行了彻底的调查,该调查是根据其优化技术进行分类的,例如增强学习和量化技术,例如确定性舍入。此外,讨论了每个框架的优势和缺点,我们在其中呈现并列。我们最终为未来的混合精液框架提供了指南。
translated by 谷歌翻译