Every breakthrough in modern industry and cutting-edge research is backed by a large-scale high-performance computing software, whose core often lies in a computationally intensive and unavoidable computational pattern - Stencil computation. Whether it's weather forecasting, seismic exploration, electromagnetic simulation, or material simulation, the essence is to repeatedly update the entire grid using weighted combinations of grid point neighbors. This kind of computation is memory-intensive and constrained by memory bandwidth, often consuming a large portion of the application's runtime, and its speed directly determines the efficiency of key industrial and scientific software in a country.

Previously, optimizing Stencil to the physical limits of hardware could only be done by extremely scarce HPC experts. Although compilers, code generators, and automated tuning systems can automatically generate code and search parameters, the optimization algorithms themselves still required manual design and integration. When scenarios, shapes, or hardware changed, they had to be manually re-integrated, always failing to scale. Now this situation has been broken open - Mianbi Intelligence, together with the OpenBMB open-source community, has released the world's first AI optimization system for Stencil, ForgeStencil, which supports automatic research and deployment, and is directly open-sourced.

image.png

According to disclosures, ForgeStencil completed the automatic optimization of over 100 real industrial and scientific computing software within just one week, reducing the optimization time per application to hours, increasing R&D efficiency by about 100 times, and scaling with computing power. This means that for the first time, Stencil optimization is free from human constraints, making scalability possible.

Its most disruptive aspect is the dual Agent-driven, zero-human intervention approach. Humans simply need to throw in the source code of the application to be optimized. From automatic analysis, hotspot localization, kernel forging, to operator replacement, correctness verification, and integration back into the original application, no experts are involved in decision-making throughout the process. The system consists of two parts: Kernel Agent and App Agent. The former is the scientist responsible for operator forging, independently researching and synthesizing high-performance kernels, building specialized operator matrices for mainstream Stencil types, various shapes, and precision requirements, translating mathematical expressions into elegant code that approaches the hardware limit. The latter is the pragmatic engineer, crafting tailored solutions for each real application, identifying hotspots, establishing GPU baselines, verifying integrations, and finally conducting end-to-end evaluation using the application's own test cases.

In the operator competition, ForgeStencil invited well-known frameworks like Halide, Devito, EBISU, DRStencil, and FlashFFTStencil to compete on equal terms: under the same fp32 precision, it achieved a geometric mean acceleration of 2.35 times; under mixed fp16 precision, it gained an additional 1.95 times speedup. Even on the notoriously difficult variable-coefficient Stencil with all shapes, it still achieved a geometric mean acceleration of 1.34 times compared to the best baseline.

image.png

Even more impressive is that it delves into real industrial scenarios, not just idealized benchmarks. In mainstream scientific software and authoritative benchmarks, about 42% of the optimizations directly correspond to real industrial production: the hypre structured multigrid solver library was accelerated by 3.86 times, minisweep nuclear reactor neutron transport was accelerated by 5.78 times, gprMax and FDTD electromagnetic simulations were accelerated by 2.47 times, RTM reverse time migration for oil and gas seismic imaging was accelerated by 1.81 times, Total's minimod seismic mini-app was accelerated by 1.22 times, QuantLib bond pricing was accelerated by 1.82 times, non-Cartesian MRI reconstruction was accelerated by 2.45 times, and digital breast tomosynthesis back-projection was accelerated by 1.63 times. It directly tackles real production loads from oil companies, medical equipment, and meteorological departments.

Compared to human experts who keep their knowledge locked in their minds and are hard to share, ForgeStencil allows a large number of parallel agents to share a common knowledge base, enabling real-time exchange of experience and achieving intelligent collective synchronization and evolution. This is another achievement from Mianbi Intelligence based on the Forge Engineering software engineering paradigm, following the ForgeTrain release in May. It moves from self-generated code to automatic research and optimization, and from local operator acceleration to real application deployment.

Short-term, the automatic optimization of existing industrial software can achieve near-hardware-limit results within hours, directly reducing costs and improving efficiency through computing cost savings and R&D compression. Long-term, when the digital foundation of high-end equipment, energy exploration, and chip design such as CAE simulation, seismic imaging, electromagnetism, and fluid dynamics is automatically optimized, the acceleration of domestic manufacturing upgrading will be stepped on. Currently, ForgeStencil is open-sourced on GitHub, and Mianbi Intelligence has issued an invitation to HPC scholars, industrial software professionals, and open-source developers to join in building it.