Validation-Centric AI-Assisted GPU Porting of a 250,000+ Line Legacy Weather Simulation Code

๐Ÿ“… 2026-08-13
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF
๐Ÿค– AI Summary
This work addresses the tension between performance gains and scientific validity when porting large legacy scientific codes to GPUs by proposing a verification-centric, AI-assisted migration workflow. The approach integrates a large language modelโ€“driven CLI agent, OpenACC-based automated code transformation, and physics-informed kernel benchmark generation, ensuring consistency through both element-wise numerical comparison and application-level meteorological simulations. For the first time, scientific validation is deeply embedded into an AI-assisted porting pipeline, enabling automatic detection of floating-point semantic discrepancies and branch sensitivity, while highlighting the critical roles of conversational context management and runtime state reconstruction. Applied to the 250K-line Fortran weather model CReSS, the method successfully produced verified GPU implementations for 162 core kernels, achieving a 5.1ร— speedup in real typhoon simulations and uncovering five instances of numerical divergence, substantially reducing migration costs.
๐Ÿ“ Abstract
Recent advances in large language models have made CLI-based AI agents a practical tool for accelerating GPU porting of large legacy scientific applications. Such applications, however, are not merely old code bases; they are scientific assets whose credibility has been accumulated through long-term development, comparison with observations, and use in domain studies. GPU porting must therefore preserve this scientific validity while adapting the implementation to GPU-centric HPC systems. This paper presents a validation-centric AI-assisted GPU porting workflow through a case study of CReSS, a legacy Fortran weather simulation code with more than 250,000 lines. The workflow uses an AI agent to extract OpenMP regions, generate dump-based kernel benchmarks from physically meaningful simulation states, apply OpenACC 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.1x application-level speedup within practical wall-clock development cost. In particular, it 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 the application developers. The case study suggests that, for large legacy scientific applications requiring dump-based validation, practical AI-assisted GPU porting must manage session-spanning context, runtime-state reconstruction, and costly recovery from small static-analysis omissions. These findings demonstrate that AI-assisted GPU porting requires not only code generation, but validation-centric workflow design.
Problem

Research questions and friction points this paper is trying to address.

GPU porting
scientific validity
legacy code
numerical validation
weather simulation
Innovation

Methods, ideas, or system contributions that make the work stand out.

validation-centric
AI-assisted GPU porting
legacy scientific code
dump-based validation
numerical correctness
๐Ÿ”Ž Similar Papers
No similar papers found.
T
Tetsuya Hoshino
Information Technology Center, Nagoya University, Aichi, Japan
M
Masaya Kato
Institute for Space-Earth Environmental Research, Nagoya University, Aichi, Japan
K
Kazuhisa Tsuboki
Institute for Space-Earth Environmental Research, Nagoya University, Aichi, Japan
D
Daichi Mukunoki
Information Technology Center, Nagoya University, Aichi, Japan
Takahiro Katagiri
Takahiro Katagiri
Professor of Information Technology Center, Nagoya University
Auto-tuningCode generative AIPost-Moore Computing้ซ˜ๆ€ง่ƒฝ่จˆ็ฎ—quantum annealing
Toshihiro Hanawa
Toshihiro Hanawa
Information Technology Center, The University of Tokyo, Chiba, Japan