Optimization of Convolution Computation Based on CPU
In convolutional neural networks (CNNs), con-volution is one of the core computations, with most of the network's time spent on convolution calculations. Therefore, optimizing the efficiency of convolution computations is partic-ularly important in resource-constrained environments. CPUs are widely used across various devices, including cloud servers, edge devices, and mobile platforms. These devices do not always have access to dedicated GPUs, so efficient CPU-based convolutions enable the implementation of complex algorithms for low-latency, real-time inference on low-power platforms. In this paper, we propose an improved img2col+GEMM(General Matrix Multiply) convolutional optimization method based on the open-source library OpenBLAS. By leveraging In-tel AVX512 vectorization instructions and assembly-level in-struction reordering, we present a high-performance micro-kernel to optimize the GEMM operator. Additionally, we implement data reordering and memory alignment operations in the img2col process based on the aforementioned micro-kernel parameters, directly placing them into the buff of the GEMM process to save memory usage and access operations. Combining our micro-kernel with the OpenBLAS library, we achieve 98% of the performance of Intel's MKL on Intel CPUs, with a 10% to 15% performance improvement over OpenBLAS. The improved img2col method shows approximately a 16% enhancement in convolution speed compared to the standard img2col+GEMM approach.
Authors
- Long Guo
- Wei Ge (ORCID: https://orcid.org/0000-0002-3771-431X)
- Shuang Li (ORCID: https://orcid.org/0000-0001-9142-5036)
- JunJie Di
Institutions
- Harbin Engineering University (CN)
Publication Details
- Published
- 2024-12-20
- DOI
- https://doi.org/10.1109/acai63924.2024.10899500
- Primary Topic
- Advanced Algorithms and Applications
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Fundamental Research Funds for the Central Universities