[论文解读] Reinforcement Learning Approach for Mapping Applications to Dataflow-Based Coarse-Grained Reconfigurable Array
该论文提出了一种基于强化学习(RL)的框架,结合全局图注意力(GGA)与输出掩码机制,自动将数据流应用程序映射到细粒度可重构阵列(CGRA)流处理引擎上。该方法采用近端策略优化(PPO)算法学习最优指令调度,在稀疏搜索空间中显著优于基线方法,实现10%更优的时钟周期性能与20%更高的奖励,尤其在掩码机制下表现突出。
The Streaming Engine (SE) is a Coarse-Grained Reconfigurable Array which provides programming flexibility and high-performance with energy efficiency. An application program to be executed on the SE is represented as a combination of Synchronous Data Flow (SDF) graphs, where every instruction is represented as a node. Each node needs to be mapped to the right slot and array in the SE to ensure the correct execution of the program. This creates an optimization problem with a vast and sparse search space for which finding a mapping manually is impractical because it requires expertise and knowledge of the SE micro-architecture. In this work we propose a Reinforcement Learning framework with Global Graph Attention (GGA) module and output masking of invalid placements to find and optimize instruction schedules. We use Proximal Policy Optimization in order to train a model which places operations into the SE tiles based on a reward function that models the SE device and its constraints. The GGA module consists of a graph neural network and an attention module. The graph neural network creates embeddings of the SDFs and the attention block is used to model sequential operation placement. We show results on how certain workloads are mapped to the SE and the factors affecting mapping quality. We find that the addition of GGA, on average, finds 10% better instruction schedules in terms of total clock cycles taken and masking improves reward obtained by 20%.
研究动机与目标
- 解决将同步数据流(SDF)图手动映射到具有架构约束的流处理引擎(SE)阵列单元时面临的NP难、稀疏且复杂的问题。
- 通过引入基于无监督学习的自动化优化方法,减少对专家知识与人工干预的依赖,降低SE应用映射的复杂度。
- 通过整合注意力机制与动作掩码,提升在稀疏搜索空间中的映射质量与样本效率。
- 通过在多样化中间表示(IR)图上进行预训练与微调,实现对多种工作负载的泛化能力。
- 将RL映射器集成至SE工具链中,以加速开发流程,并支持调度策略中各类权衡的自动化探索。
提出的方法
- 采用近端策略优化(PPO)作为强化学习算法,训练策略网络以选择SDF节点在SE阵列单元与槽位上的放置位置。
- 引入全局图注意力(GGA)模块,结合图神经网络(GNN)用于SDF嵌入,以及多头注意力机制,以在放置过程中建模节点间的依赖关系。
- 在每一步操作中应用输出掩码,以消除无效动作(如资源过度约束或依赖数据的放置),从而减少搜索空间并提升训练稳定性。
- 使用模拟的SE环境作为强化学习环境,建模单元内存、数据流依赖关系及单元间延迟,以计算奖励。
- 采用有序迭代顺序(拓扑顺序)以提升训练效率,仅在前驱节点已放置后才处理依赖节点。
- 先在随机IR图上进行预训练,随后在FFT等具体工作负载上进行微调,以实现知识迁移并加快收敛速度。
实验结果
研究问题
- RQ1深度强化学习框架是否能有效探索CGRA上指令映射的庞大且稀疏的搜索空间,而无需人工监督?
- RQ2引入图注意力机制(GGA)在多大程度上提升了RL智能体对数据流依赖关系与放置质量的推理能力?
- RQ3对无效动作进行输出掩码在多大程度上提升了学习效率与最终奖励?
- RQ4节点迭代顺序(如拓扑顺序与随机顺序)对学习到的映射成功率与质量有何影响?
- RQ5预训练的RL模型是否可在新工作负载上通过微调实现更快收敛与更优性能,相比从零开始训练?
主要发现
- 引入全局图注意力(GGA)模块后,在不同图复杂度与SE配置下,最优调度的总时钟周期数平均改善了10%。
- 相比使用负奖励处理无效动作,输出掩码使获得的奖励提高了20%,显著提升了样本效率与收敛性。
- 采用拓扑顺序进行节点处理可获得更高奖励并实现更稳定的训练,因其符合数据流语义,减轻了模型预测负担。
- 在随机IR图上进行预训练,随后在FFT等具体工作负载上微调,相比从零开始训练,初始与最终奖励均更高,证明了迁移学习的潜力。
- 该RL映射器成功为多种工作负载(包括FFT与距离计算)找到了有效且优化的映射方案,即使在64个单元的SE配置下也表现优异,优于模拟退火算法在稀疏搜索空间中的表现。
- 该框架展现出良好的可扩展性与适应性,具备集成至SE工具链的潜力,有望显著减少人工工作量并加速应用部署。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。