Article may be outdated

This article is 85 days old. Some details may have changed since publication.

Hacker News·4 min read·hard

Differentiable Fortran with LFortran and Enzyme

D
dionhaefner
Differentiable Fortran with LFortran and Enzyme
✦AI Summary

Researchers are using LFortran and Enzyme to enable automatic differentiation in legacy Fortran, C, and C++ simulation code. This allows high-performance physics engines to be integrated into modern machine learning frameworks like JAX and PyTorch.

Why it matters

This technology bridges the gap between decades of validated scientific simulation code and modern AI pipelines, enabling more efficient research in fields like climate and aerospace.

✦Dive DeeperCreate a free account to unlock

What if you could backpropagate through existing Fortran, C, or C++ simulation code, embed it into JAX and torch, and use it as a high-performance differentiable physics engine? Turns out, you can — if you’re brave enough…

Decades of validated physics code in CFD, climate, aerospace, and nuclear sit behind a wall that modern ML pipelines can’t cross, because they don’t expose gradients. The usual answer is to rewrite it all in JAX or PyTorch. The alternative we explore here is to leave the code where it is and get exact gradients out anyway, thanks to some LLVM-level magic. This is possible because Enzyme applies autodiff at the LLVM IR level, so we can differentiate any code that compiles to LLVM!

Continue reading on Headlinne

Create a free account to read the full article.

Read full article →
technologyscience
✦

Get smarter about the news

Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.

Create free account

Already have an account? Sign in