PCGBandit: One-shot acceleration of transient PDE solvers via online-learned preconditioners

Mikhail Khodak, Min Ki Jung, Brian Wynne, Edmond Chow, Egemen Kolemen · DOI

Introduction

Solving transient Partial Differential Equations (PDEs) is a cornerstone of scientific computing, essential for modeling phenomena ranging from fluid dynamics to nuclear fusion. A significant portion of the computational budget in these simulations is consumed by solving large systems of linear equations ($Ax = b$) at each timestep. While deep learning approaches have attempted to replace traditional solvers, they often require extensive, expensive pre-training and can struggle with numerical accuracy.

PCGBandit offers a "one-shot" alternative that accelerates simulations by learning to select optimal preconditioners on the fly. By requiring zero pre-training and maintaining the mathematical rigor of classical solvers, it provides a practical path to faster scientific discovery without the typical "deep learning tax."

The PCGBandit Framework

The core innovation of PCGBandit is treating the selection of a preconditioner for the Preconditioned Conjugate Gradient (PCG) solver as a Multi-Armed Bandit problem. In a typical simulation, the physical state evolves, meaning the most efficient preconditioner—whether a complex Multigrid method or a simpler Incomplete Cholesky (IC) method—may change over time. Traditionally, researchers pick one preconditioner at the start, often leaving significant performance on the table.

Overview of the PCGBandit framework integrating learning into the simulation loop.

As illustrated in the figure above, PCGBandit integrates a learning step directly into the simulation loop. It uses the Tsallis-INF adversarial bandit algorithm to adaptively select from a search space of 33 preconditioner configurations. Unlike stochastic bandits, this adversarial approach is robust to the non-stationary environments typical of evolving physical simulations. The "learner" begins at the first timestep and refines its selection strategy based on the observed computational cost (feedback) of previous steps, aiming to minimize the total wallclock time.

Experimental Evaluation

PCGBandit was implemented as a drop-in replacement for the standard PCG solver in OpenFOAM, the industry-standard open-source Computational Fluid Dynamics (CFD) software. The authors evaluated the method across six diverse transient tasks:

  1. 3D DNS: Direct numerical simulation of turbulence.
  2. Pitz-Daily: 2D fluid flow over a backward-facing step.
  3. Stefan Problem: Multi-phase simulation (melting/freezing).
  4. Dam-break: Multi-fluid simulation of a collapsing water column.
  5. Shercliff Flow: Magnetohydrodynamics (MHD) involving conductive fluid.
  6. Fringing B-field: MHD flow through a pipe in a magnetic field.

To ensure reproducibility across different hardware, the authors utilized a deterministic cost estimator based on Floating Point Operations (FLOPs) rather than potentially noisy wallclock time measurements for the bandit's feedback.

Results and Discussion

The evaluation demonstrated significant performance gains across the test suite:

  • Wallclock Speedups: PCGBandit achieved up to a 1.5x reduction in total wallclock time compared to the best fixed-preconditioner baseline.
  • Solver Efficiency: In terms of time spent specifically within the linear solver, speedups reached up to 4x over standard defaults.
  • Accuracy and Robustness: Because the algorithm only modifies the preconditioner and not the solver's fundamental logic, the numerical results remain identical to classical methods. Furthermore, PCGBandit consistently matched or exceeded the performance of default OpenFOAM settings, effectively removing the need for manual solver tuning.

Limitations and Future Work

While highly effective, PCGBandit faces a "cold start" challenge where the initial exploration phase can be costly if the first timesteps are computationally intensive. Future iterations may incorporate Contextual Bandits to leverage physical state information (e.g., pressure gradients) for more informed decision-making. Additionally, extending the framework to non-symmetric systems using solvers like GMRES is a logical next step for broadening the method's applicability.

Summary updated

BibTeX
@article{khodak2026pcgbandit,
  author = {Mikhail Khodak and Min Ki Jung and Brian Wynne and Edmond Chow and Egemen Kolemen},
  title = {{PCGBandit: One-shot acceleration of transient PDE solvers via online-learned preconditioners}},
  journal = {Comput. Phys. Commun.},
  year = {2026},
  doi = {10.1016/j.cpc.2026.110304},
}
Figure