arXiv:2505.02184cs.AIcs.DC2025-05被引 7

用大模型自动优化科学计算代码能耗,平均省电超三成。

Leveraging LLMs to Automate Energy-Aware Refactoring of Parallel Scientific Codes

  • 通过实时功耗分析与反馈循环,让大模型迭代生成节能代码。
  • 在两种主流GPU上平均降低34%~36%能耗,且代码功能正确。
  • 适合关注高性能计算能效的科研人员和工程开发者。

大型语言模型(LLMs)正被用于生成并行科学计算代码,主要关注功能正确性。近期工作聚焦于提升代码执行效率,强调运行时间优化。然而,随着大规模计算系统的高功耗问题日益突出,能效已成为关键目标。本文探讨在经验执行反馈引导下,大模型能否生成能效更高的并行科学代码。为此,提出LASSI-EE框架,一种基于大模型的自动化重构方法,采用多阶段、迭代式流程,融合运行时功耗分析、能效提示策略、自纠错反馈环以及大模型作为裁判的代码筛选机制。我们在NVIDIA A100和AMD MI100 GPU上对22个代表性科学基准测试进行评估。结果表明,该方法在多次成功重构中实现了平均36%(MI100)和34%(A100)的能耗降低。

原文摘要 · Abstract (English)

Large language models (LLMs) are increasingly used for generating parallel scientific codes, with a primary focus on generating functionally correct code. Recent work has focused on generating performant code, with an emphasis on its execution time. However, energy efficiency is now recognized as a critical objective, given the significant power demands of large-scale compute systems. This paper addresses the research question of whether LLMs can generate energy-efficient parallel scientific codes when guided by empirical execution feedback. To answer this question, we propose LASSI-EE, an automated LLM-based refactoring framework that generates energy-efficient parallel codes through a multi-stage, iterative approach integrating runtime power profiling, energy-aware prompting, self-correcting feedback loops, and an LLM-as-a-Judge agent for screening generated code. We evaluate LASSI-EE using twenty-two representative scientific benchmarks and applications on NVIDIA A100 and AMD MI100 GPUs. The results indicate an average energy reduction of 36% for MI100 and 34% for A100, across trials that produced passing energy-reducing refactorings.

大模型代码优化能效科学计算

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