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

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Dearing, Matthew T., Tao, Yiheng, Wu, Xingfu, Lan, Zhiling, Taylor, Valerie
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866909028621221888
author Dearing, Matthew T.
Tao, Yiheng
Wu, Xingfu
Lan, Zhiling
Taylor, Valerie
author_facet Dearing, Matthew T.
Tao, Yiheng
Wu, Xingfu
Lan, Zhiling
Taylor, Valerie
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2505_02184
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Leveraging LLMs to Automate Energy-Aware Refactoring of Parallel Scientific Codes
Dearing, Matthew T.
Tao, Yiheng
Wu, Xingfu
Lan, Zhiling
Taylor, Valerie
Artificial Intelligence
Distributed, Parallel, and Cluster Computing
Programming Languages
Software Engineering
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.
title Leveraging LLMs to Automate Energy-Aware Refactoring of Parallel Scientific Codes
topic Artificial Intelligence
Distributed, Parallel, and Cluster Computing
Programming Languages
Software Engineering
url https://arxiv.org/abs/2505.02184