LASSI:一种基于 LLM 的自动自校正流水线,用于翻译并行科学代码
LASSI: An LLM-based Automated Self-Correcting Pipeline for Translating Parallel Scientific Codes
AI总结:
本文提出 LASSI 自动化流水线,通过 LLM 自校正循环实现 OpenMP 与 CUDA 并行代码的双向翻译,实验显示 80% 和 85% 的翻译可产生预期输出,验证了其生成可执行并行代码的有效性。
摘要:
本文解决为面向科学与工程的 LLM 获取重要训练数据的新方法问题。特别地,一个关键挑战是获取规模在数百万到数十亿之间的并行科学代码。为解决该问题,我们提出一个名为 LASSI 的自动化流水线框架,旨在通过引导现有闭源或开源 LLM 来在并行编程语言之间进行翻译。LASSI 通过自校正循环实现自主增强,在生成代码的编译和执行过程中遇到的错误会通过引导式提示反馈给 LLM,以进行调试和重构。我们重点展示现有 GPU 基准在 OpenMP target offload 与 CUDA 之间的双向翻译,以验证 LASSI。使用不同应用代码在四个 LLM 上评估 LASSI 的结果表明,LASSI 在生成可执行并行代码方面是有效的,其中 80% 的 OpenMP 到 CUDA 翻译和 85% 的 CUDA 到 OpenMP 翻译产生了预期输出。我们还观察到约 78% 的 OpenMP 到 CUDA 翻译和 62% 的 CUDA 到 OpenMP 翻译在运行时上处于同语言原始基准代码的 10% 以内或更快。
英文摘要:
This paper addresses the problem of providing a novel approach to sourcing significant training data for LLMs focused on science and engineering. In particular, a crucial challenge is sourcing parallel scientific codes in the ranges of millions to billions of codes. To tackle this problem, we propose an automated pipeline framework called LASSI, designed to translate between parallel programming languages by bootstrapping existing closed- or open-source LLMs. LASSI incorporates autonomous enhancement through self-correcting loops where errors encountered during the compilation and execution of generated code are fed back to the LLM through guided prompting for debugging and refactoring. We highlight the bi-directional translation of existing GPU benchmarks between OpenMP target offload and CUDA to validate LASSI. The results of evaluating LASSI with different application codes across four LLMs demonstrate the effectiveness of LASSI for generating executable parallel codes, with 80% of OpenMP to CUDA translations and 85% of CUDA to OpenMP translations producing the expected output. We also observe approximately 78% of OpenMP to CUDA translations and 62% of CUDA to OpenMP translations execute within 10% of or at a faster runtime than the original benchmark code in the same language.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。