Source linked

LLM Pipeline переводит 19 000-линий Fortran в JAX, ударяет последовательно 24 раза

Автоматизированный агент LLM преобразует прежний научный код Fortran в дифференцируемый JAX, восстанавливая в 8 раз более быструю оценку параметров и ускорение масштаба в 24 раза.

clm ml v2jaxllm agentfortran to jaxdifferentiable programmingscientific computing

24x wall-clock speedup over sequential Fortran at ensemble size N=2,048, and eight times fewer steps to recover physical parameters compared to gradient-free optimization. That’s what a new five-phase LLM agentic pipeline delivers by translating a 19,000-line Fortran land surface model into JAX.

Five-Phase LLM Pipeline Tackles Fortran-to-JAX Translation

The challenge: legacy scientific code (Fortran) is fast but opaque to modern differentiable frameworks. The team—using an LLM-based agent—designed a pipeline with static dependency analysis that determines module translation order from the full call graph. Iterative compile-repair loops correct errors autonomously, and a Fortran reference oracle enforces numerical parity at the module level before integration and gradient verification. They applied it to CLM-ml-v2, a 19,000-line Fortran land surface model, analyzing agent behavior across 73 module translation tasks.

Gradient Verification and Reusable Infrastructure

Why bother? Differentiable programming enables gradient-based parameter estimation, sensitivity analysis, and data assimilation—transformative capabilities for Earth system models. The resulting JAX model computes the complete Jacobian in a single backward pass. Both the translated model and the pipeline infrastructure are released as a reusable framework for differentiating other Earth system model components. If you’ve got a 30-year-old Fortran codebase you’d rather not rewrite by hand, this pipeline might be your shortest path to autodiff.


Source: Systematic LLM Translation of Legacy Scientific Code to Differentiable Frameworks: Application to a Land Surface Model
Domain: arxiv.org

Read original source ->

External source stays available while the OJO article and comment thread stay local.

Comments load interactively on the live page.