CodeRosetta: Pushing the Boundaries of Unsupervised Code Translation for Parallel Programming

Ali TehraniJamsaz, Arijit Bhattacharjee, Le Chen, Nesreen K. Ahmed, Amir Yazdanbakhsh +1 more
10/27/2024
38 citations
cs.DCcs.AIcs.LG
transformer-attention

No official code found. Best implementation: tehranixyz/CodeRosetta (11 stars, Python, Apache-2.0, last commit 2024-11-18).

Abstract

Recent advancements in Large Language Models (LLMs) have renewed interest in automatic programming language translation. Encoder-decoder transformer models, in particular, have shown promise in translating between different programming languages.

Show full abstract

However, translating between a language and its high-performance computing (HPC) extensions remains underexplored due to challenges such as complex parallel semantics. In this paper, we introduce CodeRosetta, an encoder-decoder transformer model designed specifically for translating between programming languages and their HPC extensions. CodeRosetta is evaluated on C++ to CUDA and Fortran to C++ translation tasks. It uses a customized learning framework with tailored pretraining and training objectives to effectively capture both code semantics and parallel structural nuances, enabling bidirectional translation. Our results show that CodeRosetta outperforms state-of-the-art baselines in C++ to CUDA translation by 2.9 BLEU and 1.72 CodeBLEU points while improving compilation accuracy by 6.05%. Compared to general closed-source LLMs, our method improves C++ to CUDA translation by 22.08 BLEU and 14.39 CodeBLEU, with 2.75% higher compilation accuracy. Finally, CodeRosetta exhibits proficiency in Fortran to parallel C++ translation, marking it, to our knowledge, as the first encoder-decoder model for this complex task, improving CodeBLEU by at least 4.63 points compared to closed-source and open-code LLMs.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

CodeRosetta: Pushing the Boundaries of Unsupervised Code Translation for Parallel Programming

111PythonNov 6, 20242 years agoApache-2.0

Similar Papers

Cite this paper

@article{tehranijamsaz2024coderosetta,
  title  = {CodeRosetta: Pushing the Boundaries of Unsupervised Code Translation for Parallel Programming},
  author = {Ali TehraniJamsaz and Arijit Bhattacharjee and Le Chen and Nesreen K. Ahmed and Amir Yazdanbakhsh and Ali Jannesari},
  year   = {2024},
  eprint = {2410.20527},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2410.20527},
  url    = {http://arxiv.org/abs/2410.20527v1},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.20527.svg)](https://codeofpaper.com/paper/2410.20527)

Discussion