Agent-Skill 工作流让 LLM 高效翻译并行科学代码
More with Less: Efficient Parallel Scientific Code Translation via an Agent-Skill Workflow
三个智能体分工修 CUDA、OpenMP、SYCL 代码翻译,正确率全面超基线还省了一半多的 token,做 HPC 的可以看看思路。
一篇 arXiv 论文提出将代码翻译拆分为翻译、编译诊断、执行验证三个自主智能体,由 verdict-driven 编排器根据失败类型路由到对应修复技能。团队在 30 个 HeCBench 内核上测试 CUDA、OpenMP、SYCL 三种框架间的双向翻译,使用三个开源 LLM。该框架在全部 18 个模型与方向组合中验证正确率都超过现有基线,token 消耗最多降低 52.4%。额外引入的离线 LLM 验证还能发现编译器和运行时检查漏掉的假阳性。
More with Less: Efficient Parallel Scientific Code Translation via an Agent-Skill Workflow
Translating parallel scientific codes between HPC programming frameworks is a critical but labor-intensive task. Existing LLM-based approaches rely on fixed sequential pipelines with undifferentiated repair strategies and correctness criteria that do not match scientific computing practice. We present an agent-skill framework that separates translation, compilation diagnosis, and execution validation into three autonomous agents coordinated by a verdict-driven orchestrator, routing each failure to a targeted repair skill rather than retrying blindly. An automated output check drives the self-correction loop, complemented by an offline LLM-based verification that exposes false positives escaping compiler and runtime checks. We evaluate the framework on 30 HeCBench kernels translated bidirectionally among CUDA, OpenMP, and SYCL with three open-source LLMs. Our framework attains the higher verified correctness rate in all 18 model and direction combinations over a state-of-the-art baseline while consuming up to 52.4% fewer tokens, remaining consistent across models and directions without architectural modification.