[论文解读] PCONV: The Missing but Desirable Sparsity in DNN Weight Pruning for Real-time Execution on Mobile Devices
PCONV 在 DNN 权重剪枝中引入了一种新颖的稀疏性维度,结合了细粒度的核内模式与粗粒度的核间连接性剪枝,实现了高精度与硬件效率的平衡。所提出的编译器辅助推理框架在移动 GPU 上实现了高达 39.2× 的加速,且无精度损失,使大型模型(如 VGG-16)实现实时推理。
Model compression techniques on Deep Neural Network (DNN) have been widely acknowledged as an effective way to achieve acceleration on a variety of platforms, and DNN weight pruning is a straightforward and effective method. There are currently two mainstreams of pruning methods representing two extremes of pruning regularity: non-structured, fine-grained pruning can achieve high sparsity and accuracy, but is not hardware friendly; structured, coarse-grained pruning exploits hardware-efficient structures in pruning, but suffers from accuracy drop when the pruning rate is high. In this paper, we introduce PCONV, comprising a new sparsity dimension, -- fine-grained pruning patterns inside the coarse-grained structures. PCONV comprises two types of sparsities, Sparse Convolution Patterns (SCP) which is generated from intra-convolution kernel pruning and connectivity sparsity generated from inter-convolution kernel pruning. Essentially, SCP enhances accuracy due to its special vision properties, and connectivity sparsity increases pruning rate while maintaining balanced workload on filter computation. To deploy PCONV, we develop a novel compiler-assisted DNN inference framework and execute PCONV models in real-time without accuracy compromise, which cannot be achieved in prior work. Our experimental results show that, PCONV outperforms three state-of-art end-to-end DNN frameworks, TensorFlow-Lite, TVM, and Alibaba Mobile Neural Network with speedup up to 39.2x, 11.4x, and 6.3x, respectively, with no accuracy loss. Mobile devices can achieve real-time inference on large-scale DNNs.
研究动机与目标
- 通过引入一种新的稀疏性维度,弥合高精度非结构化剪枝与硬件高效结构化剪枝之间的差距。
- 克服现有剪枝方法的局限性:要么牺牲精度(结构化),要么牺牲硬件兼容性(非结构化)。
- 通过算法创新与专用编译器栈的结合,实现在移动平台上的实时 DNN 推理。
- 开发一个统一的优化框架,充分挖掘新型稀疏性结构的潜力,以在移动 CPU 和 GPU 上实现最大性能。
提出的方法
- 通过在每个卷积核中剪枝固定数量的权重,引入稀疏卷积模式(SCP),形成规则的、受视觉启发的滤波器模式(如高斯或拉普拉斯滤波器)。
- 通过核间剪枝实现连接性稀疏性,移除整个输入-输出通道连接,以减少滤波器长度与工作负载不平衡。
- 设计一种编译器辅助的 DNN 推理框架,从计算图生成优化的执行代码,支持细粒度的、逐层优化。
- 应用高层级、细粒度的 DNN 层级信息提取,以指导代码生成与跨层工作负载均衡。
- 通过执行代码生成,将 PCONV 模型映射为高效、硬件感知的内核,充分利用核内与核间稀疏性。
- 通过利用硬件特性(如内存访问模式与并行性)对移动平台进行优化,尤其针对 CPU 和 Adreno 640 GPU。
实验结果
研究问题
- RQ1能否设计一种新的稀疏性维度,在 DNN 权重剪枝中实现高精度与硬件效率的平衡?
- RQ2将核内模式剪枝与核间连接性剪枝相结合,是否能优于现有的结构化或非结构化方法?
- RQ3编译器辅助框架能否充分挖掘新型稀疏性结构的潜力,实现在移动设备上的实时推理?
- RQ4不同稀疏性模式的数量如何影响模型精度与推理速度?
- RQ5与最先进的移动推理框架相比,PCONV 框架可实现的最大性能提升是多少?
主要发现
- 在移动 GPU 上,PCONV 对 VGG-16 的推理速度相比 TensorFlow-Lite 最高提升 39.2×,且无精度损失。
- 在移动 CPU 上,PCONV 相比 TFLite 加速 9.4× 至 39.2×,相比 TVM 加速 2.2× 至 5.1×,相比 MNN 加速 1.7× 至 6.3×。
- 在 GPU 上,PCONV 相比 TFLite 加速 2.2× 至 18.0×,相比 TVM 加速 2.5× 至 11.4×,相比 MNN 加速 1.5× 至 5.8×。
- 在 ImageNet 上的 VGG-16 模型,PCONV 在 GPU 上的推理耗时为 19.1ms,达到每秒 52.4 帧,满足实时性要求。
- 在 VGG-16 的 9 种层类型中,PCONV 在 CPU 和 GPU 上的 GFLOPS 性能均优于 MNN,表现出更高的吞吐量。
- 当使用设计好的 SCP 模式时,模式数量对精度影响极小(精度损失 ≤0.3%);但若使用随机模式,性能会显著下降。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。