arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.07686cs.SEcs.AIcs.LG
收藏

使用大语言模型创建高性能计算代码翻译数据集:OpenMP Fortran 与 C++ 之间的桥梁

Creating a Dataset for High-Performance Computing Code Translation using LLMs: A Bridge Between OpenMP Fortran and C++

University of Connecticut(康涅狄格大学);Lawrence Livermore National Laboratory(劳伦斯利弗莫尔国家实验室)

Bin Lei, Caiwen Ding, Le Chen, Pei-Hung Lin, Chunhua Liao

AI总结:

本文构建并精炼了一个面向 OpenMP Fortran 与 C++ 互译的高性能计算代码翻译数据集,实验表明该数据集可显著提升大语言模型的 CodeBLEU 分数,最佳微调模型超越 GPT-4 并达到人类水平准确率。

摘要:

在本研究中,我们提出了一个用于训练机器学习模型在 OpenMP Fortran 与 C++ 代码之间进行翻译的新数据集。为确保可靠性和适用性,该数据集由一系列具有代表性的开源 OpenMP 基准构建而成,并通过细致的代码相似性测试进行了精炼。我们采用定量(CodeBLEU)和定性(人工评估)两种方法评估该数据集的有效性。我们展示了该数据集如何显著提升大语言模型(LLMs)的代码翻译能力。具体而言,没有先前编码知识的模型其 CodeBLEU 分数提升了 $\mathbf{\times~5.1}$ 倍,而具有一定编码基础的模型则实现了令人瞩目的 $\mathbf{\times~9.9}$ 倍增长。使用我们数据集微调的最佳模型超越了 GPT-4,并达到了人类水平的准确率。这项工作凸显了我们的数据集在推动高性能计算代码翻译领域发展方面的巨大潜力。该数据集可在 \href{https://github.com/bin123apple/Fortran-CPP-HPC-code-translation-dataset}{OpenMP-Fortran-CPP-Translation} 获取。

英文摘要:

In this study, we present a novel dataset for training machine learning models translating between OpenMP Fortran and C++ code. To ensure reliability and applicability, the dataset is created from a range of representative open-source OpenMP benchmarks. It is also refined using a meticulous code similarity test. The effectiveness of our dataset is assessed using both quantitative (CodeBLEU) and qualitative (human evaluation) methods. We showcase how this dataset significantly elevates the translation competencies of large language models (LLMs). Specifically, models without prior coding knowledge experienced a boost of $\mathbf{\times~5.1}$ in their CodeBLEU scores, while models with some coding familiarity saw an impressive $\mathbf{\times~9.9}$-fold increase. The best fine-tuned model using our dataset outperforms GPT-4. It is also reaching human-level accuracy. This work underscores the immense potential of our dataset in propelling advancements in the domain of code translation for high-performance computing. The dataset is accessible at \href{https://github.com/bin123apple/Fortran-CPP-HPC-code-translation-dataset}{OpenMP-Fortran-CPP-Translation}.

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

↑