Learning to Parallelize in a Shared-Memory Environment with Transformers
Not on the map. Why?
Abstract (arXiv)
In past years, the world has switched to many-core and multi-core shared memory architectures. As a result, there is a growing need to utilize these architectures by introducing shared memory parallelization schemes to software applications. OpenMP is the most comprehensive API that implements such schemes, characterized by a readable interface. Nevertheless, introducing OpenMP into code is challenging due to pervasive pitfalls in management of parallel shared memory. To facilitate the performance of this task, many source-to-source (S2S) compilers have been created over the years, tasked with inserting OpenMP directives into code automatically. In addition to having limited robustness to their input format, these compilers still do not achieve satisfactory coverage and precision in locating parallelizable code and generating appropriate directives. In this work, we propose leveraging recent advances in ML techniques, specifically in natural language processing (NLP), to replace S2S compilers altogether. We create a database (corpus), Open-OMP, specifically for this goal. Open-OMP contains over 28,000 code snippets, half of which contain OpenMP directives while the other half do not need parallelization at all with high probability. We use the corpus to train systems to automatically classify code segments in need of parallelization, as well as suggest individual OpenMP clauses. We train several transformer models, named PragFormer, for these tasks, and show that they outperform statistically-trained baselines and automatic S2S parallelization compilers in both classifying the overall need for an OpenMP directive and the introduction of private and reduction clauses. Our source code and database are available at: https://github.com/Scientific-Computing-Lab-NRCN/PragFormer.
Key facts. Cited by 10 papers in the map (data through 14 Oct 2026). Builds on 25 of its 93 references that are in the map. First posted on arXiv 27 Apr 2022.
Builds on
25 of 93 references.
References · 25
- 2017Attention Is All You Needcited by 60,361
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2016"Why Should I Trust You?": Explaining the Predictions of Any Classifiercited by 5,070
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
- 2017Decoupled Weight Decay Regularizationcited by 1,831
- 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,026
- 2016Transfer Learning for Low-Resource Neural Machine Translationcited by 188
- 2021Retrieval Augmented Code Generation and Summarizationcited by 149
- 2020Improved Code Summarization via a Graph Neural Networkcited by 79
13 more
- 2019A Neural Model for Generating Natural Language Summaries of Program Subroutinescited by 77
- 2019Low-resource Deep Entity Resolution with Transfer and Active Learningcited by 37
- 2015Computational Sociolinguistics: A Surveycited by 35
- 2020Improved Automatic Summarization of Subroutines via Attention to File Contextcited by 34
- 2018A Grammar-Based Structural CNN Decoder for Code Generationcited by 29
- 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 24
- 2020ProGraML: Graph-based Deep Learning for Program Optimization and Analysiscited by 23
- 2019Exploiting Out-of-Domain Parallel Data through Multilingual Transfer Learning for Low-Resource Neural Machine Translationcited by 11
- 2020ComPar: Optimized Multi-Compiler for Automatic OpenMP S2S Parallelizationcited by 8
- 2019TreeCaps: Tree-Structured Capsule Networks for Program Source Code Processingcited by 4
- 2021DeepSCC: Source Code Classification Based on Fine-Tuned RoBERTacited by 4
- 2017AutOMP: An Automatic OpenMP Parallelization Generator for Variable-Oriented High-Performance Scientific Codescited by 1
- 2020Machine Learning Framwork for Performance Anomaly in OpenMP Multi-Threaded Systemscited by 1
Built on by
Citing papers per year: 2023: 6; 2024: 3; 2025: 0; 2026: 1.
10 papers.
- 2024The Landscape and Challenges of HPC Research and LLMscited by 22
- 2023LM4HPC: Towards Effective Language Model Application in High-Performance Computingcited by 18
- 2023Learning to Parallelize with OpenMP by Augmented Heterogeneous AST Representationcited by 14
- 2023Scope is all you need: Transforming LLMs for HPC Codecited by 12
- 2023MonoCoder: Domain-Specific Code Language Model for HPC Codes and Taskscited by 12
- 2023Advising OpenMP Parallelization via a Graph-Based Approach with Transformerscited by 10
- 2023MPI-rical: Data-Driven MPI Distributed Parallelism Assistance with Transformerscited by 5
- 2024MPIrigen: MPI Code Generation through Domain-Specific Language Modelscited by 5
- 2024OMPar: Automatic Parallelization with AI-Driven Source-to-Source Compilationcited by 5
- 2026ParaCodex: A Profiling-Guided Autonomous Coding Agent for Reliable Parallel Code Generation and Translationcited by 0
- 2026ParaCodex: A Profiling-Guided Autonomous Coding Agent for Reliable Parallel Code Generation and Translation7 Jan 2026
- 2024OMPar: Automatic Parallelization with AI-Driven Source-to-Source Compilation23 Sep 2024
- 2024MPIrigen: MPI Code Generation through Domain-Specific Language Models14 Feb 2024
- 2024The Landscape and Challenges of HPC Research and LLMs3 Feb 2024
- 2023MonoCoder: Domain-Specific Code Language Model for HPC Codes and Tasks20 Dec 2023
- 2023Scope is all you need: Transforming LLMs for HPC Code18 Aug 2023
- 2023LM4HPC: Towards Effective Language Model Application in High-Performance Computing26 Jun 2023
- 2023Advising OpenMP Parallelization via a Graph-Based Approach with Transformers16 May 2023
- 2023MPI-rical: Data-Driven MPI Distributed Parallelism Assistance with Transformers16 May 2023
- 2023Learning to Parallelize with OpenMP by Augmented Heterogeneous AST Representation9 May 2023