arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2306.07030cs.CVcs.AI

基于Hessian剪枝的资源高效神经网络

Resource Efficient Neural Networks Using Hessian Based Pruning

School of Electrical and Electronic Engineering (EEE), Nanyang Technological University (NTU)(南洋理工大学电子与电气工程学院);Institute for Infocomm Research (I2R), Agency for Science, Technology and Research (A*STAR)(新加坡科技研究局信息通信研究所);Centre for Information Sciences and Systems (CISS), School of Electrical and Electronic Engineering (EEE), Nanyang Technological University (NTU)(南洋理工大学信息科学与系统中心、电子与电气工程学院)

Jack Chong, Manas Gupta, Lihui Chen

AI总结:

针对Hessian迹估计耗时长的问题,提出用FP16精度计算的EHAP剪枝方法,在多个图像分类模型上实现17%-44%加速、40%显存降低且精度无损,还结合QAT进一步压缩网络。

摘要:

神经网络剪枝是缩小已训练模型规模、减少浮点运算次数的实用方法。与更常见的权值大小剪枝方法相比,一种剪枝方式是利用相对Hessian迹计算每个通道的敏感度。然而,用于估计Hessian迹的随机方法需要多次迭代才能收敛,当应用于具有数百万参数的更大模型时会非常耗时。为解决这一问题,我们对现有方法进行改进,采用FP16精度而非FP32精度来估计Hessian迹。我们在CIFAR10/CIFAR100图像分类任务上训练的ResNet-32/ResNet-56/WideResNet-28-8模型上测试了改进后的方法(EHAP),实现了更快的Hessian迹计算。具体而言,在不同模型架构与GPU设备的组合实验中,我们的改进方法可实现17%到44%的加速比。在剪枝ResNet-32和ResNet-56模型时,改进方法还能减少约40%的GPU显存占用,这使得我们可以使用更大的Hessian批大小来估计Hessian迹。同时,我们还给出了分别采用FP16和FP32计算Hessian迹的剪枝结果,表明两者之间没有明显的精度差异。总体而言,这是一种在不牺牲剪枝后模型性能的前提下更快计算相对Hessian迹的简单有效方法。我们还提出了结合EHAP和量化感知训练(QAT)的完整流程,在剪枝后使用INT8 QAT进一步压缩网络。具体来说,我们对权重采用对称量化,对激活值采用非对称量化。

英文摘要:

Neural network pruning is a practical way for reducing the size of trained models and the number of floating-point operations. One way of pruning is to use the relative Hessian trace to calculate sensitivity of each channel, as compared to the more common magnitude pruning approach. However, the stochastic approach used to estimate the Hessian trace needs to iterate over many times before it can converge. This can be time-consuming when used for larger models with many millions of parameters. To address this problem, we modify the existing approach by estimating the Hessian trace using FP16 precision instead of FP32. We test the modified approach (EHAP) on ResNet-32/ResNet-56/WideResNet-28-8 trained on CIFAR10/CIFAR100 image classification tasks and achieve faster computation of the Hessian trace. Specifically, our modified approach can achieve speed ups ranging from 17% to as much as 44% during our experiments on different combinations of model architectures and GPU devices. Our modified approach also takes up around 40% less GPU memory when pruning ResNet-32 and ResNet-56 models, which allows for a larger Hessian batch size to be used for estimating the Hessian trace. Meanwhile, we also present the results of pruning using both FP16 and FP32 Hessian trace calculation and show that there are no noticeable accuracy differences between the two. Overall, it is a simple and effective way to compute the relative Hessian trace faster without sacrificing on pruned model performance. We also present a full pipeline using EHAP and quantization aware training (QAT), using INT8 QAT to compress the network further after pruning. In particular, we use symmetric quantization for the weights and asymmetric quantization for the activations.

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

↑