Reversible random number generation for adjoint Monte Carlo simulation of the heat equation
Emil Løvbak, Frédéric Blondeel, Adam Lee, Lander Vanroye, Andreas Van Barel, Giovanni Samaey
TL;DR
The paper tackles the memory bottleneck in PDE-constrained optimization using adjoint methods when employing Monte Carlo solvers, where identical particle trajectories are needed for constraint and adjoint simulations. It introduces a reversible extension to the PCG pseudorandom number generator, with a strategy to reversibly generate distributions via accept-reject sampling and, when necessary, a secondary generator to supply additional random values without correlative bias. The approach is validated on a 1D heat equation, showing that constraint path recomputation can replace storing full trajectories while preserving similar computational costs, thereby mitigating memory blow-up. This reversible RNG framework offers a practical alternative to checkpointing, enabling scalable adjoint MC methods for larger and more complex PDEs in areas such as engineering design and fusion research.
Abstract
In PDE-constrained optimization, one aims to find design parameters that minimize some objective, subject to the satisfaction of a partial differential equation. A major challenges is computing gradients of the objective to the design parameters, as applying the chain rule requires computing the Jacobian of the design parameters to the PDE's state. The adjoint method avoids this Jacobian by computing partial derivatives of a Lagrangian. Evaluating these derivatives requires the solution of a second PDE with the adjoint differential operator to the constraint, resulting in a backwards-in-time simulation. Particle-based Monte Carlo solvers are often used to compute the solution to high-dimensional PDEs. However, such solvers have the drawback of introducing noise to the computed results, thus requiring stochastic optimization methods. To guarantee convergence in this setting, both the constraint and adjoint Monte Carlo simulations should simulate the same particle trajectories. For large simulations, storing full paths from the constraint equation for re-use in the adjoint equation becomes infeasible due to memory limitations. In this paper, we provide a reversible extension to the family of permuted congruential pseudorandom number generators (PCG). We then use such a generator to recompute these time-reversed paths for the heat equation, avoiding these memory issues.
