TRANSMISSION // 2505.02184v4

Can AI refactor scientific GPU code to use less energy?

Source published

LASSI-EE uses measured GPU power and iterative LLM feedback to refactor parallel scientific code. In tests on 22 applications and two GPU types, it reported expected energy savings of 29% for one attempt and 48% when selecting the best of three.

AI-generated conceptual illustration for Can AI refactor scientific GPU code to use less energy?
AI-generated conceptual illustration; not documentary evidence.

Large language models can write code, but can they make scientific GPU programs consume less energy without sacrificing useful results? LASSI-EE tackles that question by having an AI model revise code, run it on a target GPU, measure its energy use and use those results to guide further attempts.

Energy efficiency matters in high-performance computing, where scientific applications run on powerful systems and reducing electricity use is an increasingly important goal. But energy-aware code tuning can demand specialist knowledge of both the application and its hardware. The LASSI-EE researchers ask whether a large language model (LLM) can help with that work when it gets feedback from actual runs—not just instructions to make code more efficient.

Their framework combines code generation with GPU power measurement and repeated testing. It first profiles the original program, then builds context from the code and relevant programming documentation. The model proposes changes, and the framework compiles and runs them on the target device. Measured energy and runtime, along with errors, feed into later attempts. A separate LLM-based judge screens candidates by comparing the source and revised code and their outputs on identical inputs. The system keeps a candidate only if it passes screening and uses less energy than the original.

The team tested 22 scientific and engineering applications on NVIDIA A100 and AMD MI100 GPUs, with 30 independent runs for each application-device pairing. The code was compiled with full optimization. The suite included 20 HeCBench kernels and two larger applications, XSBench and miniMDock. In total, the study reports 1,320 trials.

A key feature of the evaluation is that it counts unsuccessful attempts. The authors’ “energy-reduction@k” metric estimates expected savings when generating k candidates and selecting the most energy-efficient one that passes screening. It treats an attempt that fails screening or offers no energy improvement as providing no savings. By this measure, the framework achieved an expected energy reduction of about 29% for one attempt and 48% when choosing the best of three. For candidates that passed screening and reduced energy, average savings were about 34% on the A100 and 36% on the MI100. Those conditional averages describe successful, energy-reducing outputs—not every generation attempt.

The reported gains did not always come from lower power alone. In many cases, programs ran faster, reducing the time the GPU needed to execute them. Some applications used more power but still consumed less total energy because they finished sooner. The authors report that runtime improved for most tested application-device pairs. They also found that the framework produced different code implementations for the two GPU types, suggesting that its changes were not simply identical across architectures. The identified optimizations did not include reduced-precision transformations, which can trade numerical accuracy for speed or energy savings.

These results are promising, but they do not establish that the approach will work equally well for all scientific software or hardware. The evaluation covers a limited set of 22 applications and two GPU models, with only two larger mini-apps. The authors identify multi-GPU and newer hardware tests, as well as larger production applications, as future work. They also report that a trial took about 30 minutes on average, with some taking much longer, so generating and checking optimized code has a real upfront cost.

Correctness screening is another important caveat. The judge uses execution outputs and built-in checks where available, but the paper explicitly says this screening is not formal verification. The authors describe stronger testing and equivalence-checking methods as possible extensions. Energy measurements also rely on vendor power counters; the paper discusses their limitations and uses repeated trials and idle-power correction, but measured savings should still be understood in the context of that setup.

LASSI-EE therefore shows that measured feedback can help an LLM find energy-saving refactorings in these experiments—not that AI can safely optimize arbitrary scientific programs without expert oversight. The paper is an arXiv preprint, and the supplied source does not establish that it has undergone peer review. Its findings should be read as reported experimental results that need further validation across applications and systems.

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.