Skip to content
Preprint

Differentiate the Solver, Not the Equation: Reverse-Sweep Adjoints for Block Implicit Simulation

Aug 2026 · 1 citation · 39 references
Computer Science Mathematics

TL;DR

This work proposes solver-level differentiation, which differentiates the executed solver itself through the identical executed forward to machine precision at every solver depth; in a controlled same-codebase, same-GPU comparison it is 33x faster and uses 71x less memory than unrolled automatic differentiation.

Abstract

Differentiable simulation is a key component in learning, control, and inverse problems, where gradients through nonlinear implicit solvers are required. Existing approaches either rely on unrolled automatic differentiation, whose memory grows with solver depth, or on equation-level implicit differentiation, which assembles global Jacobians and solves large sparse adjoint systems, discarding the locality of the forward solver -- and differentiating the converged equation rather than the finite computation that actually ran. We propose solver-level differentiation, which differentiates the executed solver itself. When a solver is composed of block implicit updates, its discrete adjoint is obtained by applying the corresponding adjoint updates in reverse order, yielding a reverse-sweep formulation whose backward pass mirrors the forward solver. From an operator perspective, the forward pass realizes an approximate inverse through ordered local solves, and the backward applies its transpose through reverse local adjoint solves, constructing no global system. We instantiate this idea on Vertex Block Descent, yielding a differentiable solver whose reverse colored Gauss-Seidel sweeps are composed entirely of local $3\times 3$ adjoint solves. The backward matches automatic differentiation through the identical executed forward to machine precision at every solver depth, where the equation-level adjoint is off by 37% after one sweep; in a controlled same-codebase, same-GPU comparison it is 33x faster and uses 71x less memory than unrolled automatic differentiation; and the same construction is exact on projective dynamics and extended position-based dynamics. We scale differentiable elastodynamics to $10^6$ contact-coupled soft bodies (8M vertices) on one GPU. Overall, this work highlights solver structure as a practical organizing principle for efficient differentiable simulation.

View source

Similar papers

#machine learning Preprint Sep 2026

lapanda: A Matrix-Free Differentiable Solver for Nonconvex Constrained Optimization Layers

This work reformulates the problem to a sequence of augmented Lagrangian subproblems, each handled by a first-order inner solver through a proximal averaged quasi-Newton algorithm with adaptive linesearch, thus enabling efficient forward optimization.

Yuan-Kun Chen, Zi-Fei Nie, Kang-Yu Lin et al. · 0 citations
#machine learning Preprint Sep 2026

GRADSOLVE: fast exact gradients for ODE ensembles on GPUs

Ordinary differential equations (ODEs) underlie models in science and engineering, and many applications need derivatives of their solutions with respect to parameters. Ensembles of independent trajectories suit graphics processing units (GPUs), but current GPU software forces a trade-off: the fastest ensemble solvers...

A. S. Mancini · 2 citations
Preprint Sep 2026

Diff-NekRS: A Scalable Differentiable Framework for Multi-Timestep Solver-in-the-Loop Training

Diff-NekRS is introduced, a scalable differentiable framework that embeds neural corrections directly in the GPU-accelerated NekRS incompressible-flow solver, and establishes a verified and scalable path for multi-timestep solver-in-the-loop training that improves coarse-grid trajectory accuracy while retaining a speed...

Junoh Jung, R. Balin, Bethany Lusch et al. · 0 citations
Preprint Sep 2026

Deep Truncated FBSDE Method: A Robust Solver for High-Dimensional Nonlinear PDEs and Fully Coupled FBSDEs

In this paper, we introduce a deep truncated forward-backward stochastic differential equation (FBSDE) method for high-dimensional partial differential equations (PDEs). Compared with existing deep-learning solvers for fully coupled FBSDEs, where strong coupling may lead to numerical instability, our approach exhibits...

Xin-Yu Cheng, Yun-Zhang Li, Wei-Ran Xiong · 0 citations
Open access Sep 2026

Performance Portable Adjoints for Structured Mesh Applications with OPS

This work extends the Oxford Parallel library for Structured mesh solvers (OPS) domain-specific language to compute derivatives using the reverse mode of AD, and focuses on adjoint-mode AD for structured mesh stencil applications.

G. D. Balogh, J. Lotz, J. du Toit et al. · 0 citations
Preprint Oct 2026

Preconditioning proximal Galerkin: mesh and degree robust solvers for variational inequalities

The proximal Galerkin algorithm is a structure-preserving solver for variational inequalities that results in discretization-independent nonlinear iteration counts. However, in large three-dimensional simulations, the arising Newton saddle point systems cannot be feasibly solved by direct methods. To leverage an iterat...

Ioannis P. A. Papadopoulos, Pablo D. Brubeck · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.