HeadlinesBriefing favicon HeadlinesBriefing.com

AI‑Assisted GPU Porting of Legacy Weather Code

Hacker News •
×

Recent advances in large language models have made CLI‑based AI agents a practical tool for accelerating GPU porting of large legacy scientific applications. These applications are scientific assets whose credibility stems from long‑term development, observational comparison, and domain usage, so GPU porting must preserve this scientific validity while adapting to GPU‑centric HPC systems.

The paper presents a validation‑centric AI‑assisted GPU porting workflow through a case study of CRe SS, a legacy Fortran weather simulation code with 250,000+ lines. The workflow uses an AI agent to extract Open MP regions, generate dump‑based kernel benchmarks from physically meaningful simulation states, apply Open ACC transformations, and validate results through element‑wise comparison with dumped reference data and application‑level validation.

Using a real typhoon simulation, the workflow produced numerically validated GPU implementations for 162 target kernels and achieved a 5.1× application‑level speedup within practical wall‑clock development cost. It also detected numerical discrepancies in five kernels caused by floating‑point and intrinsic‑function differences, including threshold‑sensitive branch divergence and cancellation effects, enabling feedback to developers.

The study also highlights the necessity of managing session‑spanning context, runtime‑state reconstruction, and recovering from small static‑analysis omissions. This demonstrates that AI‑assisted GPU porting requires not only code generation but also a validation‑centric workflow design.