[论文解读] CoSA: Scheduling by Constrained Optimization for Spatial Accelerators
CoSA 是一种约束优化框架,将 DNN 加速器调度问题建模为混合整数规划(MIP)问题,通过单次确定性求解联合优化分块、循环顺序和空间映射。与最先进的调度器相比,其性能最高提升 2.5×,求解时间快 90 倍,通过消除迭代搜索,利用算法与架构的规律性,实现高性能的一次性调度。
Recent advances in Deep Neural Networks (DNNs) have led to active development of specialized DNN accelerators, many of which feature a large number of processing elements laid out spatially, together with a multi-level memory hierarchy and flexible interconnect. While DNN accelerators can take advantage of data reuse and achieve high peak throughput, they also expose a large number of runtime parameters to the programmers who need to explicitly manage how computation is scheduled both spatially and temporally. In fact, different scheduling choices can lead to wide variations in performance and efficiency, motivating the need for a fast and efficient search strategy to navigate the vast scheduling space. To address this challenge, we present CoSA, a constrained-optimization-based approach for scheduling DNN accelerators. As opposed to existing approaches that either rely on designers' heuristics or iterative methods to navigate the search space, CoSA expresses scheduling decisions as a constrained-optimization problem that can be deterministically solved using mathematical optimization techniques. Specifically, CoSA leverages the regularities in DNN operators and hardware to formulate the DNN scheduling space into a mixed-integer programming (MIP) problem with algorithmic and architectural constraints, which can be solved to automatically generate a highly efficient schedule in one shot. We demonstrate that CoSA-generated schedules significantly outperform state-of-the-art approaches by a geometric mean of up to 2.5x across a wide range of DNN networks while improving the time-to-solution by 90x.
研究动机与目标
- 为解决空间 DNN 加速器中庞大且高维的调度空间所带来的挑战,该挑战使得暴力搜索或迭代反馈驱动方法不可行。
- 通过将调度建模为确定性的约束优化问题,消除对昂贵的迭代搜索或大规模仿真工具的依赖。
- 利用统一的数学公式,同时优化分块、循环重排和空间映射,其基础是硬件与算法约束。
- 在多种 DNN 工作负载和加速器架构(包括 GPU 和定制化空间加速器)上,提升性能与能效。
- 实现在新型或演进型硬件上快速、可扩展且可移植的调度,而无需重新训练或大量仿真。
提出的方法
- CoSA 将 DNN 调度建模为混合整数规划(MIP)问题,其约束来源于 DNN 层的维度以及内存层次结构、片上网络(NoC)拓扑等硬件参数。
- 将不同内存层级上的分块大小、数据重用的循环顺序以及计算到处理单元的空间映射作为 MIP 建模中的决策变量。
- 框架整合了架构约束,如共享内存限制、寄存器使用量和 GPU 上的线程块大小限制,确保仅生成有效调度。
- 采用以通信为导向的目标函数,显式建模片上内存与 NoC 间的数据移动成本,降低通信开销。
- 目标函数结合计算利用率、内存重用和通信成本,权重通过微基准测试调优,以平衡各项权衡。
- 使用标准数学优化求解器一次性求解 MIP 问题,避免迭代搜索或强化学习。
实验结果
研究问题
- RQ1DNN 加速器调度能否被建模为一个单一的、确定性的约束优化问题,从而避免迭代搜索或昂贵的训练?
- RQ2统一的 MIP 建模在联合优化多种 DNN 工作负载的分块、循环顺序和空间映射方面有多高效?
- RQ3在不同硬件平台上,CoSA 在性能、能效和求解时间方面相较于最先进调度器的提升程度如何?
- RQ4CoSA 在无需重新训练或仿真的情况下,对新型或演进型加速器架构的泛化能力如何?
- RQ5CoSA 中的通信感知目标函数是否相比忽略网络流量成本的模型能带来更好的性能?
主要发现
- CoSA 生成的调度在多个 DNN 网络上相较最先进的调度器(如 Timeloop Hybrid 和 Random search)实现了最高达 2.5× 的几何平均加速比。
- CoSA 的求解时间比迭代方法快 90 倍,单次求解平均仅需 0.02 秒/层。
- 在 NoC 模拟器上,CoSA 相比最佳 Random search 解决方案最高实现 3.3× 加速,相比 Timeloop Hybrid 高达 2.5×,尤其在通信成本高的卷积层中表现优异。
- 在 K80 GPU 上,CoSA 生成的调度相较使用 XGBoost 调优器的 TVM 实现了 1.10× 的几何平均加速,同时将求解时间减少 2,500 倍(每层 0.02 秒 vs. 50 秒)。
- 与基线调度器相比,CoSA 将能效提升了 22%,证明其在降低计算与通信开销方面的有效性。
- 该框架在多种工作负载(包括 ResNet-50、DeepBench 和全连接层)中持续生成高质量调度,且在内存受限层上无性能下降。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。