Many scientific codes spend most of their time in a few expensive components: a radiation or microphysics parameterization, a chemistry solver, a closure model, a constitutive law. A trained surrogate can make those components orders of magnitude cheaper, but only if it is coupled efficiently, stays stable over long integrations, respects physical constraints and can be validated to the standard a scientific result requires.
This course takes the HPC developer's view. You start by identifying surrogate candidates with profiling and by designing training data generation from the simulation itself. You then couple models to Fortran in-process: FTorch (LibTorch-backed, no Python at runtime), NVIDIA's TorchFort (inference and online training driven from Fortran or C/C++), Berkeley Lab's Fiats (native Fortran 2023 inference), and ONNX Runtime through iso_c_binding, and compare these with remote or file-based coupling. For C++ codes you use LibTorch and ONNX Runtime directly, including from Kokkos-based applications. You place inference on GPUs alongside MPI ranks, batch across grid points, manage device memory shared with the solver, and train online while the simulation runs. The final modules cover what makes results trustworthy: a priori and a posteriori testing, long-run stability, conservation and constraint enforcement, fallbacks to the physics routine, uncertainty, reproducibility and scaling studies. Library facts are as of October 2026; several of these libraries are research software with evolving APIs, and the course teaches how to isolate them behind a stable interface.