[论文解读] DepthShrinker: A New Compression Paradigm Towards Boosting Real-Hardware Efficiency of Compact Neural Networks
DepthShrinker 提出了一种新颖的压缩范式,通过在识别并移除非必要激活函数后,将倒残差块中的连续层——特别是逐通道卷积和逐点卷积——合并为单一的密集卷积,从而提升紧凑神经网络在真实硬件上的效率。该方法在 Tesla V100 上将硬件利用率和吞吐量最高提升 1.53 倍,同时相比最先进通道剪枝方法准确率提升 3.06%。
Efficient deep neural network (DNN) models equipped with compact operators (e.g., depthwise convolutions) have shown great potential in reducing DNNs' theoretical complexity (e.g., the total number of weights/operations) while maintaining a decent model accuracy. However, existing efficient DNNs are still limited in fulfilling their promise in boosting real-hardware efficiency, due to their commonly adopted compact operators' low hardware utilization. In this work, we open up a new compression paradigm for developing real-hardware efficient DNNs, leading to boosted hardware efficiency while maintaining model accuracy. Interestingly, we observe that while some DNN layers' activation functions help DNNs' training optimization and achievable accuracy, they can be properly removed after training without compromising the model accuracy. Inspired by this observation, we propose a framework dubbed DepthShrinker, which develops hardware-friendly compact networks via shrinking the basic building blocks of existing efficient DNNs that feature irregular computation patterns into dense ones with much improved hardware utilization and thus real-hardware efficiency. Excitingly, our DepthShrinker framework delivers hardware-friendly compact networks that outperform both state-of-the-art efficient DNNs and compression techniques, e.g., a 3.06% higher accuracy and 1.53$ imes$ throughput on Tesla V100 over SOTA channel-wise pruning method MetaPruning. Our codes are available at: https://github.com/facebookresearch/DepthShrinker.
研究动机与目标
- 为解决紧凑 DNN 中理论效率与真实硬件效率之间的差距,该差距源于如逐通道卷积等不规则操作的低硬件利用率。
- 探究在不损失精度的前提下,是否可在训练后移除高效 DNN 模块中的激活函数,从而实现层的合并。
- 开发一种新的压缩范式,通过将不规则且低利用率的操作转换为密集、高度可并行化的层,从而提升硬件利用率。
- 在保持高模型精度的同时实现卓越的硬件效率,超越现有的剪枝与压缩技术。
- 在包括 GPU、边缘设备和 CPU 在内的多种硬件平台上展示方法的通用性。
提出的方法
- 识别并移除高效 DNN 模块(如倒残差结构)中对推理精度无影响的中间层激活函数。
- 将剩余的线性操作——逐点卷积与逐通道卷积——合并为一个具有等效感受野和通道维度的单一密集卷积。
- 使用可微搜索机制自动识别训练过程中可安全移除的激活函数。
- 采用“扩展-再压缩”策略,通过先扩展网络并引入自由激活函数,再通过 DepthShrinker 流程剪枝,以增强训练稳定性。
- 将生成的模型转换为 ONNX 和 TFLite 格式,用于在 Pixel 3 和 Raspberry Pi 4 等基于 CPU 的边缘设备上进行评估。
- 利用密集卷积带来的更优数据重用与并行性,最大化现代加速器上的硬件利用率。
实验结果
研究问题
- RQ1在高效 DNN 模块中,是否可在训练后移除激活函数而不降低模型精度?
- RQ2是否可通过将连续的线性层(如逐通道与逐点卷积)合并为单一密集层,来提升硬件利用率和实际推理速度?
- RQ3所提出的 DepthShrinker 框架是否在精度与吞吐量方面均优于现有的通道剪枝与层剪枝方法?
- RQ4DepthShrinker 方法是否可在包括 CPU 和边缘设备在内的多种硬件平台上实现泛化?
- RQ5“扩展-再压缩”训练策略是否能提升 MobileNetV2 和 VGG11 等紧凑模型的性能?
主要发现
- 与 SOTA 通道剪枝方法 MetaPruning 相比,DepthShrinker 在 Tesla V100 上实现了 1.53 倍更高的吞吐量和 3.06% 更高的 top-1 准确率。
- 在 RTX 2080Ti GPU 上,DepthShrinker 相比随机搜索基线在准确率上提升 4.30–5.46%,吞吐量提升 1.19–1.24 倍。
- 在 CPU 设备上,DepthShrinker 在 Raspberry Pi 4 上将延迟降低最多 43.1%,在 Google Pixel 3 上降低最多 38.4%,且精度保持相当。
- “扩展-再压缩”策略在 ImageNet 上的 VGG11、VGG13、MCUNet 和 MobileNetV2 上均使准确率提升 1.26–1.62%。
- 由于密集卷积带来的更优数据重用与并行性,该方法在包括 GPU、边缘 GPU 和移动 CPU 在内的多种平台中均持续提升硬件效率。
- 实验结果证实,移除某些激活函数不会损害精度,从而可安全地将层合并为密集操作。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。