[Paper Review] Parallel Multi Channel Convolution using General Matrix Multiplication
This paper proposes a GEMM-based approach to multi-channel multi-kernel (MCMK) convolution that avoids the memory-expensive im2col transformation by operating directly on non-replicated input images. By restructuring convolution as a sequence of GEMM operations with improved data locality, the method achieves faster inference than im2col on both CPU and embedded ARM processors across diverse CNN architectures.
Convolutional neural networks (CNNs) have emerged as one of the most successful machine learning technologies for image and video processing. The most computationally intensive parts of CNNs are the convolutional layers, which convolve multi-channel images with multiple kernels. A common approach to implementing convolutional layers is to expand the image into a column matrix (im2col) and perform Multiple Channel Multiple Kernel (MCMK) convolution using an existing parallel General Matrix Multiplication (GEMM) library. This im2col conversion greatly increases the memory footprint of the input matrix and reduces data locality. In this paper we propose a new approach to MCMK convolution that is based on General Matrix Multiplication (GEMM), but not on im2col. Our algorithm eliminates the need for data replication on the input thereby enabling us to apply the convolution kernels on the input images directly. We have implemented several variants of our algorithm on a CPU processor and an embedded ARM processor. On the CPU, our algorithm is faster than im2col in most cases.
Motivation & Objective
- To address the high memory footprint and poor data locality caused by the im2col transformation in deep learning frameworks.
- To enable efficient use of optimized GEMM libraries for MCMK convolution without data replication.
- To improve performance on memory-constrained systems such as embedded processors by reducing memory traffic and increasing data reuse.
- To evaluate the performance of GEMM-based MCMK convolution across different CNN layers and hardware platforms.
- To develop a cost model for selecting optimal MCMK convolution implementations based on architectural context.
Proposed method
- The method formulates MCMK convolution as one or more GEMM operations without expanding the input into a column matrix, avoiding data replication.
- It introduces the kn2row algorithm, which performs a single GEMM call and applies a post-processing accumulation step to combine partial results.
- The approach maintains direct access to input feature maps, preserving spatial locality and reducing memory traffic.
- Multiple variants of the method are implemented and tuned for CPU and ARM Cortex-A57 processors using highly optimized GEMM libraries.
- The method leverages existing, pre-tuned GEMM routines to exploit hardware-level parallelism and memory hierarchy effectively.
- The design avoids the Toeplitz matrix construction of im2col, instead mapping convolution operations directly to GEMM with minimal data movement.
Experimental results
Research questions
- RQ1Can MCMK convolution be efficiently implemented using GEMM without the im2col transformation, thereby reducing memory footprint and improving data locality?
- RQ2How does the performance of GEMM-based MCMK convolution compare to im2col across different CNN architectures and hardware platforms?
- RQ3Which GEMM-based MCMK variant achieves the best performance on CPU and embedded ARM processors?
- RQ4Does the performance of GEMM-based MCMK convolution vary significantly across different layers of a CNN, such as early vs. late layers?
- RQ5What factors determine the optimal choice of MCMK implementation for a given hardware and network configuration?
Key findings
- The proposed GEMM-based MCMK convolution methods outperform im2col in the majority of tested scenarios on both CPU and ARM processors.
- On the Intel i5-4570 CPU, the new methods achieve faster inference than im2col across most network layers and kernel sizes.
- On the ARM Cortex-A57 embedded processor, the GEMM-based approaches significantly reduce memory pressure and improve performance compared to im2col.
- Performance varies substantially across different CNN layers, with no single method being universally optimal.
- The kn2row variant, which uses a single GEMM call followed by accumulation, achieves high data locality and strong performance.
- The results highlight the need for a cost model to guide the selection of MCMK convolution implementations based on hardware and network context.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.