arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.05779cs.LGcs.SE
收藏

基于增强异构AST表示的OpenMP并行化学习方法

Learning to Parallelize with OpenMP by Augmented Heterogeneous AST Representation

Iowa State University(爱荷华州立大学);Intel Labs(英特尔实验室)

Le Chen, Quazi Ishtiaque Mahmud, Hung Phan, Nesreen K. Ahmed, Ali Jannesari

AI总结:

针对可并行化代码区域检测难题,提出基于异构增强AST的图学习方法Graph2Par,构建OMP_Serial数据集,实现85%的检测准确率,优于现有基于词元的方法。

摘要:

检测可并行化代码区域是一项具有挑战性的任务,即使对于经验丰富的开发者也是如此。鉴于机器学习在自然语言处理领域的成功,近期大量研究探索了将机器学习用于代码分析与程序综合(包括并行化)的方向。然而,将机器学习技术应用于并行性检测存在若干挑战,例如缺乏合适的训练数据集、缺乏信息丰富的有效代码表示方式,以及缺乏合适的机器学习模型来学习代码的潜在特征以开展多样化分析。为应对这些挑战,我们提出了一种名为Graph2Par的新型基于图的学习方法,该方法采用异构增强抽象语法树(Augmented-AST)表示代码。所提方法主要聚焦于使用OpenMP的循环级并行化。此外,我们构建了OMP_Serial数据集,包含18598个可并行化循环和13972个不可并行化循环,用于训练机器学习模型。我们的结果显示,所提方法的可并行化代码区域检测准确率达到85%,性能优于当前最优的基于词元的机器学习方法。这些结果表明,我们的方法与现有顶尖工具相比具有竞争力,且能够处理其他工具可能忽略的结构复杂的循环。

英文摘要:

Detecting parallelizable code regions is a challenging task, even for experienced developers. Numerous recent studies have explored the use of machine learning for code analysis and program synthesis, including parallelization, in light of the success of machine learning in natural language processing. However, applying machine learning techniques to parallelism detection presents several challenges, such as the lack of an adequate dataset for training, an effective code representation with rich information, and a suitable machine learning model to learn the latent features of code for diverse analyses. To address these challenges, we propose a novel graph-based learning approach called Graph2Par that utilizes a heterogeneous augmented abstract syntax tree (Augmented-AST) representation for code. The proposed approach primarily focused on loop-level parallelization with OpenMP. Moreover, we create an OMP\_Serial dataset with 18598 parallelizable and 13972 non-parallelizable loops to train the machine learning models. Our results show that our proposed approach achieves the accuracy of parallelizable code region detection with 85\% accuracy and outperforms the state-of-the-art token-based machine learning approach. These results indicate that our approach is competitive with state-of-the-art tools and capable of handling loops with complex structures that other tools may overlook.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑