[论文解读] Marvel: A Data-centric Compiler for DNN Operators on Spatial Accelerators
Marvel 是一个以数据为中心的编译器,利用 Maestro 数据中心(MDC)表示法正式表征 DNN 算子,并在空间加速器上实现高效、可扩展的最优映射搜索。通过将映射空间分解为片外和片内子空间,并利用 MDC 的可分析成本模型,Marvel 将搜索空间减少了高达 $O(10^{10})$,与先前最先进的映射器相比,吞吐量几何平均提升 10.25 倍,能耗降低 2.01 倍。
The efficiency of a spatial DNN accelerator depends heavily on the compiler and its cost model ability to generate optimized mappings for various operators of DNN models on to the accelerator's compute and memory resources. But, existing cost models lack a formal boundary over the operators for precise and tractable analysis, which poses adaptability challenges for new DNN operators. To address this challenge, we leverage the recently introduced Maestro Data-Centric (MDC) notation. We develop a formal understanding of DNN operators whose mappings can be described in the MDC notation, because any mapping adhering to the notation is always analyzable by the MDC's cost model. Furthermore, we introduce a transformation for translating mappings into the MDC notation for exploring the mapping space. Searching for the optimal mappings is challenging because of the large space of mappings, and this challenge gets exacerbated with new operators and diverse accelerator configurations.To address this challenge, we propose a decoupled off-chip/on-chip approach that decomposes the mapping space into off-chip and on-chip subspaces, and first optimizes the off-chip subspace followed by the on-chip subspace. The motivation for this decomposition is to reduce the size of the search space dramatically and also to prioritize the optimization of off-chip data movement, which is 2-3 orders of magnitude more compared to the on-chip data movement. We implemented our approach in a tool called {\em Marvel}, and another major benefit of our approach is that it is applicable to any DNN operator conformable with the MDC notation.
研究动机与目标
- 为解决现有 DNN 算子映射成本模型缺乏形式化边界的缺陷,该缺陷限制了其对新算子和加速器配置的适应能力。
- 开发一种对 DNN 算子的正式表征方法,其映射可表示为 Maestro 数据中心(MDC)表示法,从而实现精确且可处理的分析。
- 提出一种转换机制,将基于循环嵌套的算子映射转换为 MDC 表示法,以实现对映射空间的更广泛探索。
- 提出一种解耦的片外/片内优化策略,显著减少搜索空间,同时优先优化高成本的片外数据移动。
- 实现一个通用的编译器工具 Marvel,适用于任何符合 MDC 表示法的 DNN 算子,确保高性能与高能效。
提出的方法
- 论文提出了一套正式规则,用于识别可符合 MDC 表示法的 DNN 算子,确保其映射可通过 MDC 的成本模型进行分析。
- 提出一种新颖的转换方法,将算子映射的循环嵌套表示转换为 MDC 表示法,从而实现对复杂数据布局和调度策略的系统性探索。
- 将映射空间分解为片外和片内子空间,优先进行片外优化,以减少数据移动成本,其成本比片内移动高 2–3 个数量级。
- 使用基于 MDC 表示法的成本模型对片外子空间进行优化,实现对数据移动和重用模式的精确估计。
- 随后,基于相同的 MDC 成本模型,对片内子空间进行优化,重点在于最大化处理元素阵列利用率并最小化空闲周期。
- 整个流水线在名为 Marvel 的工具中实现,该工具集成了基于 MDC 的成本模型、转换引擎和解耦的搜索策略,实现端到端优化。
实验结果
研究问题
- RQ1哪些 DNN 算子可以使用 Maestro 数据中心(MDC)表示法进行形式化表征和分析?此类算子的定义性结构特性是什么?
- RQ2如何系统性地将基于循环嵌套的算子映射转换为 MDC 表示法,以实现形式化分析与优化?
- RQ3将片外与片内优化解耦,能在多大程度上减少空间加速器上 DNN 算子映射的有效搜索空间?
- RQ4所提出的基于 MDC 的解耦优化策略是否能在多种 DNN 工作负载下,于吞吐量和能效方面超越现有最先进的映射器?
- RQ5该方法对非卷积算子(如 GEMM、LSTM 和 MLP)的通用性如何?可实现多大的性能提升?
主要发现
- Marvel 将四个主要 CNN 模型(AlexNet、VGG16、ResNet50、MobileNetV2)的搜索空间缩小了约 $10^{10}$ 倍,从 $9.4 \times 10^{18}$ 降低至 $2.1 \times 10^8$。
- 与先前工作中的三种最先进映射风格相比,Marvel 实现了 10.25 倍的几何平均吞吐量提升,能耗降低 2.01 倍。
- 对于 GEMM、LSTM 和 MLP 工作负载,Marvel 生成的映射比 dMazeRunner 类优化器快 4.46 倍,比 Interstellar 类优化器快 1.22 倍。
- 解耦的片外/片内优化策略通过优先优化片外数据移动,显著减少了搜索空间,而片外数据移动主导了能耗与延迟成本。
- MDC 表示法实现了精确的成本建模,使编译器能够无需依赖启发式或采样搜索策略,即可推理数据重用与移动行为。
- Marvel 在多种工作负载(包括非卷积算子)中均表现出一致的性能提升,验证了其对任何符合 MDC 表示法的 DNN 算子的通用适用性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。