间接卷积算法
The Indirect Convolution Algorithm
摘要:
深度学习框架通常使用基于GEMM的算法来实现卷积运算符。在这些算法中,卷积是在高度优化的BLAS库提供的矩阵-矩阵乘法(GEMM)函数之上实现的。使用1x 1内核的卷积可以直接表示为GEMM调用,但使用较大内核的卷积需要特殊的内存布局转换-im 2col或im 2 row-以适应GEMM接口。间接卷积算法提供了GEMM原语的效率,而没有im 2col转换的开销。与基于GEMM的算法相比,间接卷积不会重新排列数据以适应GEMM原语,而是引入间接缓冲区-指向每行图像像素开始的指针缓冲区。这将我们修改后的GEMM函数的应用扩展到具有任意内核大小、填充、步幅和膨胀的卷积。间接卷积算法可根据输入通道数按比例减少内存开销,并且在基于GEMM的算法中涉及im 2col变换的卷积参数方面,其性能最高可超过基于GEMM的算法62%。然而,这是以1x 1步幅-1卷积的轻微性能降低为代价的。
英文摘要:
Deep learning frameworks commonly implement convolution operators with GEMM-based algorithms. In these algorithms, convolution is implemented on top of matrix-matrix multiplication (GEMM) functions, provided by highly optimized BLAS libraries. Convolutions with 1x1 kernels can be directly represented as a GEMM call, but convolutions with larger kernels require a special memory layout transformation - im2col or im2row - to fit into GEMM interface. The Indirect Convolution algorithm provides the efficiency of the GEMM primitive without the overhead of im2col transformation. In contrast to GEMM-based algorithms, the Indirect Convolution does not reshuffle the data to fit into the GEMM primitive but introduces an indirection buffer - a buffer of pointers to the start of each row of image pixels. This broadens the application of our modified GEMM function to convolutions with arbitrary kernel size, padding, stride, and dilation. The Indirect Convolution algorithm reduces memory overhead proportionally to the number of input channels and outperforms the GEMM-based algorithm by up to 62% on convolution parameters which involve im2col transformations in GEMM-based algorithms. This, however, comes at cost of minor performance reduction on 1x1 stride-1 convolutions.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。