Andrew Anderson, Aravind Vasudevan, Cormac Keane, David Gregg
{"title":"High-Performance Low-Memory Lowering: GEMM-based Algorithms for DNN Convolution","authors":"Andrew Anderson, Aravind Vasudevan, Cormac Keane, David Gregg","doi":"10.1109/SBAC-PAD49847.2020.00024","DOIUrl":null,"url":null,"abstract":"Deep Neural Network Convolution is often implemented with general matrix multiplication ( GEMM ) using the well-known im2col algorithm. This algorithm constructs a Toeplitz matrix from the input feature maps, and multiplies them by the convolutional kernel. With input feature map dimensions C × H × W and kernel dimensions M × C × K^2, im2col requires O(K^2CHW ) additional space. Although this approach is very popular, there has been little study of the associated design space. We show that the im2col algorithm is just one point in a regular design space of algorithms which translate convolution to GEMM. We enumerate this design space, and experimentally evaluate each algorithmic variant. Our evaluation yields several novel low-memory algorithms which match the performance of the best known approaches despite requiring only a small fraction of the additional memory.","PeriodicalId":202581,"journal":{"name":"2020 IEEE 32nd International Symposium on Computer Architecture and High Performance Computing (SBAC-PAD)","volume":"25 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"13","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2020 IEEE 32nd International Symposium on Computer Architecture and High Performance Computing (SBAC-PAD)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SBAC-PAD49847.2020.00024","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 13
Abstract
Deep Neural Network Convolution is often implemented with general matrix multiplication ( GEMM ) using the well-known im2col algorithm. This algorithm constructs a Toeplitz matrix from the input feature maps, and multiplies them by the convolutional kernel. With input feature map dimensions C × H × W and kernel dimensions M × C × K^2, im2col requires O(K^2CHW ) additional space. Although this approach is very popular, there has been little study of the associated design space. We show that the im2col algorithm is just one point in a regular design space of algorithms which translate convolution to GEMM. We enumerate this design space, and experimentally evaluate each algorithmic variant. Our evaluation yields several novel low-memory algorithms which match the performance of the best known approaches despite requiring only a small fraction of the additional memory.
深度神经网络卷积通常使用通用矩阵乘法(GEMM)实现,使用著名的im2col算法。该算法从输入特征映射中构造Toeplitz矩阵,并将其与卷积核相乘。输入特征映射的维度为C × H × W,内核的维度为M × C × K^2, im2col需要O(K^2CHW)的额外空间。尽管这种方法非常流行,但对相关设计空间的研究却很少。我们证明了im2col算法只是将卷积转换为GEMM的算法的规则设计空间中的一个点。我们列举了这个设计空间,并实验评估了每个算法变体。我们的评估产生了几种新的低内存算法,它们的性能与最知名的方法相匹配,尽管只需要一小部分额外的内存。