一句话:提出 SoD2 框架,通过秩与维度传播静态确定动态 DNN 算子形状,实现融合代码生成、执行规划与内存分配优化。
动态 DNN 的张量形状、大小乃至算子集合可能依赖输入或执行,而现有编译与运行时系统主要面向静态 DNN。本文提出 SoD2 框架:先对常见 DNN 算子进行分类,并基于分类设计秩与维度传播(RDP)方法,将算子形状静态判定为已知常量、符号常量或对这些量的操作。利用 RDP,SoD2 进一步支持融合代码生成、执行顺序规划以及运行时内存分配计划生成。作者在 10 个新兴动态 DNN 上与多个现有系统对比,最高实现 3.9 倍执行加速,并减少 88% 峰值内存,RDP 支持的关键优化贡献了主要收益。
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 SoD2, 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 SoD2 runs up to 3.9× faster than these systems while saving up to 88% peak memory consumption.