DNNFusion: Accelerating Deep Neural Networks Execution with Advanced Operator Fusion

被引:68
作者
Niu, Wei [1 ]
Guan, Jiexiong [1 ]
Wang, Yanzhi [2 ]
Agrawal, Gagan [3 ]
Ren, Bin [1 ]
机构
[1] William & Mary, Williamsburg, VA 23185 USA
[2] Northeastern Univ, Boston, MA 02115 USA
[3] Augusta Univ, Augusta, GA USA
来源
PROCEEDINGS OF THE 42ND ACM SIGPLAN INTERNATIONAL CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION (PLDI '21) | 2021年
基金
美国国家科学基金会;
关键词
Compiler Optimization; Operator Fusion; Deep Neural Network; Mobile Devices; TRANSFORMATIONS; OPTIMIZATION; LOCALITY; LOOP;
D O I
10.1145/3453483.3454083
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Deep Neural Networks (DNNs) have emerged as the core enabler of many major applications on mobile devices. To achieve high accuracy, DNN models have become increasingly deep with hundreds or even thousands of operator layers, leading to high memory and computational requirements for inference. Operator fusion (or kernel/layer fusion) is key optimization in many state-of-the-art DNN execution frameworks, such as TensorFlow, TVM, and MNN, that aim to improve the efficiency of the DNN inference. However, these frameworks usually adopt fusion approaches based on certain patterns that are too restrictive to cover the diversity of operators and layer connections, especially those seen in many extremely deep models. Polyhedral-based loop fusion techniques, on the other hand, work on a low-level view of the computation without operator-level information, and can also miss potential fusion opportunities. To address this challenge, this paper proposes a novel and extensive loop fusion framework called DNNFusion. The basic idea of this work is to work at an operator view of DNNs, but expand fusion opportunities by developing a classification of both individual operators and their combinations. In addition, DNNFusion includes 1) a novel mathematical-property-based graph rewriting framework to reduce evaluation costs and facilitate subsequent operator fusion, 2) an integrated fusion plan generation that leverages the high-level analysis and accurate light-weight profiling, and 3) additional optimizations during fusion code generation. DNNFusion is extensively evaluated on 15 DNN models with varied types of tasks, model sizes, and layer counts. The evaluation results demonstrate that DNNFusion finds up to 8.8x higher fusion opportunities, outperforms four state-of-the-art DNN execution frameworks with 9.3x speedup. The memory requirement reduction and speedups can enable the execution of many of the target models on mobile devices and even make them part of a real-time application.
引用
收藏
页码:883 / 898
页数:16
相关论文
共 74 条
  • [1] Abadi M, 2016, PROCEEDINGS OF OSDI'16: 12TH USENIX SYMPOSIUM ON OPERATING SYSTEMS DESIGN AND IMPLEMENTATION, P265
  • [2] Effective Loop Fusion in Polyhedral Compilation Using Fusion Conflict Graphs
    Acharya, Aravind
    Bondhugula, Uday
    Cohen, Albert
    [J]. ACM TRANSACTIONS ON ARCHITECTURE AND CODE OPTIMIZATION, 2020, 17 (04)
  • [3] Acharya A, 2018, PROCEEDINGS OF THE 39TH ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION, PLDI 2018, P529, DOI [10.1145/3296979.3192401, 10.1145/3192366.3192401]
  • [4] [Anonymous], 2017, P IEEE INT C COMPUTE
  • [5] Baghdadi R, 2019, INT SYM CODE GENER, P193, DOI [10.5281/zenodo.2375075, 10.1109/CGO.2019.8661197]
  • [6] COMPLEXITY OF MATCHING PROBLEMS
    BENANAV, D
    KAPUR, D
    NARENDRAN, P
    [J]. JOURNAL OF SYMBOLIC COMPUTATION, 1987, 3 (1-2) : 203 - 216
  • [7] Bhattacharya S, 2016, 2016 IEEE INTERNATIONAL CONFERENCE ON PERVASIVE COMPUTING AND COMMUNICATION WORKSHOPS (PERCOM WORKSHOPS)
  • [8] Bochkovskiy C.-Y., 2020, ARXIV, DOI DOI 10.48550/ARXIV.2004.10934
  • [9] On Optimizing Operator Fusion Plans for Large-Scale Machine Learning in SystemML
    Boehm, Matthias
    Reinwald, Berthold
    Hutchison, Dylan
    Sen, Prithviraj
    Evfimievski, Alexandre, V
    Pansare, Niketan
    [J]. PROCEEDINGS OF THE VLDB ENDOWMENT, 2018, 11 (12): : 1755 - 1768
  • [10] A practical automatic polyhedral parallelizer and locality optimizer
    Bondhugula, Uday
    Hartono, Albert
    Ramanujam, J.
    Sadayappan, P.
    [J]. ACM SIGPLAN NOTICES, 2008, 43 (06) : 101 - 113