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

MPIrigen:通过领域特定语言模型生成 MPI 代码

MPIrigen: MPI Code Generation through Domain-Specific Language Models

Ben-Gurion University(本-古里安大学);Intel Labs(英特尔实验室);Intel(英特尔);Technion(以色列理工学院)

Nadav Schneider, Niranjan Hasabnis, Vy A. Vo, Tal Kadosh, Neva Krien, Mihai Capotă, Guy Tamir, Ted Willke, Nesreen Ahmed, Yuval Pinter, Timothy Mattson, Gal Oren

AI总结:

针对生成 MPI 并行程序的挑战,本研究提出基于 HPCorpusMPI 微调 MonoCoder 的领域特定模型 MPIrigen,其在位置、函数及参数预测上准确率分别达 0.8 和 0.9 以上,优于 GPT-3.5,证明了领域微调对并行代码生成的关键作用。

摘要:

在众多节点上扩展计算的迫切需求凸显了高效并行计算的重要性,尤其是在消息传递接口(MPI)集成领域。生成基于 MPI 的并行程序这一极具挑战性的并行编程任务一直未被探索。本研究首先调研了最先进语言模型在生成基于 MPI 并行程序时的性能。研究结果表明,与通用程序相比,GPT-3.5 和 PolyCoder(专门的多语言代码模型)等广泛使用的模型在生成基于 MPI 的程序时表现出显著的性能下降。相比之下,在 C 和 C++ 等 MPI 相关编程语言上预训练的领域特定模型(如 MonoCoder)则优于更大的模型。随后,我们通过在 HPCorpusMPI 上微调 MonoCoder,引入了生成基于 MPI 程序的专用下游任务。我们将生成的模型称为 MPIrigen。我们提出了一种创新的预处理方法,仅在观察整个代码后才进行补全,从而通过更广泛的上下文实现更好的补全效果。使用一种新颖的面向 HPC 的评估方法与 GPT-3.5 的零样本性能进行对比分析,结果表明 MPIrigen 在生成准确的 MPI 函数方面表现出色,位置和函数预测的准确率高达 0.8,参数预测的准确率超过 0.9。这一定制解决方案的成功,凸显了领域特定微调在优化语言模型以生成并行计算代码方面的重要性,为新一代自动并行化工具铺平了道路。本工作的源代码可在我们的 GitHub MPIrigen 仓库获取:https://github.com/Scientific-Computing-Lab-NRCN/MPI-rigen

英文摘要:

The imperative need to scale computation across numerous nodes highlights the significance of efficient parallel computing, particularly in the realm of Message Passing Interface (MPI) integration. The challenging parallel programming task of generating MPI-based parallel programs has remained unexplored. This study first investigates the performance of state-of-the-art language models in generating MPI-based parallel programs. Findings reveal that widely used models such as GPT-3.5 and PolyCoder (specialized multi-lingual code models) exhibit notable performance degradation, when generating MPI-based programs compared to general-purpose programs. In contrast, domain-specific models such as MonoCoder, which are pretrained on MPI-related programming languages of C and C++, outperform larger models. Subsequently, we introduce a dedicated downstream task of MPI-based program generation by fine-tuning MonoCoder on HPCorpusMPI. We call the resulting model as MPIrigen. We propose an innovative preprocessing for completion only after observing the whole code, thus enabling better completion with a wider context. Comparative analysis against GPT-3.5 zero-shot performance, using a novel HPC-oriented evaluation method, demonstrates that MPIrigen excels in generating accurate MPI functions up to 0.8 accuracy in location and function predictions, and with more than 0.9 accuracy for argument predictions. The success of this tailored solution underscores the importance of domain-specific fine-tuning in optimizing language models for parallel computing code generation, paving the way for a new generation of automatic parallelization tools. The sources of this work are available at our GitHub MPIrigen repository: https://github.com/Scientific-Computing-Lab-NRCN/MPI-rigen

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

↑