GPU-based HPC clusters are attracting more scientific application developers due to their extensive parallelism and energy efficiency. In order to achieve portability among a variety of multi/many core architectures, a popular choice for an application developer is to utilize directive-based parallel programming models, such as OpenMP. However, even with OpenMP, the developer must choose from among many strategies for exploiting a GPU or a CPU. Recently, Machine Learning (ML) approaches have brought significant advances in the optimizations of HPC applications. To this end, several ways have been proposed to represent application characteristics for ML models. However, the available techniques fail to capture features that are crucial for exposing parallelism. In this paper, we introduce a new graph-based program representation for parallel applications that extends the Abstract Syntax Tree to represent control and data flow information. The originality of this work lies in the addition of new edges exploiting the implicit ordering and parent-child relationships in ASTs, as well as the introduction of edge weights to account for loop and condition information. We evaluate our proposed representation by training a Graph Neural Network (GNN) to predict the runtime of an OpenMP code region across CPUs and GPUs. Various transformations utilizing collapse and data transfer between the CPU and GPU are used to construct the dataset. The predicted runtime of the model is used to determine which transformation provides the best performance. Results show that our approach is indeed effective and has normalized RMSE as low as 0.004 to at most 0.01 in its runtime predictions.
翻译:基于GPU的高性能计算集群因具备高度并行性与能效优势,正吸引越来越多的科学应用开发者。为实现跨多种多/众核架构的可移植性,应用开发者通常采用基于制导指令的并行编程模型(如OpenMP)。然而,即便使用OpenMP,开发者仍需在众多利用GPU或CPU的策略中进行选择。近年来,机器学习方法在高性能计算应用优化领域取得了显著进展。为此,研究者提出了多种表征应用特征的方法以供机器学习模型使用,但现有技术未能捕捉对暴露并行性至关重要的特征。本文提出了一种面向并行应用的基于图的新型程序表示方法,该方法扩展了抽象语法树以表征控制流与数据流信息。本工作的创新性体现在:在AST中新增利用隐式排序与父子关系的边,并引入边权重以表征循环与条件信息。我们通过训练图神经网络预测OpenMP代码区域在CPU与GPU上的运行时间来评估所提出的表示方法,并利用涉及collapse及CPU-GPU数据传输的多种变换构建数据集。模型预测的运行时间用于判定性能最优的变换。结果表明,本方法切实有效,其运行时预测的归一化均方根误差低至0.004,最高不超过0.01。