高级检索

    基于图神经网络的OpenCL程序自动优化启发式方法

    Automatic Optimization Heuristics Method for OpenCL Program Based on Graph Neural Network

    • 摘要: 物联网的发展与普及促使计算机异构架构迅速发展,开放运算语言(open computing language, OpenCL)作为首个跨平台异构并行计算框架,具有标准化、可移植性等优点,但因不同平台下软硬件的复杂性和多样性,使OpenCL在性能上的移植性存在一定的缺陷. 现有的方法通过深度学习构建优化模型来提高程序运行效率,但所构建的预测模型仅考虑代码的顺序依赖关系,忽略了语法语义信息,导致代码优化效果不明显. 为解决上述问题,提出了一种基于多关系图神经网络的OpenCL程序自动优化启发式方法. 该方法首先把OpenCL代码转换成多关系代码图,能够提取代码的深度结构与语法语义特征;然后利用改进后的图神经网络模型,将构建的代码图编码为高维的特征向量;最后使用决策网络完成任务预测. 为验证方法的有效性,分别在异构设备映射和线程粗化因子预测2个任务上进行实验评估. 结果表明,在异构设备映射任务中,最优设备预测准确率能够达到88.7%,相较于现有最先进的方法,加速比可提高7.6%;在线程粗化任务中,加速比相较于现有最优的方法可提高5.2%.

       

      Abstract: The last decade years witnessed the rapid development of heterogeneous computer architecture due to the popularization of the Internet of things. As the first cross-platform heterogeneous parallel computing framework, OpenCL(open computing language)has the advantages of standardization and portability. However, OpenCL has certain defects in performance portability because of the complexity and diversity of software and hardware platforms. To address this problem, prior methods leverage deep learning to build an optimization model. But they suffer from an insignificant code optimization effect because existing deep learning-based methods only capture the order dependencies of the program while ignoring the syntactic and semantic information. To this end, we propose ACCEPT, an automated heuristic optimization on OpenCL programs by building a multi-relational graph neural network. Differ from existing methods, ACCEPT first extracts the deep structure and semantic features of the OpenCL program by constructing a multi-relational code graph, then applies an improved graph neural network to extract the high-dimensional feature representation of the constructed code graph. Finally, a decision neural network is used to yield the optimization parameters. We evaluate ACCEPT with heterogeneous device mapping and thread coarsening factor prediction tasks. The experimental results show that ACCEPT outperforms state-of-the-art (SOTA) methods. On the heterogeneous device mapping task, the accuracy can reach 88.7%, and the speedup can be increased by 7.6% compared with the SOTA methods. On the thread coarsening task, the speedup is 5.2% higher than SOTA methods.

       

    /

    返回文章
    返回