Skip to main content
QUICK REVIEW

[论文解读] High Performance Convolution Using Sparsity and Patterns for Inference in Deep Convolutional Neural Networks

Hossam Amer, Ahmed H. Salamah|arXiv (Cornell University)|Apr 16, 2021
Advanced Neural Network Applications参考文献 38被引用 5
一句话总结

本文提出CPO和CPS两种新型卷积算法,用于深度CNN推理,通过利用激活图的稀疏性和局部模式,减少内存占用并加速计算。通过压缩非零元素并利用稀疏矩阵-向量乘法跳过零通道,该方法相较im2col实现最高63%的推理加速和26倍的压缩比,在各层上实现平均9%的端到端时间节省和10倍的压缩率。

ABSTRACT

Deploying deep Convolutional Neural Networks (CNNs) is impacted by their memory footprint and speed requirements, which mainly come from convolution. Widely-used convolution algorithms, im2col and MEC, produce a lowered matrix from an activation map by redundantly storing the map's elements included at horizontal and/or vertical kernel overlappings without considering the sparsity of the map. Using the sparsity of the map, this paper proposes two new convolution algorithms dubbed Compressed Pattern Overlap (CPO) and Compressed Pattern Sets (CPS) that simultaneously decrease the memory footprint and increase the inference speed while preserving the accuracy. CPO recognizes non-zero elements (NZEs) at horizontal and vertical overlappings in the activation maps. CPS further improves the memory savings of CPO by compressing the index positions of neighboring NZEs. In both algorithms, channels/regions of the activation maps with all zeros are skipped. Then, CPO/CPS performs convolution via Sparse Matrix-Vector Multiplication (SpMv) done on their sparse representations. Experimental results conducted on CPUs show that average per-layer time savings reach up to 63% and Compression Ratio (CR) up to 26x with respect to im2col. In some layers, our average per layer CPO/CPS time savings are better by 28% and CR is better by 9.2x than the parallel implementation of MEC. For a given CNN's inference, we offline select for each convolution layer the best convolutional algorithm in terms of time between either CPO or CPS and im2col. Our algorithms were selected up to 56% of the non-pointwise convolutional layers. Our offline selections yield CNN inference time savings up to 9% and CR up to 10x.

研究动机与目标

  • 解决深度CNN中卷积的高内存和计算成本,特别是在资源受限设备上的问题。
  • 克服im2col和MEC等标准lowering方法的低效性,这些方法冗余地存储零值和重叠的非零元素。
  • 利用ReLU激活特征图的稀疏性以及非零元素的局部模式,设计内存和时间效率更高的卷积算法。
  • 开发一种混合选择策略,按层动态选择最优卷积方法,以最大化推理速度和压缩率。

提出的方法

  • 提出压缩模式重叠(CPO),识别激活图中卷积核在水平和垂直方向上的重叠非零元素(NZEs),并以压缩稀疏格式存储。
  • 引入压缩模式集合(CPS),通过编码相邻NZEs的索引模式,进一步压缩CPO,降低存储开销。
  • 引入跳过标志,用于跳过全零值的通道或区域,消除不必要的计算和存储。
  • 在压缩表示上使用稀疏矩阵-向量乘法(SpMv)执行卷积,仅聚焦于非零贡献。
  • 实现一种离线混合选择方法,在小规模图像集上对im2col、CPO和CPS进行基准测试,为每层选择最快算法以实现端到端推理。
  • 使用针对卷积核宽度$K_w = 1$这一特殊情况定制的编码器和卷积核,简化实现同时保持性能。

实验结果

研究问题

  • RQ1ReLU激活特征图中的稀疏性和局部模式是否可被利用以减少CNN推理中的内存占用并加速卷积?
  • RQ2CPO和CPS在内存压缩和推理速度方面与im2col和MEC等标准方法相比如何?
  • RQ3一种按层动态选择最优算法的混合选择策略是否能显著提升端到端推理性能?
  • RQ4非零元素的稀疏性和空间聚类性在多大程度上可实现超越标准稀疏表示的进一步压缩?
  • RQ5在真实CNN中应用模式感知压缩时,压缩比与推理速度之间的实际权衡如何?

主要发现

  • CPO和CPS在基于CPU的推理中相较im2col实现最高63%的单层时间节省和26倍的压缩比。
  • 在某些层中,CPO/CPS相比并行MEC实现高出28%的推理速度和9.2倍的压缩比。
  • 在端到端推理中,混合选择方法实现总推理时间最高9%的减少,各层平均压缩比达10倍。
  • 在测试模型中,所提算法被选用于高达56%的非逐点卷积层,表明其广泛应用潜力。
  • 激活图密度在图像间具有稳定特性,使得无需运行时开销即可实现有效的离线算法选择。
  • 对全零通道使用跳过标志,以及对相邻NZEs进行基于模式的压缩,显著减少了冗余存储和计算。

更好的研究,从现在开始

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

无需绑定信用卡

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