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 条
  • [31] Improving locality using loop and data transformations in an integrated framework
    Kandemir, M
    Choudhary, A
    Ramanujam, J
    Banerjee, P
    [J]. 31ST ANNUAL ACM/IEEE INTERNATIONAL SYMPOSIUM ON MICROARCHITECTURE, PROCEEDINGS, 1998, : 285 - 296
  • [32] Kennedy K., 1994, Languages and Compilers for Parallel Computing. 6th International Workshop Proceedings, P301
  • [33] Kjolstad F, 2019, INT SYM CODE GENER, P180, DOI [10.1109/cgo.2019.8661185, 10.1109/CGO.2019.8661185]
  • [34] Kjolstad F, 2017, P ACM PROGRAM LANG, V1, DOI 10.1145/3133901
  • [35] When Polyhedral Transformations Meet SIMD Code Generation
    Kong, Martin
    Veras, Richard
    Stock, Kevin
    Franchetti, Franz
    Pouchet, Louis-Noel
    Sadayappan, P.
    [J]. ACM SIGPLAN NOTICES, 2013, 48 (06) : 127 - 138
  • [36] KOUNALIS E, 1991, LECT NOTES COMPUT SC, V493, P57
  • [37] Krebber Manuel, 2017, ARXIV PREPRINT ARXIV
  • [38] Kyrtatas N, 2015, DES AUT TEST EUROPE, P1054
  • [39] Lan Z., 2019, INT C LEARN REPR
  • [40] Lattner Chris, 2020, MLIR COMPILER INFRAS