AI agent ports 250K-line weather code CReSS to GPU, hits 5.1x speedup
Researchers used AI to port a legacy Fortran weather sim to GPU with verified accuracy...
In a new arXiv paper, researchers from the University of Tokyo and collaborators present a validation-centric method for using AI agents to port large legacy scientific codes to GPUs. Their case study focuses on CReSS, a 250,000+ line Fortran weather simulation model. Instead of blindly rewriting code, the team had an AI agent extract OpenMP regions, generate dump-based kernel benchmarks from physically meaningful simulation states, and apply OpenACC transformations. The output was then validated through element-wise comparison with reference dumps and full application-level checks.
The approach paid off: the workflow produced numerically validated GPU implementations for 162 target kernels and achieved a 5.1x application-level speedup on a real typhoon simulation, all within practical wall-clock development time. More impressively, it identified numerical discrepancies in five kernels caused by floating-point and intrinsic-function differences, including threshold-sensitive branch divergence and cancellation effects. The authors argue that for large legacy applications requiring dump-based validation, AI-assisted porting must manage session-spanning context, runtime-state reconstruction, and recovery from static-analysis omissions. Their findings suggest that AI-assisted GPU porting is not just about code generation but requires a validation-centric workflow to maintain the scientific credibility of the original code.
- AI agent ported CReSS, a 250,000+ line Fortran weather code, to GPU using OpenACC transformations
- Achieved 5.1x application-level speedup on a real typhoon simulation across 162 validated kernels
- Caught numerical discrepancies in 5 kernels due to floating-point differences, enabling feedback to developers
Why It Matters
Demonstrates AI can modernize legacy HPC code while preserving scientific validity, speeding up weather and climate simulations significantly.