SoD$^2$:静态优化动态深度神经网络
SoD$^2$: Statically Optimizing Dynamic Deep Neural Network
AI总结:
本文提出 SoD$^2$ 框架,通过算子分类与秩和维度传播静态推断动态 DNN 形状,并支持代码融合、执行规划和内存分配优化,在10个模型上最高提速3.9倍并节省88%峰值内存。
摘要:
尽管近年来已经为 DNN 开发了许多编译和运行时系统,但其关注点主要集中在静态 DNN 上。动态 DNN 中正变得越来越普遍,在这类网络中,张量的形状和大小,甚至所使用的算子集合,都取决于输入和/或执行过程。本文提出了 SoD$^2$,一个用于优化动态 DNN 的综合框架。我们方法的基础是对构成 DNN 的常见算子进行分类,并利用这种分类形成一种秩与维度传播(Rank and Dimension Propagation,RDP)方法。该框架以静态方式将算子的形状确定为已知常量、符号常量,或基于这些量的运算。接下来,利用 RDP,我们实现了一系列优化,例如融合代码生成、执行(顺序)规划,甚至运行时内存分配方案生成。通过在 10 个新兴动态 DNN 上评估该框架,并将其与若干现有系统进行比较,我们证明了执行延迟和内存需求均有所降低,而由 RDP 启用的关键优化贡献了大部分收益。我们的评估结果表明,SoD$^2$ 的运行速度最高可达这些系统的 $3.9\ imes$,同时最高节省 $88\%$ 的峰值内存消耗。
英文摘要:
Though many compilation and runtime systems have been developed for DNNs in recent years, the focus has largely been on static DNNs. Dynamic DNNs, where tensor shapes and sizes and even the set of operators used are dependent upon the input and/or execution, are becoming common. This paper presents SoD$^2$, a comprehensive framework for optimizing Dynamic DNNs. The basis of our approach is a classification of common operators that form DNNs, and the use of this classification towards a Rank and Dimension Propagation (RDP) method. This framework statically determines the shapes of operators as known constants, symbolic constants, or operations on these. Next, using RDP we enable a series of optimizations, like fused code generation, execution (order) planning, and even runtime memory allocation plan generation. By evaluating the framework on 10 emerging Dynamic DNNs and comparing it against several existing systems, we demonstrate both reductions in execution latency and memory requirements, with RDP-enabled key optimizations responsible for much of the gains. Our evaluation results show that SoD$^2$ runs up to $3.9\times$ faster than these systems while saving up to $88\%$ peak memory consumption.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。