Skip to main content
QUICK REVIEW

[论文解读] An Image Enhancing Pattern-based Sparsity for Real-time Inference on Mobile Devices

Xiaolong Ma, Wei Niu|arXiv (Cornell University)|Jan 20, 2020
Advanced Neural Network Applications参考文献 42被引用 6
一句话总结

本文提出基于模式的稀疏性——一种结合模式稀疏性与连接稀疏性的新型稀疏性维度,使深度神经网络在保持高模型精度的同时实现硬件高效性。通过设计一种模式感知的剪枝框架并结合编译器优化的代码生成,该方法实现了在移动设备上对大型DNN(如ResNet-18、ResNet-50和VGG-16)的实时推理,其在精度和速度方面均优于先前方法。

ABSTRACT

Weight pruning has been widely acknowledged as a straightforward and effective method to eliminate redundancy in Deep Neural Networks (DNN), thereby achieving acceleration on various platforms. However, most of the pruning techniques are essentially trade-offs between model accuracy and regularity which lead to impaired inference accuracy and limited on-device acceleration performance. To solve the problem, we introduce a new sparsity dimension, namely pattern-based sparsity that comprises pattern and connectivity sparsity, and becoming both highly accurate and hardware friendly. With carefully designed patterns, the proposed pruning unprecedentedly and consistently achieves accuracy enhancement and better feature extraction ability on different DNN structures and datasets, and our pattern-aware pruning framework also achieves pattern library extraction, pattern selection, pattern and connectivity pruning and weight training simultaneously. Our approach on the new pattern-based sparsity naturally fits into compiler optimization for highly efficient DNN execution on mobile platforms. To the best of our knowledge, it is the first time that mobile devices achieve real-time inference for the large-scale DNN models thanks to the unique spatial property of pattern-based sparsity and the help of the code generation capability of compilers.

研究动机与目标

  • 解决结构化与非结构化权重重剪枝中模型精度与硬件效率之间的权衡问题。
  • 克服现有剪枝方法的局限性:要么牺牲精度(结构化剪枝),要么无法实现硬件加速(非结构化剪枝)。
  • 通过引入具有本征硬件兼容性的新型稀疏性维度,实现在移动设备上对大规模DNN的实时推理。
  • 设计一个统一框架,同时完成模式库提取、模式与连接性剪枝以及权重微调。

提出的方法

  • 提出基于模式的稀疏性作为新型稀疏性维度,结合层内模式稀疏性与层间连接稀疏性。
  • 将剪枝问题建模为ADMM优化问题,并采用原始-邻近法求解,以实现随机梯度下降与正则化项的解耦。
  • 设计一组图像增强型核模式,通过权重中的空间结构提升特征提取能力与模型精度。
  • 实施滤波器/核重排,以保留指令级与线程级并行性,实现最大化的硬件加速。
  • 将基于模式的稀疏模型集成到使用TFLite、TVM与MNN的编译器优化推理流水线中,并启用全部优化功能。
  • 通过代码生成与硬件感知编译技术,利用基于模式的稀疏性的规律性,实现实时推理。

实验结果

研究问题

  • RQ1结合模式与连接稀疏性的新型稀疏性维度是否能同时实现高模型精度与硬件高效性?
  • RQ2精心设计的核模式是否能增强特征提取与图像质量,从而提升模型性能?
  • RQ3基于模式的稀疏性是否能被高效地编译并执行于移动平台,以实现实时推理?
  • RQ4与现有剪枝方法相比,所提出的框架在移动设备上的精度、压缩率与推理速度方面表现如何?
  • RQ5该模式感知剪枝框架是否能同时完成模式库提取、模式剪枝、连接性剪枝与权重微调?

主要发现

  • 所提方法在使用ResNet-18时,ImageNet上的top-1精度达94.0%,压缩率达16×,推理速度提升8.0×,实现在移动CPU上的实时推理。
  • 对于ResNet-50,模型在16×压缩率下保持94.2%的top-1精度,并实现5.8×速度提升,满足移动设备上的实时推理要求。
  • 在VGG-16上,方法在19.7×压缩率下实现93.5%的top-1精度与12.0×速度提升,验证了其在更深模型上的有效性。
  • 基于模式的稀疏性框架在所有评估模型(包括大规模DNN)上均实现了移动CPU与GPU上的实时推理(≤33ms/帧)。
  • 模式感知剪枝框架成功提取了模式库,实现了模式与连接性剪枝的联合优化,并在精度上保持或优于基线方法。
  • 基于模式的模型经编译器优化执行后,相比非优化基线,速度提升最高达16×,证明了其硬件友好设计。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。