Agentic AI
Agentic AI Pipeline Autonomously Converts Legacy Fortran Code to Portable Kokkos
An LLM-powered workflow successfully modernizes aging scientific applications for GPU-accelerated supercomputers without manual intervention.
Aging Fortran codebases that power scientific computing face a critical modernization challenge: the shift from CPU-only supercomputers to heterogeneous systems with GPUs. While frameworks like Kokkos offer portable performance abstractions in C++, few GPUs natively support Fortran, forcing researchers into expensive, time-consuming rewrites. A new research effort demonstrates that specialized AI agents can handle this translation autonomously.
The Challenge of Legacy Code Modernization#
Scientific applications developed decades ago for homogeneous CPU systems increasingly need to run on diverse accelerator hardware. Converting these codes manually demands deep expertise in both the original language and modern performance-portable frameworks—a bottleneck for institutions managing large computational portfolios. Fortran's lack of native GPU bindings makes the problem especially acute in HPC centers worldwide.
An Agentic AI Approach#
Rather than attempting end-to-end code generation with a single model, researchers orchestrated a collaborative workflow where multiple LLM agents take on specialized roles. Each agent in the pipeline—translation, validation, compilation, testing, debugging, and optimization—passes work to the next stage, creating a feedback loop that refines the output at each step. This structured, domain-aware approach mirrors how human teams would tackle the problem.
Real-World Results#
The system successfully transformed benchmark Fortran kernels into production-ready, performance-portable Kokkos C++ programs. Paid commercial models like OpenAI's GPT-5 and o4-mini-high achieved functional translations at minimal cost (a few dollars per workflow run), yielding codes that outperformed their Fortran originals. Open-source alternatives like Llama4-Maverick proved less reliable, frequently producing non-functional outputs.
Implications for Scientific Software#
This work opens a pathway to autonomously refresh scientific software portfolios for modern hardware without requiring specialized porting teams. The results suggest LLM-driven agentic systems can handle structured, domain-specific technical reasoning at scale—a capability that extends beyond code translation to broader systems-oriented and scientific computing challenges.

