Page 323 - 《软件学报》2020年第9期
P. 323

软件学报 ISSN 1000-9825, CODEN RUXUEW                                        E-mail: jos@iscas.ac.cn
         Journal of Software,2020,31(9):2944−2964 [doi: 10.13328/j.cnki.jos.006051]   http://www.jos.org.cn
         ©中国科学院软件研究所版权所有.                                                          Tel: +86-10-62562563


                                                                 ∗
         面向稀疏卷积神经网络的 GPU 性能优化方法

                               1
                       1
               1,2
         董   晓 ,   刘   雷 ,   李   晶 ,   冯晓兵  1,2
         1
          (计算机体系结构国家重点实验室(中国科学院  计算技术研究所),北京  100190)
         2 (中国科学院大学,北京  100190)
         通讯作者:  刘雷, E-mail: liulei@ict.ac.cn

         摘   要:  近些年来,深度卷积神经网络在多项任务中展现了惊人的能力,并已经被用在物体检测、自动驾驶和机器
         翻译等众多应用中.但这些模型往往参数规模庞大,并带来了沉重的计算负担.神经网络的模型剪枝技术能够识别并
         删除模型中对精度影响较小的参数,从而降低模型的参数数目和理论计算量,给模型的高效执行提供了机会.然而,
         剪枝后的稀疏模型却难以在 GPU 上实现高效执行,其性能甚至差于剪枝前的稠密模型,导致模型剪枝难以带来真正
         的执行性能收益.提出一种稀疏感知的代码生成方法,能够生成高效的稀疏卷积 GPU 程序.首先为卷积算子设计了
         算子模板,并结合 GPU 的特点对模板代码进行了多种优化.算子模板中的源代码经过编译和分析被转换为算子中间
         表示模板,设计了一种稀疏代码生成方法,能够结合剪枝后的稀疏参数,基于中间表示模板生成对应的稀疏卷积代
         码.同时,利用神经网络执行过程中的数据访问特点对数据的访问和放置进行了优化,有效提升了访存吞吐量.最后,
         稀疏参数的位置信息被隐式编码在生成的代码中,不需要额外的索引结构,降低了访存需求.在实验中证明了:相对
         于 GPU 上已有的稀疏神经网络执行方法,提出的稀疏感知的代码生成方法能够有效提升稀疏卷积神经网络的性能.
         关键词:  神经网络;稀疏;GPU;性能优化;卷积;代码生成
         中图法分类号: TP303

         中文引用格式:  董晓,刘雷,李晶,冯晓兵.面向稀疏卷积神经网络的 GPU 性能优化方法.软件学报,2020,31(9):2944−2964.
         http://www.jos.org.cn/1000-9825/6051.htm
         英文引用格式: Dong X, Liu L, Li J, Feng XB. Performance optimizing method for sparse convolutional neural networks on GPU.
         Ruan Jian Xue Bao/Journal of Software, 2020,31(9):2944−2964 (in Chinese). http://www.jos.org.cn/1000-9825/6051.htm
         Performance Optimizing Method for Sparse Convolutional Neural Networks on GPU

                   1,2
                             1
                                     1
         DONG Xiao ,  LIU Lei ,  LI Jing ,  FENG Xiao-Bing 1,2
         1 (State Key Laboratory of Computer Architecture (Institute of Computing Technology, Chinese Academy of Sciences), Beijing 100190,
          China)
         2 (University of Chinese Academy of Sciences, Beijing 100190, China)
         Abstract:    In recent years, with dominating capability shown in plenty of tasks, deep convolutional neural networks have been deployed
         in applications  including  object  detection, autonomous  driving, machine translation, etc. But  these models are accompanied  by  huge
         amounts of parameters  and bring  a  heavy  computational burden.  The neural network pruning technique  can recognize  and remove
         parameters  that  contribute little  to the  accuracy, resulting in  reduced  amounts of parameters  and decreased theoretical  computational
         requirement, thus providing a chance to accelerate neural network models. However, it is hard for the pruned sparse models to achieve
         efficient execution on GPUs, and the performance of sparse models cannot even match their well-optimized dense counterparts. This study
         designs a  sparsity-aware code  generating method, which can  generate efficient  GPU code  for  sparse convolutions  in  pruned neural

            ∗  基金项目:  国家自然科学基金(61521092);  国家重点研发计划(2017YFB1003103)
              Foundation item: National Natural Science Foundation of China (61521092); National Key Research and Development Program of
         China (2017YFB 1003103)
              收稿时间:   2019-10-05;  修改时间: 2020-01-13, 2020-03-17;  采用时间: 2020-04-01; jos 在线出版时间: 2020-04-21
   318   319   320   321   322   323   324   325   326   327   328