作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2019, Vol. 45 ›› Issue (7): 217-221,228. doi: 10.19678/j.issn.1000-3428.0051507

• 人工智能及识别技术 • 上一篇    下一篇

基于矩阵转换的卷积计算优化方法

方玉玲a, 陈庆奎a,b   

  1. 上海理工大学 a. 管理学院;b. 光电信息与计算机工程学院, 上海 200093
  • 收稿日期:2018-05-09 修回日期:2018-06-11 出版日期:2019-07-15 发布日期:2019-07-23
  • 作者简介:方玉玲(1990-),女,博士研究生,主研方向为计算机视觉、并行计算、GPU集群可靠性分析;陈庆奎,教授、博士、博士生导师。
  • 基金资助:
    国家自然科学基金(61572325,60970012);高等学校博士学科点专项科研博导基金(20113120110008);上海重点科技攻关项目(14511107902,16DZ1203603);上海市工程中心建设项目(GCZX14014);上海智能家居大规模物联共性技术工程中心项目(GCZX14014);上海市一流学科建设项目(XTKX2012);沪江基金研究基地专项(C14001)。

Convolution Calculation Optimization Method Based on Matrix Transformation

FANG Yulinga, CHEN Qingkuia,b   

  1. a. Business School;b. School of Optical-Electrical and Computer Engineering, University of Shanghai for Science and Technology, Shanghai 200093, China
  • Received:2018-05-09 Revised:2018-06-11 Online:2019-07-15 Published:2019-07-23

摘要: 提出一种基于矩阵转换的高效卷积计算优化方法MCFA。根据输出矩阵的宽度和卷积核大小对输入矩阵进行分块,通过im2col方法转换输入矩阵子块和核函数矩阵,利用计算统一设备架构中封装的矩阵-矩阵乘法加速库提升卷积计算的速度。在此基础上,将输出子块按序排列,最终得到完整的输出矩阵。实验结果证明,该方法相比im2col方法能节省61.25%的计算空间,相比MEC方法能提高20.57%的计算速度,且在分块情况下可以缓解大输入矩阵引起的缓存压力,提高缓存利用率。

关键词: 深度学习, 卷积计算, 直接卷积, 矩阵分块, 计算统一设备架构, 卷积优化

Abstract: An efficient convolution calculation optimization method MCFA based on matrix transformation is proposed.The input matrix is divided into blocks according to the width and the convolution core size of the output matrix.The input matrix sub-blocks and the core function matrix are transformed by im2col method.The matrix-matrix multiplication library encapsulated in the Computing Unified Device Architecture(CUDA) is used to speed up the convolution calculation.On this basis,the output sub-blocks are arranged in order,and the complete output matrix is finally obtained.Experimental results show that this method can save 61.25% of the computing space compared with im2col method,improve 20.57% of the computing speed compared with MEC method,and relieve the cathe pressure caused by large input matrix in the case of block,thus improve the cache utilization.

Key words: deep learning, convolution calculation, direct convolution, matrix blocking, Computing Unified Device Architecture(CUDA), convolution optimization

中图分类号: