Learning to Parallelize with OpenMP by Augmented Heterogeneous AST Representation

05/09/2023
by   Le Chen, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/02/2019

Towards an Achievable Performance for the Loop Nests

Numerous code optimization techniques, including loop nest optimizations...
research
05/16/2023

Advising OpenMP Parallelization via a Graph-Based Approach with Transformers

There is an ever-present need for shared memory parallelization schemes ...
research
12/03/2020

Feature-Based Software Design Pattern Detection

Software design patterns are standard solutions to common problems in so...
research
02/20/2020

Detecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Tree

Code clones are semantically similar code fragments pairs that are synta...
research
06/16/2021

Cross-Language Code Search using Static and Dynamic Analyses

As code search permeates most activities in software development,code-to...
research
03/09/2023

A Syntax-Guided Multi-Task Learning Approach for Turducken-Style Code Generation

Due to the development of pre-trained language models, automated code ge...
research
01/11/2023

Enhancing Comprehension and Navigation in Jupyter Notebooks with Static Analysis

Jupyter notebooks enable developers to interleave code snippets with ric...

Please sign up or login with your details

Forgot password? Click here to reset