[论文解读] SQuantizer: Simultaneous Learning for Both Sparse and Low-precision Neural Networks
SQuantizer 提出了一种联合训练方法,同时优化深度神经网络中的权重重构稀疏性与激活稀疏性以及低精度量化(4位和2位),在实现高达18倍(ResNet18)和17倍(ResNet50)压缩率的同时,保持小于1%的精度下降,达到当前最优的准确性。该方法支持单次遍历训练,加速了在稀疏感知硬件上的推理,并通过 YOLO-v3 在目标检测任务上实现29倍压缩率和50.3 mAP的性能。
Deep neural networks have achieved state-of-the-art accuracies in a wide range of computer vision, speech recognition, and machine translation tasks. However the limits of memory bandwidth and computational power constrain the range of devices capable of deploying these modern networks. To address this problem, we propose SQuantizer, a new training method that jointly optimizes for both sparse and low-precision neural networks while maintaining high accuracy and providing a high compression rate. This approach brings sparsification and low-bit quantization into a single training pass, employing these techniques in an order demonstrated to be optimal. Our method achieves state-of-the-art accuracies using 4-bit and 2-bit precision for ResNet18, MobileNet-v2 and ResNet50, even with high degree of sparsity. The compression rates of 18x for ResNet18 and 17x for ResNet50, and 9x for MobileNet-v2 are obtained when SQuantizing both weights and activations within 1% and 2% loss in accuracy for ResNets and MobileNet-v2 respectively. An extension of these techniques to object detection also demonstrates high accuracy on YOLO-v3. Additionally, our method allows for fast single pass training, which is important for rapid prototyping and neural architecture search techniques. Finally extensive results from this simultaneous training approach allows us to draw some useful insights into the relative merits of sparsity and quantization.
研究动机与目标
- 为解决在内存和计算能力有限的边缘设备上部署高精度深度神经网络的挑战。
- 克服顺序剪枝与量化方法的局限性,后者需要两阶段训练,且在结合低精度量化与稀疏性时常导致精度下降。
- 开发一种单一、高效的训练流程,联合优化权重重构稀疏性与激活稀疏性以及低精度量化。
- 在多种架构(如 ResNet18、ResNet50、MobileNet-v2 和 YOLO-v3)上,最大化模型压缩率与推理效率,同时保持最先进精度。
- 提供关于稀疏性与量化在联合优化中相对有效性及最优操作顺序的见解。
提出的方法
- SQuantizer 在单次训练遍历中应用权重重构稀疏化与激活稀疏化以及低精度量化(4位和2位),采用可微分的 SQuantization 操作,使梯度能够通过稀疏和量化张量反向传播。
- 该方法采用可学习阈值的可微分稀疏化机制,并结合直通估计器,以在反向传播期间保持梯度流动。
- 采用延迟训练调度(Delay = 20 个周期),在初始收敛阶段稳定训练过程,再应用稀疏性与量化。
- 框架联合优化稀疏性与低精度量化,实验表明先进行稀疏化再进行量化为最优操作顺序。
- 在前向传播中,SQuantization 同时应用于每一层的权重与激活,而全精度权重通过反向传播进行更新。
- 该方法通过在 YOLO-v3 与 Darknet-53 上应用 SQuantizer,扩展至目标检测任务,在保持高 mAP 的同时实现高精度压缩。
实验结果
研究问题
- RQ1在联合训练中,稀疏化与量化操作的最优应用顺序是什么,以实现最大压缩率与最高精度?
- RQ2能否通过同时训练实现稀疏性与低精度量化,从而在模型压缩率与精度方面超越传统的两阶段顺序训练?
- RQ3对权重与激活进行联合优化,如何影响最终模型的大小、推理速度与边缘硬件上的能效?
- RQ4SQuantizer 在多种架构上应用 4 位与 2 位量化并结合高稀疏度时,能在多大程度上保持最先进精度?
- RQ5联合 SQuantization 方法能否有效推广至图像分类以外的目标检测任务?
主要发现
- SQuantizer 在使用 4 位权重与 41% 稀疏度时,实现 ResNet18 18 倍压缩率,且精度下降小于 1%。
- 对于 MobileNet-v2,该方法在使用 4 位权重与 32 位激活时实现 9 倍压缩率,精度仅下降 2%。
- 在 YOLO-v3 上使用 2 位权重与 55% 稀疏度时,实现 29 倍压缩率,COCO 数据集上 mAP 保持在 50.3,相比基线仅下降 2.5%。
- 当使用 55% 稀疏的 4 位 ResNet50 时,FLOPs 减少 75%(降至基线的 17.6%),在稀疏硬件上展现出显著的计算节省。
- 硬件原型测试显示,对于 50% 稀疏度的 ResNet50,每层推理速度提升约 2 倍,显著提升了推理效率。
- 联合优化使模型可适配片上内存,减少对片外 DRAM 的访问,从而降低能耗。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。