Skip to main content
QUICK REVIEW

[Paper 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 ApplicationsComputer Science38 references5 citations
TL;DR

This paper proposes CPO and CPS, two novel convolution algorithms for deep CNN inference that exploit activation map sparsity and local patterns to reduce memory usage and accelerate computation. By compressing non-zero elements and skipping zero channels via sparse matrix-vector multiplication, the methods achieve up to 63% faster inference and 26x compression ratio compared to im2col, with end-to-end savings of 9% and 10x average compression across layers.

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.

Motivation & Objective

  • Address the high memory and computational cost of convolution in deep CNNs, especially on resource-constrained devices.
  • Overcome inefficiencies in standard lowering-based methods like im2col and MEC that redundantly store zero and overlapping non-zero elements.
  • Leverage the sparsity of ReLU-activated feature maps and local patterns of non-zero elements to design memory- and time-efficient convolution algorithms.
  • Develop a hybrid selection strategy to dynamically choose the optimal convolution method per layer, maximizing inference speed and compression.

Proposed method

  • Propose Compressed Pattern Overlap (CPO), which identifies non-zero elements (NZEs) at horizontal and vertical kernel overlaps in activation maps and stores them in a compressed sparse format.
  • Introduce Compressed Pattern Sets (CPS), which further compresses CPO by encoding index patterns of neighboring NZEs to reduce storage overhead.
  • Incorporate skip flags to bypass entire channels or regions with all-zero values, eliminating unnecessary computation and storage.
  • Perform convolution using Sparse Matrix-Vector Multiplication (SpMv) on the compressed representations, focusing only on non-zero contributions.
  • Implement an offline hybrid selection method that benchmarks im2col, CPO, and CPS on a small image set to select the fastest algorithm per layer for end-to-end inference.
  • Use a modified encoder and convolution kernel tailored for the special case of kernel width $K_w = 1$, simplifying implementation while preserving performance.

Experimental results

Research questions

  • RQ1Can sparsity and local patterns in ReLU-activated feature maps be exploited to reduce memory footprint and accelerate convolution in CNN inference?
  • RQ2How do CPO and CPS compare to standard methods like im2col and MEC in terms of memory compression and inference speed?
  • RQ3Can a hybrid selection strategy that chooses the optimal algorithm per layer yield measurable improvements in end-to-end inference performance?
  • RQ4To what extent do sparsity and spatial clustering of non-zero elements enable further compression beyond standard sparse representations?
  • RQ5What is the practical trade-off between compression ratio and inference speed when applying pattern-aware compression to real CNNs?

Key findings

  • CPO and CPS achieve up to 63% per-layer time savings and 26x compression ratio compared to im2col on CPU-based inference.
  • In some layers, CPO/CPS outperform the parallel MEC implementation by 28% in time and 9.2x in compression ratio.
  • For end-to-end inference, the hybrid selection method yields up to 9% reduction in total inference time and an average compression ratio of 10x across layers.
  • The proposed algorithms were selected for up to 56% of non-pointwise convolutional layers in tested models, indicating broad applicability.
  • The stationary nature of activation map density across images enables effective offline algorithm selection without runtime overhead.
  • The use of skip flags for all-zero channels and pattern-based compression of neighboring NZEs significantly reduces redundant storage and computation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.