ModelBest open-sources ForgeStencil: 100+ industrial and scientific applications optimized in one week with zero human intervention
From weather forecasting and seismic exploration to electromagnetic simulation and materials modeling, every breakthrough in modern industry and frontier research rests on large-scale high-performance computing (HPC) software.
Underneath these programs sits an unavoidable core compute pattern that consumes enormous amounts of compute: the Stencil computation, which applies the same local operation to every point on a regular grid and its fixed neighborhood.
Whether it is atmospheric dynamics, seismic wave propagation, electromagnetic field evolution, or fluid dynamics and phase-field simulation, the underlying computation reduces to the same operation: repeatedly update the whole grid using weighted combinations of neighboring grid points. Such computations are memory-intensive and bandwidth-bound, and often account for most of an application's runtime.
The performance of Stencil code therefore directly determines the overall efficiency of critical industrial and scientific software.
But how do you optimize a Stencil to the physical limits of the hardware?
In the past, this relied on extremely scarce HPC experts.
They built a large number of Stencil-oriented compilers, code generators, and auto-tuning systems that can generate code and search parameter configurations automatically. But the optimization algorithms behind these tools still have to be designed and integrated by people. Facing new application scenarios, new shapes, and new hardware platforms, researchers must keep proposing new optimization strategies and manually wiring the results into real applications. Stencil optimization has therefore remained highly dependent on expert experience and hard to scale.
Now, that is about to change—
Today, ModelBest and the OpenBMB open-source community release and open-source ForgeStencil, the world's first AI optimization system capable of automated Stencil research and automated deployment.
According to the team's statistics, ForgeStencil automatically optimized more than 100 real industrial and scientific computing applications in one week, far faster than human experts. That means Stencil optimization can now be scaled; AI accelerating every industry and driving China's "smart" manufacturing upgrade is becoming a reality.
This article includes video content. Please view it in the original WeChat post.
➤ Open-source link
🔗 https://github.com/OpenBMB/ForgeStencil
Two agents, zero human intervention
What lets ForgeStencil surpass every previous auto-tuning tool is that it is the first to close a fully automated loop from "proposing an optimization idea" to "seamless deployment in the application."
Throughout the process, humans only provide the source code of the application to be optimized; ForgeStencil takes over from there—automatically analyzing the real application, locating hot functions, forging kernels, then performing operator replacement, correctness verification, and integration back into the original application, with no human expert involved in any optimization decision.
ForgeStencil consists of a Kernel Agent and an App Agent. Together they close the full loop from operator optimization to application deployment: the system optimizes not just a single kernel but the entire application.
Kernel Agent: the "scientist" that forges operators
It focuses on autonomously researching and synthesizing high-performance kernels. For mainstream Stencil types, a wide range of shapes, and different precision requirements, it builds its own matrix of specialized operators, turning the mathematical expression of a Stencil operator into elegant code that approaches the physical limits of the hardware.
In operator benchmarks on identical hardware, ForgeStencil was compared with the best open-source algorithms available (including well-known frameworks such as Halide, Devito, EBISU, DRStencil, and FlashFFTStencil) and showed a strong technical advantage:
At the same precision (fp32), it achieved a geometric mean speedup of 2.35×;
With mixed-precision (fp16) reads and writes, it gained a further 1.95× speedup;
Even on all shapes of variable-coefficient Stencils, widely considered the hardest case in the field, it still delivered a geometric mean 1.34× speedup over the best baseline.
App Agent: the "doer" of application deployment
Unlike clean, idealized benchmark environments, real-world scientific computing code often does not consist of standard Stencil loops. From input and output formats to the computation flow, everything is tightly bound to the specific application. Traditional static operator libraries therefore usually cannot be dropped directly into real software.
App Agent's approach is to forge a plan for each application individually: locate performance hotspots, establish the application's own GPU baseline, forge candidate optimizations, validate them with the program's built-in checks and timers, and integrate them back into the application.
At the framework level, App Agent looks for operator fusion opportunities and extracts the Stencil operators to be optimized. Kernel Agent optimizes the specific operators, using the operator matrix it built earlier as a knowledge base for further work. Finally, App Agent runs end-to-end evaluation with the application's own test cases, ensuring the optimization targets real scenarios.
ForgeStencil was developed by ModelBest on top of Forge Engineering, a new software engineering paradigm aimed at accelerating the efficiency of intelligence evolution. It is the team's latest major technical breakthrough after ForgeTrain, the May result of "AI making AI."
Through the closed-loop collaboration between Kernel Agent (theoretical discovery) and App Agent (engineering deployment), ForgeStencil achieves an intelligent evolution from "automatically generating code" to "automatically researching optimizations," and from "speeding up isolated operators" to "deploying in real applications."
100+ real applications optimized in just one week
In the past, for an HPC expert to optimize one real industrial or scientific computing application, they had to analyze performance bottlenecks, understand the software architecture, identify Stencil patterns, design an optimization plan, develop high-performance kernels, verify correctness, and integrate the changes... The whole process took days to weeks, and one person could usually fine-tune no more than 20 applications a year.
In the era of large models, that rule has been rewritten:
According to the team's statistics, ForgeStencil automatically optimized more than 100 real applications in just one week—cutting per-application optimization time to the hour level. R&D throughput rises by roughly one to two orders of magnitude and R&D efficiency by about 100×, and both scale out in parallel as more compute is added.
That also means the optimization of Stencil operators—and of the industrial and scientific applications they determine—has broken free of the old human-labor limit. For the first time, scaling is possible, and it can powerfully accelerate China's "smart" manufacturing.
ForgeStencil has already completed automated optimization on a set of mainstream scientific software and authoritative benchmarks, achieving real end-to-end speedups over the applications' own GPU implementations. About 42% of these directly correspond to real industrial production software.
This is where ForgeStencil differs: it does not stop at leaderboards. It targets real industrial scenarios directly, with optimization goals that serve actual production at oil companies, medical device makers, meteorological agencies, and other industries.
These production applications include:
hypre (LLNL structured multigrid solver library, 3.86× speedup): one of the production numerical libraries most widely relied on for industrial simulation worldwide; ForgeStencil figured out the difficult memory-access merging optimization for the red-black Gauss-Seidel smoother on its own
minisweep (Sn discrete ordinates transport, reactor neutronics, 5.78× speedup): essential for core reactor design calculations; ForgeStencil restructured its highly complex KBA wavefront sweep.
gprMax / FDTD (Maxwell electromagnetic simulation on a Yee grid, 2.47× speedup): a backbone of radar and chip electromagnetic simulation; ForgeStencil replaced the core Stencil kernels for electromagnetic equipment and ground-penetrating radar.
RTM reverse time migration (oil and gas seismic imaging, 1.81× speedup).
TOTAL E&P minimod (TotalEnergies oil and gas seismic mini-app, 1.22× speedup): a workhorse algorithm in oil exploration.
QuantLib bond pricing (quantitative finance, 1.82× speedup): a pricing library used by financial institutions.
FHd non-Cartesian MRI reconstruction (2.45× speedup): medical imaging software.
DBT digital breast tomosynthesis back-projection (1.63× speedup): a reconstruction and imaging workload in medical devices.
Compared with optimization by human experts, AI optimization has another technical advantage:
A human expert's experience lives in their own head and is hard to share. ForgeStencil runs many parallel agents that share a knowledge base, so experience is shared in real time and intelligence can evolve collectively and in sync.
Helping China's industrial software break through on performance
ForgeStencil aims to bring a new R&D paradigm to industrial software and scientific computing applications.
In the short term, automated optimization of existing software delivers immediate returns. Industrial or scientific software already bottlenecked on Stencil can get implementations close to the hardware limit within hours. The savings in compute and R&D time help industry and research cut costs and raise efficiency.
In the long term, ForgeStencil presses the "fast-forward" button on China's manufacturing upgrade.
The applications behind Stencil operators include industrial software for CAE simulation, seismic imaging, electromagnetic and fluid computation, and more. They are the digital foundation of high-end equipment, energy exploration, and chip design. Once performance optimization for these programs is automated, China's manufacturing will move into the fast lane.
From ForgeTrain to ForgeStencil, ModelBest is convinced that Forge Engineering is the new software R&D paradigm of the future. ForgeStencil is now open source. We invite HPC researchers, industrial software practitioners, and open-source community developers to join us in forging a more efficient, more autonomous computing future with AI.
➤ Open-source link
🔗 https://github.com/OpenBMB/ForgeStencil