[论文解读] Interstellar: Using Halide's Scheduling Language to Analyze DNN Accelerators
该论文提出 Interstellar 框架,利用 Halide 的调度语言,通过将数据流和内存层次结构选择表示为循环变换,正式建模并分析 DNN 加速器微架构。通过扩展 Halide 以生成硬件,并实现对不同加速器的公平比较,作者表明:适当的循环分块可使多种数据流配置实现接近最优的能效——在 CNN 中最高提升 4.2×,而内存层次结构优化对能效的影响最大。
We show that DNN accelerator micro-architectures and their program mappings represent specific choices of loop order and hardware parallelism for computing the seven nested loops of DNNs, which enables us to create a formal taxonomy of all existing dense DNN accelerators. Surprisingly, the loop transformations needed to create these hardware variants can be precisely and concisely represented by Halide's scheduling language. By modifying the Halide compiler to generate hardware, we create a system that can fairly compare these prior accelerators. As long as proper loop blocking schemes are used, and the hardware can support mapping replicated loops, many different hardware dataflows yield similar energy efficiency with good performance. This is because the loop blocking can ensure that most data references stay on-chip with good locality and the processing units have high resource utilization. How resources are allocated, especially in the memory system, has a large impact on energy and performance. By optimizing hardware resource allocation while keeping throughput constant, we achieve up to 4.2X energy improvement for Convolutional Neural Networks (CNNs), 1.6X and 1.8X improvement for Long Short-Term Memories (LSTMs) and multi-layer perceptrons (MLPs), respectively.
研究动机与目标
- 通过将微架构选择表示为循环变换,形式化密集 DNN 加速器的设计空间。
- 利用统一的基于编译器的框架,实现对现有 DNN 加速器的公平、系统化比较。
- 识别出哪些架构选择——尤其是内存层次结构与循环分块——对能效和性能影响最大。
- 开发一种高效优化器,利用 Halide 的调度原语,为给定 DNN 找到近似最优的加速器设计。
提出的方法
- 扩展 Halide 的调度语言,增加硬件特定原语,如本地通信与内存分配,以支持硬件生成。
- 将所有 DNN 加速器的数据流与内存层次结构建模为 DNN 计算中七级循环嵌套的变换。
- 利用 Halide 的调度与计算解耦模型,仅通过修改调度部分,探索多种硬件映射方式。
- 实现一个硬件综合工具链,将 Halide 调度编译为 FPGA 或 ASIC 的 RTL 代码用于评估。
- 开发一个自动优化器,通过经验观察对设计空间进行剪枝:固定数据流为 C|K,将相邻层级间的内存大小比例限制在 4–16 之间。
- 使用功耗与面积模型评估设计方案,保持吞吐量恒定,以隔离能效提升效果。
实验结果
研究问题
- RQ1是否能够通过 Halide 调度语言中的循环变换,对所有现有密集 DNN 加速器进行形式化分类?
- RQ2在正确应用循环分块的前提下,不同数据流选择对能效的影响程度如何?
- RQ3内存层次结构配置,尤其是寄存器文件与缓冲区大小,如何影响 DNN 加速器的能效?
- RQ4是否能够通过系统化、基于编译器的框架,公平比较并优化跨多种架构的 DNN 加速器设计?
- RQ5在 DNN 加速器中,数据流与内存层次结构对能效的相对影响分别是什么?
主要发现
- 适当的循环分块可确保高数据局部性与资源利用率,使得在最优分块下,多种数据流选择在能效上几乎等效。
- 在最优循环分块下,多种数据流配置可实现相似的性能与能效,因为大多数数据访问都保留在芯片上。
- 内存层次结构设计对能效的影响最大,更深的层次结构与更小的寄存器文件可获得更好结果。
- 优化后的硬件配置采用 16 B 和 128 B 的一级与二级寄存器文件,以及 256 KB 双缓冲全局 SRAM,使 CNN 的能效最高提升 4.2×。
- 自动优化器对 VGG-16、GoogleNet 和 MobileNet 分别实现最高 3.5×、2.7× 和 4.2× 的能效提升,对 MLP 最高实现 1.8× 提升。
- 即使寄存器文件较小,具有更深内存层次结构的大芯片仍优于小芯片,因 DRAM 访问减少,VGG-16 可实现 1.85 TOPs/W 的能效。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。