arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2104.08314cs.CV
收藏

在深度卷积神经网络中使用稀疏性和模式进行推理的高性能卷积

High Performance Convolution Using Sparsity and Patterns for Inference in Deep Convolutional Neural Networks

University of Waterloo(滑铁卢大学);University of Toronto(多伦多大学)

Hossam Amer, Ahmed H. Salamah, Ahmad Sajedi, En-hui Yang

摘要:

部署深度卷积神经网络(CNN)受到其内存占用和速度要求的影响,这些要求主要来自卷积。广泛使用的卷积算法im 2col和MEC通过冗余地存储包括在水平和/或垂直内核扩展中的映射的元素而不考虑映射的稀疏性来从激活映射产生降低的矩阵。利用映射的稀疏性,本文提出了两种新的卷积算法,称为压缩模式重叠(CPO)和压缩模式集(CPS),同时减少内存占用,提高推理速度,同时保持准确性。CPO识别激活图中水平和垂直方向上的非零元素(NZE)。CPS通过压缩相邻NZE的索引位置进一步提高了CPO的内存节省。在这两种算法中,跳过了具有全零的激活图的通道/区域。然后,CPO/CPS通过稀疏矩阵向量乘法(SpMv)对它们的稀疏表示进行卷积。在CPU上进行的实验结果表明,平均每层时间节省高达63%,压缩比(CR)高达26倍,相对于im 2col。在某些层中,我们的平均每层CPO/CPS时间节省了28%,CR比MEC的并行实现好9.2倍。对于给定的CNN的推理,我们为每个卷积层离线选择CPO或CPS与im 2col之间的时间方面的最佳卷积算法。我们的算法选择了高达56%的非逐点卷积层。我们的离线选择产生CNN推理时间节省高达9%和CR高达10倍。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑