arXiv:2511.03866cs.DCcs.AI2025-11

用Transformer模型将C++自动转为OpenMP并行代码,提升迁移效率。

OMPILOT: Harnessing Transformer Models for Auto Parallelization to Shared Memory Computing Paradigms

  • 基于函数级语义建模的专用编码器-解码器架构
  • 自定义预训练目标提升并行结构翻译准确率
  • 提出新评估指标OMPBLEU,精准衡量并行代码质量

大型语言模型(LLMs)在代码翻译中的进展显著推动了跨语言转换的准确性与效率。尽管最初用于自然语言处理,这些模型在编程语言语法和语义建模上表现出色,优于传统规则系统。本文提出OMPILOT,一种针对将C++代码转换为OpenMP的领域专用编码器-解码器Transformer,实现共享内存并行化。OMPILOT采用结合并行构造语义的自定义预训练目标,并融合无监督与有监督学习策略以增强鲁棒性。与以往聚焦循环级转换的工作不同,OMPILOT在函数级别操作,捕获更广泛的语义上下文。为评估方法效果,我们提出OMPBLEU,一种专为评估OpenMP并行构造正确性和质量设计的复合指标,克服了传统翻译指标的局限。

原文摘要 · Abstract (English)

Recent advances in large language models (LLMs) have significantly accelerated progress in code translation, enabling more accurate and efficient transformation across programming languages. While originally developed for natural language processing, LLMs have shown strong capabilities in modeling programming language syntax and semantics, outperforming traditional rule-based systems in both accuracy and flexibility. These models have streamlined cross-language conversion, reduced development overhead, and accelerated legacy code migration. In this paper, we introduce OMPILOT, a novel domain-specific encoder-decoder transformer tailored for translating C++ code into OpenMP, enabling effective shared-memory parallelization. OMPILOT leverages custom pre-training objectives that incorporate the semantics of parallel constructs and combines both unsupervised and supervised learning strategies to improve code translation robustness. Unlike previous work that focused primarily on loop-level transformations, OMPILOT operates at the function level to capture a wider semantic context. To evaluate our approach, we propose OMPBLEU, a novel composite metric specifically crafted to assess the correctness and quality of OpenMP parallel constructs, addressing limitations in conventional translation metrics.

代码生成Transformer并行计算自动优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。