网络量化是一种有效的压缩方法,以降低模型大小和计算成本。尽管压缩比高,但训练低精度模型由于量化的离散和不可分散的性质,难以实现相当大的性能下降。最近,提出了清晰度感知最小化(SAM),以通过同时最小化损耗值和损耗曲率来改善模型的泛化性能。在本文中,我们设计了锐度感知量化(SAQ)方法来培训量化模型,从而导致更好的泛化性能。此外,由于每个层与网络的损耗和损耗锐度有不同的贡献,我们进一步设计了一种有效的方法,该方法学习配置生成器以自动确定每层的位宽度配置,鼓励平面区域的较低位,反之亦然尖锐的景观,同时促进最小值的平整度,以实现更积极的量化。对CiFar-100和Imagenet的广泛实验显示了所提出的方法的优越性。例如,我们的量化Reset-18具有55.1X比特操作(BOP)减少甚至在前1个精度方面均匀地优于0.7%。代码可在https://github.com/zhuang-group/saq获得。
translated by 谷歌翻译
Quantization has become a predominant approach for model compression, enabling deployment of large models trained on GPUs onto smaller form-factor devices for inference. Quantization-aware training (QAT) optimizes model parameters with respect to the end task while simulating quantization error, leading to better performance than post-training quantization. Approximation of gradients through the non-differentiable quantization operator is typically achieved using the straight-through estimator (STE) or additive noise. However, STE-based methods suffer from instability due to biased gradients, whereas existing noise-based methods cannot reduce the resulting variance. In this work, we incorporate exponentially decaying quantization-error-aware noise together with a learnable scale of task loss gradient to approximate the effect of a quantization operator. We show this method combines gradient scale and quantization noise in a better optimized way, providing finer-grained estimation of gradients at each weight and activation layer's quantizer bin size. Our controlled noise also contains an implicit curvature term that could encourage flatter minima, which we show is indeed the case in our experiments. Experiments training ResNet architectures on the CIFAR-10, CIFAR-100 and ImageNet benchmarks show that our method obtains state-of-the-art top-1 classification accuracy for uniform (non mixed-precision) quantization, out-performing previous methods by 0.5-1.2% absolute.
translated by 谷歌翻译
Vision Transformers(VITS)为计算机视觉的最新突破提供了基础。但是,设计VIT的架构是艰苦的,并且在很大程度上依赖专家知识。为了自动化设计过程并结合了部署灵活性,一击神经体系结构搜索将超级网训练和体系结构专业化解除了各种部署场景。为了应对超级网中的大量子网络,现有方法在培训期间的每个更新步骤中都同样重要且随机对所有体系结构进行处理。在体系结构搜索过程中,这些方法着重于在性能和资源消耗的帕累托前沿寻找体系结构,这在培训和部署之间形成了差距。在本文中,我们设计了一种简单而有效的方法,称为FocusFormer,以弥合这种差距。为此,我们建议学习一个体系结构采样器,以在超级网训练期间在不同的资源限制下为帕累托前沿上的这些架构分配更高的采样概率,从而使它们充分优化,从而提高其性能。在专业化过程中,我们可以直接使用训练有素的体系结构采样器来获得满足给定资源约束的准确体系结构,从而大大提高了搜索效率。关于CIFAR-100和Imagenet的广泛实验表明,我们的FocusFormer能够提高搜索架构的性能,同时大大降低搜索成本。例如,在ImageNet上,我们具有1.4G FLOPS的FocusFormer-Ti在TOP-1准确性方面优于自动构架Ti 0.5%。
translated by 谷歌翻译
混合精确的深神经网络达到了硬件部署所需的能源效率和吞吐量,尤其是在资源有限的情况下,而无需牺牲准确性。但是,不容易找到保留精度的最佳每层钻头精度,尤其是在创建巨大搜索空间的大量模型,数据集和量化技术中。为了解决这一困难,最近出现了一系列文献,并且已经提出了一些实现有希望的准确性结果的框架。在本文中,我们首先总结了文献中通常使用的量化技术。然后,我们对混合精液框架进行了彻底的调查,该调查是根据其优化技术进行分类的,例如增强学习和量化技术,例如确定性舍入。此外,讨论了每个框架的优势和缺点,我们在其中呈现并列。我们最终为未来的混合精液框架提供了指南。
translated by 谷歌翻译
模型二进制化是一种压缩神经网络并加速其推理过程的有效方法。但是,1位模型和32位模型之间仍然存在显着的性能差距。实证研究表明,二进制会导致前进和向后传播中的信息损失。我们提出了一个新颖的分布敏感信息保留网络(DIR-NET),该网络通过改善内部传播和引入外部表示,将信息保留在前后传播中。 DIR-NET主要取决于三个技术贡献:(1)最大化二进制(IMB)的信息:最小化信息损失和通过重量平衡和标准化同时同时使用权重/激活的二进制误差; (2)分布敏感的两阶段估计器(DTE):通过共同考虑更新能力和准确的梯度来通过分配敏感的软近似来保留梯度的信息; (3)代表性二进制 - 意识蒸馏(RBD):通过提炼完整精确和二元化网络之间的表示来保留表示信息。 DIR-NET从统一信息的角度研究了BNN的前进过程和后退过程,从而提供了对网络二进制机制的新见解。我们的DIR-NET中的三种技术具有多功能性和有效性,可以在各种结构中应用以改善BNN。关于图像分类和客观检测任务的综合实验表明,我们的DIR-NET始终优于主流和紧凑型体系结构(例如Resnet,vgg,vgg,EfficityNet,darts和mobilenet)下最新的二进制方法。此外,我们在现实世界中的资源有限设备上执行DIR-NET,该设备可实现11.1倍的存储空间和5.4倍的速度。
translated by 谷歌翻译
Mixed-precision quantization has been widely applied on deep neural networks (DNNs) as it leads to significantly better efficiency-accuracy tradeoffs compared to uniform quantization. Meanwhile, determining the exact precision of each layer remains challenging. Previous attempts on bit-level regularization and pruning-based dynamic precision adjustment during training suffer from noisy gradients and unstable convergence. In this work, we propose Continuous Sparsification Quantization (CSQ), a bit-level training method to search for mixed-precision quantization schemes with improved stability. CSQ stabilizes the bit-level mixed-precision training process with a bi-level gradual continuous sparsification on both the bit values of the quantized weights and the bit selection in determining the quantization precision of each layer. The continuous sparsification scheme enables fully-differentiable training without gradient approximation while achieving an exact quantized model in the end.A budget-aware regularization of total model size enables the dynamic growth and pruning of each layer's precision towards a mixed-precision quantization scheme of the desired size. Extensive experiments show CSQ achieves better efficiency-accuracy tradeoff than previous methods on multiple models and datasets.
translated by 谷歌翻译
随着最近在移动和边缘设备上部署神经网络模型的需求,希望提高模型对看不见的测试数据的普遍性,以及提高模型在固定点量化下的稳健性,以实现有效部署。然而,最大限度地减少培训损失在泛化和量化性能上提供了一些保证。在这项工作中,我们通过在改善模型对界限重量扰动的框架下理论上统一它们的理论上统一并最小化模型权重的稳健性并最小化了模型权重的框架的框架,同时履行泛化和量化性能。因此,我们提出了HESSIAN增强的鲁棒优化方法,以通过基于梯度的训练过程最小化Hessian特征值,同时提高泛化和量化性能。 HERO在测试准确性上高达3.8%,高度高达30%,在80%的培训标签扰动下的准确性高达30%,以及各种精度范围内的最佳训练后量化精度,包括在SGD上的高精度改善> 10%在各种数据集上的共同模型架构培训模型。
translated by 谷歌翻译
强大的量化提高了网络对各种实现的公差,从而允许在不同的位宽度或零散的低精度算术中可靠的输出。在这项工作中,我们进行了广泛的分析以确定量化误差的来源,并提出了三个见解以鲁棒化的网络,以防止量化:减少误差传播,范围夹紧误差最小化以及遗传的稳健性,以抗量化。基于这些见解,我们提出了两种称为对称正则化(Symreg)和饱和非线性(SATNL)的新方法。在培训期间应用提出的方法可以增强对现有训练后量化(PTQ)和量化感知培训(QAT)算法的量化的任意神经网络的鲁棒性各种条件。我们对CIFAR和Imagenet数据集进行了广泛的研究,并验证了所提出的方法的有效性。
translated by 谷歌翻译
深度学习在广泛的AI应用方面取得了有希望的结果。较大的数据集和模型一致地产生更好的性能。但是,我们一般花费更长的培训时间,以更多的计算和沟通。在本调查中,我们的目标是在模型精度和模型效率方面提供关于大规模深度学习优化的清晰草图。我们调查最常用于优化的算法,详细阐述了大批量培训中出现的泛化差距的可辩论主题,并审查了解决通信开销并减少内存足迹的SOTA策略。
translated by 谷歌翻译
Although considerable progress has been obtained in neural network quantization for efficient inference, existing methods are not scalable to heterogeneous devices as one dedicated model needs to be trained, transmitted, and stored for one specific hardware setting, incurring considerable costs in model training and maintenance. In this paper, we study a new vertical-layered representation of neural network weights for encapsulating all quantized models into a single one. With this representation, we can theoretically achieve any precision network for on-demand service while only needing to train and maintain one model. To this end, we propose a simple once quantization-aware training (QAT) scheme for obtaining high-performance vertical-layered models. Our design incorporates a cascade downsampling mechanism which allows us to obtain multiple quantized networks from one full precision source model by progressively mapping the higher precision weights to their adjacent lower precision counterparts. Then, with networks of different bit-widths from one source model, multi-objective optimization is employed to train the shared source model weights such that they can be updated simultaneously, considering the performance of all networks. By doing this, the shared weights will be optimized to balance the performance of different quantized models, thus making the weights transferable among different bit widths. Experiments show that the proposed vertical-layered representation and developed once QAT scheme are effective in embodying multiple quantized networks into a single one and allow one-time training, and it delivers comparable performance as that of quantized models tailored to any specific bit-width. Code will be available.
translated by 谷歌翻译
Adder Neural Network (AdderNet) provides a new way for developing energy-efficient neural networks by replacing the expensive multiplications in convolution with cheaper additions (i.e.l1-norm). To achieve higher hardware efficiency, it is necessary to further study the low-bit quantization of AdderNet. Due to the limitation that the commutative law in multiplication does not hold in l1-norm, the well-established quantization methods on convolutional networks cannot be applied on AdderNets. Thus, the existing AdderNet quantization techniques propose to use only one shared scale to quantize both the weights and activations simultaneously. Admittedly, such an approach can keep the commutative law in the l1-norm quantization process, while the accuracy drop after low-bit quantization cannot be ignored. To this end, we first thoroughly analyze the difference on distributions of weights and activations in AdderNet and then propose a new quantization algorithm by redistributing the weights and the activations. Specifically, the pre-trained full-precision weights in different kernels are clustered into different groups, then the intra-group sharing and inter-group independent scales can be adopted. To further compensate the accuracy drop caused by the distribution difference, we then develop a lossless range clamp scheme for weights and a simple yet effective outliers clamp strategy for activations. Thus, the functionality of full-precision weights and the representation ability of full-precision activations can be fully preserved. The effectiveness of the proposed quantization method for AdderNet is well verified on several benchmarks, e.g., our 4-bit post-training quantized adder ResNet-18 achieves an 66.5% top-1 accuracy on the ImageNet with comparable energy efficiency, which is about 8.5% higher than that of the previous AdderNet quantization methods.
translated by 谷歌翻译
Although weight and activation quantization is an effective approach for Deep Neural Network (DNN) compression and has a lot of potentials to increase inference speed leveraging bit-operations, there is still a noticeable gap in terms of prediction accuracy between the quantized model and the full-precision model. To address this gap, we propose to jointly train a quantized, bit-operation-compatible DNN and its associated quantizers, as opposed to using fixed, handcrafted quantization schemes such as uniform or logarithmic quantization. Our method for learning the quantizers applies to both network weights and activations with arbitrary-bit precision, and our quantizers are easy to train. The comprehensive experiments on CIFAR-10 and ImageNet datasets show that our method works consistently well for various network structures such as AlexNet, VGG-Net, GoogLeNet, ResNet, and DenseNet, surpassing previous quantization methods in terms of accuracy by an appreciable margin. Code available at https://github.com/Microsoft/LQ-Nets
translated by 谷歌翻译
在许多真实世界应用程序中,我们经常需要处理各种部署方案,其中动态指定资源约束和对应于一组类的感兴趣的超类。如何为各种部署方案有效地部署深层模型是一个新的挑战。以前的NAS方法寻求同时为所有课程设计架构,这可能对某些单独的超类可能不是最佳的。直接解决方案是从划痕搜索每个部署方案的架构,然而,这是计算密集型和不切实际的。为了解决这个问题,我们提出了一种新颖且一般的框架,称为弹性架构搜索(EAS),允许在运行时即时专业化,以便具有各种资源限制的不同超类。为此,我们首先建议通过超类辍学策略有效地培训过参数化网络,以在训练期间解开不同的超类。以这种方式,所得到的模型对于在推理时间下降的随后的超类稳健。基于训练有素的过度参数化网络,我们提出了一个有效的架构生成器,以便在单个前向传递中获得有希望的架构。在三个图像分类数据集上的实验表明,EAS能够找到具有更好性能的更紧凑的网络,同时比最先进的NAS方法更快的数量序列。例如,我们的建议EA在50个部署方案中找到了0.1秒内的紧凑架构。
translated by 谷歌翻译
为了以计算有效的方式部署深层模型,经常使用模型量化方法。此外,由于新的硬件支持混合的位算术操作,最近对混合精度量化(MPQ)的研究开始通过搜索网络中不同层和模块的优化位低宽,从而完全利用表示的能力。但是,先前的研究主要是在使用强化学习,神经体系结构搜索等的昂贵方案中搜索MPQ策略,或者简单地利用部分先验知识来进行位于刻度分配,这可能是有偏见和优势的。在这项工作中,我们提出了一种新颖的随机量化量化(SDQ)方法,该方法可以在更灵活,更全球优化的空间中自动学习MPQ策略,并具有更平滑的梯度近似。特别是,可区分的位宽参数(DBP)被用作相邻位意选择之间随机量化的概率因素。在获取最佳MPQ策略之后,我们将进一步训练网络使用熵感知的bin正则化和知识蒸馏。我们广泛评估了不同硬件(GPU和FPGA)和数据集的多个网络的方法。 SDQ的表现优于所有最先进的混合或单个精度量化,甚至比较低的位置量化,甚至比各种重新网络和Mobilenet家族的全精度对应物更好,这表明了我们方法的有效性和优势。
translated by 谷歌翻译
神经网络量化旨在将特定神经网络的高精度权重和激活转变为低精度的权重/激活,以减少存储器使用和计算,同时保留原始模型的性能。但是,紧凑设计的主链体系结构(例如Mobilenets)通常用于边缘设备部署的极端量化(1位重量/1位激活)会导致严重的性能变性。本文提出了一种新颖的量化感知训练(QAT)方法,即使通过重点关注各层之间的权重之间的重量间依赖性,也可以通过极端量化有效地减轻性能退化。为了最大程度地减少每个重量对其他重量的量化影响,我们通过训练一个依赖输入依赖性的相关矩阵和重要性向量来对每一层的权重进行正交转换,从而使每个权重都与其他权重分开。然后,我们根据权重量化的重要性来最大程度地减少原始权重/激活中信息丢失的重要性。我们进一步执行从底层到顶部的渐进层量化,因此每一层的量化都反映了先前层的权重和激活的量化分布。我们验证了我们的方法对各种基准数据集的有效性,可针对强神经量化基线,这表明它可以减轻ImageNet上的性能变性,并成功地保留了CIFAR-100上具有紧凑型骨干网络的完整精确模型性能。
translated by 谷歌翻译
模型量化已成为加速深度学习推理的不可或缺的技术。虽然研究人员继续推动量化算法的前沿,但是现有量化工作通常是不可否认的和不可推销的。这是因为研究人员不选择一致的训练管道并忽略硬件部署的要求。在这项工作中,我们提出了模型量化基准(MQBench),首次尝试评估,分析和基准模型量化算法的再现性和部署性。我们为实际部署选择多个不同的平台,包括CPU,GPU,ASIC,DSP,并在统一培训管道下评估广泛的最新量化算法。 MQBENCK就像一个连接算法和硬件的桥梁。我们进行全面的分析,并找到相当大的直观或反向直观的见解。通过对齐训练设置,我们发现现有的算法在传统的学术轨道上具有大致相同的性能。虽然用于硬件可部署量化,但有一个巨大的精度差距,仍然不稳定。令人惊讶的是,没有现有的算法在MQBench中赢得每一项挑战,我们希望这项工作能够激发未来的研究方向。
translated by 谷歌翻译
经过深入的研究,最低限度的损失景观的局部形状,尤其是平坦度对于深层模型的概括起重要作用。我们开发了一种称为POF的培训算法:特征提取器的训练后培训,该培训更新了已经训练的深层模型的特征提取器部分,以搜索最小的最小值。特征是两倍:1)特征提取器在高层参数空间中的参数扰动下受到训练,基于表明使更高层参数空间变平的观测值,以及2)扰动范围以数据驱动的方式确定旨在减少由正损失曲率引起的一部分测试损失。我们提供了理论分析,该分析表明所提出的算法隐含地减少了目标Hessian组件以及损失。实验结果表明,POF仅针对CIFAR-10和CIFAR-100数据集的基线方法提高了模型性能,仅用于10个上学后培训,以及用于50个上学后培训的SVHN数据集。源代码可用:\ url {https://github.com/densoitlab/pof-v1
translated by 谷歌翻译
清晰度感知最小化(SAM)和自适应清晰度感知最小化(ASAM)旨在改善模型的概括。在这个项目中,我们提出了三个实验,以从清晰度意识到的角度有效地概括它们。我们的实验表明,基于清晰度的优化技术可以帮助提供具有强大概括能力的模型。我们的实验还表明,ASAM可以改善对非归一化数据的概括性能,但是需要进一步的研究来确认这一点。
translated by 谷歌翻译
In today's heavily overparameterized models, the value of the training loss provides few guarantees on model generalization ability. Indeed, optimizing only the training loss value, as is commonly done, can easily lead to suboptimal model quality. Motivated by prior work connecting the geometry of the loss landscape and generalization, we introduce a novel, effective procedure for instead simultaneously minimizing loss value and loss sharpness. In particular, our procedure, Sharpness-Aware Minimization (SAM), seeks parameters that lie in neighborhoods having uniformly low loss; this formulation results in a minmax optimization problem on which gradient descent can be performed efficiently. We present empirical results showing that SAM improves model generalization across a variety of benchmark datasets (e.g., CIFAR-{10, 100}, Ima-geNet, finetuning tasks) and models, yielding novel state-of-the-art performance for several. Additionally, we find that SAM natively provides robustness to label noise on par with that provided by state-of-the-art procedures that specifically target learning with noisy labels. We open source our code at https: //github.com/google-research/sam. * Work done as part of the Google AI Residency program.
translated by 谷歌翻译
最近,低精确的深度学习加速器(DLA)由于其在芯片区域和能源消耗方面的优势而变得流行,但是这些DLA上的低精确量化模型导致严重的准确性降解。达到高精度和高效推断的一种方法是在低精度DLA上部署高精度神经网络,这很少被研究。在本文中,我们提出了平行的低精确量化(PALQUANT)方法,该方法通过从头开始学习并行低精度表示来近似高精度计算。此外,我们提出了一个新型的循环洗牌模块,以增强平行低精度组之间的跨组信息通信。广泛的实验表明,PALQUANT的精度和推理速度既优于最先进的量化方法,例如,对于RESNET-18网络量化,PALQUANT可以获得0.52 \%的准确性和1.78 $ \ times $ speedup同时获得在最先进的2位加速器上的4位反片机上。代码可在\ url {https://github.com/huqinghao/palquant}中获得。
translated by 谷歌翻译