Manuscript Offprint
arXiv:2610.37333diff-soup: GPU-native Differentiable Simulation and Inference for Large-scale Stiff Dynamical Systems
Abstract
Learning physical models from spatiotemporal data requires simulating systems of partial differential equations (PDEs) and differentiating through their solution. Upon spatial discretization, these models give rise to stiff dynamical systems that require repeatedly solving large, sparse linear systems. Traditional scientific computing frameworks are largely CPU-based and require problem-specific tuning to accelerate, scale, and differentiate. In this work, we introduce diff-soup, a differentiable, sparse-oriented, unified PDE suite for GPU-native simulation and inference of large, stiff dynamical systems. Built in JAX, diff-soup provides 1) a fully differentiable design for problems with sparse structure, 2) scaling to large problems through the NVIDIA cuDSS sparse direct solver with model and data multi-GPU parallelism, and 3) end-to-end PDE-constrained optimization, from classical statistical inference to embedded deep learning. On stiff PDE benchmarks, diff-soup outperforms established CPU- and GPU-based frameworks by one to two orders of magnitude in both forward solves and gradients. We demonstrate both a classical Bayesian inference workflow, identifying constitutive relationships, and a modern deep learning workflow, training a neural field for the catalyst activity of a three-dimensional packed bed reactor. We provide diff-soup as an open-source repository to facilitate research in computational science and engineering.
*Corresponding author.
E-mail address: bazant@mit.edu
PROGRAM SUMMARY
Program Title: diff-soup: differentiable, sparse-oriented unified PDE suite
CPC Library link to program files: (to be added by Technical Editor)
Developer’s repository link: https://github.com/stmorgenstern/diff-soup
Licensing provisions: BSD 3-Clause
Programming language: Python, C++
Supplementary material: The program files in the CPC Program Library contain diff-soup 1.0.0 together with the companion repository diff_soup_paper, which holds the benchmark suite, manifests, result stores, figure pipeline and worked examples.
Nature of problem: Computational modeling of time-dependent partial differential equations (PDEs) gives rise to large systems of stiff ordinary differential equations and differential-algebraic equations. Robust and efficient integration of these systems requires implicit variable step, variable order (VSVO) methods such as BDF and NDF, whose predominant cost is the repeated factorization and solution of large sparse linear systems. The established stiff integration libraries run these operations on the CPU, and the general-purpose implicit ODE/DAE time-integration libraries of the JAX ecosystem rely on dense linear algebra, so large two- and three-dimensional problems remain out of reach for GPU-native, differentiable simulation. These challenges have limited the adoption of machine learning in general multiphysics modeling workflows.
Solution method: We introduce diff-soup, a general-purpose differentiable, sparse-oriented unified PDE suite for GPU-accelerated multiphysics modeling, simulation, and inference. We provide a user-friendly Recipe API that models complex physical systems in math-like notation on both structured and unstructured domains with the finite difference, finite volume, and finite element methods. For fast simulation, we implement sparse Jacobian assembly by automatic differentiation with graph coloring, three VSVO stiff integrators written natively in JAX, and a wrapper to the NVIDIA cuDSS sparse direct linear solver on the GPU. All simulations are fully differentiable to second order, enabling large-scale PDE-constrained optimization. Using these derivatives, we provide an inference module for PDE-constrained least-squares problems, from classical frequentist and Bayesian inference to modern deep learning approaches. Both simulation and inference exploit batched solves, data parallelism, and model parallelism to scale to large problems.
Additional comments including restrictions and unusual features: This article describes diff-soup 1.0.0. The package runs on Linux x86_64 with Python 3.12 and JAX 0.11. GPU execution requires an NVIDIA GPU with a CUDA 12 or CUDA 13 driver and cuDSS 1.0 or newer, which is installed from NVIDIA's Python wheels.
Without a GPU, every solver runs on the CPU through the KLU and dense backends. Differential-algebraic equations are supported up to index one. Solves can be distributed across several GPUs and across the nodes of a cluster.
Keywords: Partial differential equations, Differentiable simulation, PDE-constrained optimization, GPU sparse direct linear solver, Stiff dynamical systems
Both requirements are difficult to meet for PDEs, because once discretized in space, they fall into the important class of stiff dynamical systems [29]. Stiff problems exhibit multiple competing time scales, such that the slowly varying solution of interest is surrounded by rapidly varying nearby solutions that force a numerical integrator to take small time steps [30]. The integration of stiff systems is a well-established field of computational science, with libraries such as SUNDIALS [31, 32], PETSc [33], DifferentialEquations.jl [34], and the MATLAB ODE suite [35] providing specialized implicit integrators. To both solve and take gradients, these methods require Jacobians which are either manually derived or computed through potentially-inaccurate finite-difference rules, expensive dense automatic differentiation, or performant sparse automatic differentiation. Gradients additionally require complex, bespoke rules for parameter sensitivities that do not easily compose with stiff solvers.
A central component of these algorithms is the repeated solution of large linear systems. For PDEs, the local structure of the differential operators gives rise to a discrete sparse representation, which is exploited either by sparse direct solvers, such as KLU [36], SuperLU [37], and UMFPACK [38], or by iterative Newton-Krylov methods like GMRES [39, 40]. Sparse direct solvers are robust across a wide range of problems but have traditionally been run on the CPU, with GPU-accelerated factorizations emerging only recently [41, 42]. Newton-Krylov methods, in contrast, require only Jacobian-vector products and are naturally implemented on GPUs, but their fast and stable convergence depends on a problem-specific preconditioner.
Existing GPU efforts fall into three groups: hybrid codes that keep the integrator on the CPU and offload Krylov kernels, batched solvers for many small systems, and JAX frameworks that target specific physics or rely on dense linear algebra. SUNDIALS and PETSc support hybrid execution, in which the time integrator remains on the host while large systems are solved with Newton-Krylov methods on the GPU [43, 44]. DiffEqGPU.jl [45] and jaxdae [46] efficiently batch many small problems on the GPU. Differentiable PDE solvers such as JAX-CFD [20], JAX-Fluids [47], and JAX-FEM [48] compose GPU-accelerated simulation with machine learning for specific physics or discretizations, while the general-purpose implicit integrators of diffrax [49] rely on dense linear algebra by default. What remains missing is robust GPU parallelism within a single large, stiff solve, as needed for two- and three-dimensional PDEs, without relying on a problem-specific preconditioner. To our knowledge, no existing package in the Python/JAX ecosystem natively composes GPU sparse direct solvers, variable step, variable order (VSVO) time integration, and sparse automatic differentiation for the differentiable simulation of large dynamical systems.
The recent release of cuDSS by NVIDIA [50], a sparse direct solver that performs the numerical factorization and the triangular solves on the GPU, removes the major bottleneck in the robust integration of large-scale PDEs. In this work, we present diff-soup, a GPU-native package for the simulation and inference of large, stiff PDE systems, built around the cuDSS linear solver and sparse automatic differentiation in JAX. Traditionally, differential equation software has been developed for small model problems and extended to large multiphysics systems afterwards, whereas we take the opposite approach and design every component around the sparse structure of large discretized PDEs. diff-soup provides the standard numerical tools of a large-scale stiff solver, including VSVO integrators for stiff ordinary differential equations (ODEs) and index-1 differential-algebraic equations (DAEs) with consistent initialization, event handling, and sparse automatic differentiation, together with finite difference, finite volume, and finite element discretizations on grids and meshes. Beyond these standard tools, diff-soup is distinguished from existing stiff solvers by
-
a GPU-native and fully differentiable design that is specialized to problems with sparse structure,
-
accelerator-specific techniques for reaching large problems, namely reduced precision, batched solves, and multi-GPU parallelism, and
-
end-to-end workflows for PDE-constrained optimization, with second-order optimizers, multiple shooting, and statistical inference, that compose with JAX libraries such as equinox [51], optax [52], and blackjax [53] for embedded deep learning models and uncertainty quantification.
The remainder of this paper is organized as follows. Section 2 reviews the computational background on VSVO time integration, sparse methods, and differentiable simulation. Section 3 describes the modeling, simulation, and inference modules of diff-soup. In Section 4, we benchmark forward solves and gradients against SUNDIALS, PETSc, DifferentialEquations.jl, MATLAB, and diffrax, and we examine reduced precision and multi-GPU execution. In Section 5, we demonstrate two end-to-end applications, the Bayesian inference of the constitutive relationships of a phase-separating material from image data and the training of a neural field embedded in a three-dimensional packed bed reactor model.
2. Mathematical Background
In this work, we consider time-dependent systems that take the general form of a differential-algebraic equation
(1) where is the state, is time, is the parameter vector, and is the control state that carries externally prescribed inputs. These systems are solved on the interval and the initial state is prescribed as . For many systems, this generally reduces to mass-matrix form
where is the (non-)singular mass matrix. We partition the state variable into the local differential states, , which carry explicit time derivatives in the governing form, local algebraic states, , which are specified through algebraic constraints with a sparse structure, and global algebraic variables, , , which are treated as dense and typically arise from global constraints on the state variables. Since , this split lets us handle the global variables separately (Sec. 2.2). In this section, we discuss the relevant background on the three main computational aspects of diff-soup: robust methods for numerical integration of stiff equations, exploiting sparse structure to accelerate computations, and computing sensitivities of differential algebraic equations for PDE-constrained optimization.
2.1. Variable Step, Variable Order Algorithms
In this work, we consider stiff systems with a defined sparse structure, as is typical for the discretization of partial differential equations using the method of lines. Partial differential equations are naturally stiff due to the decaying spectrum of the underlying differential operators that translates to a large, resolution-dependent ratio between the minimum and maximum eigenvalues [29]. Stable integration therefore requires specialized methods, since explicit methods are limited by a CFL time scale and naive implicit methods need a prohibitive number of steps to resolve fast dynamics.[54, 55]. We consider the variable step, variable order (VSVO) class of numerical integration algorithms [56, 57] which we separate into two families based on the discretization of the time derivative: backward differentiation formula (BDF) [58] in fixed-leading-coefficient (FLC) form [59] and the numerical differentiation formula (NDF) [60] in quasi-constant step size (QSS) form [35]. We implement three algorithms in diff-soup: the JAX implicit differential algebraic (JIDA) solver based on the popular IDA implementation in SUNDIALS [31], the JAX BDF solver (JBDF) based on the CVODE_BDF implementation in SUNDIALS [31] and FBDF implementation in DifferentialEquations.jl [34], and the JAX NDF solver (JNDF) based on the ode15s algorithm [35] and implementation of QNDF in DifferentialEquations.jl [34].

Figure 1: Control flow of one trial step in a variable-step, variable-order implicit multistep integrator. The predictor extrapolates the accepted history at , and a modified Newton iteration solves the corrector equation using reused or refreshed sparse LU factors of . Blue boxes mark the linear-solver work that dominates the cost for large systems. A step attempt can fail from the nonlinear solve if the Newton increments diverge or their contraction rate predicts that the corrector cannot reach tolerance within the iteration budget. Additionally, the step can be rejected if the corrector converges, but the weighted local-error estimate exceeds tolerance. Before retrying the same step, nonlinear failure refreshes and and may reduce , while error rejection reduces and may lower . Acceptance commits the history and advances to the next step at .
All three algorithms follow a three-stage structure: Eq. (1) or (2) is discretized in time with an implicit multistep formula, the resulting nonlinear system is solved with a modified Newton iteration, and the step size and order are adapted to control the local error. Figure 1 shows the control flow of one trial step. A k-step formula approximates the time derivative at from the current and k stored states,
where is the current step size and , are order-dependent coefficients normalized such that . The NDF family folds a scaled predictor-corrector difference and its history tangents into and , where the scalar parameter trades a modest reduction in the stability angle at higher orders for a smaller truncation-error constant [60, 35]. Substituting Eq. (3) into Eq. (2) produces a nonlinear algebraic system whose root advances the state by one step. Writing , each modified Newton iterate solves the linearized system
and updates . The overall scaling of the corrector equation is purely conventional, since applying Newton's method to produces identical iterates with the rescaled matrix , so implementations are free to factorize whichever form of this pencil is most convenient [61]. For the fully implicit form of Eq. (1), the same iteration applies with the generalized matrix [62, 63]. The iteration is warm-started from a predictor extrapolated through the stored history, which is typically accurate enough that a few corrections suffice.
For large systems, the dominant computational bottlenecks are the formation of and the subsequent factorization of the pencil matrix during the linear solve at each iteration of Eq. (4) [29, 61]. The modified Newton iteration freezes both quantities as long as possible, even though reusing the old Jacobian reduces the convergence rate of Newton's method from quadratic to linear [61]. As such, the development of reliable heuristics for efficient reuse of J across both nonlinear solver iterations and time steps has been an intense area of research and hinges on the interplay between caching rules and the step size and order controllers, which we describe in turn [29, 31].
For the caching rules, all three solvers guard the nonlinear iteration with a two-tier setup gate that re-evaluates the cached Jacobian only when it has aged past a step budget or when a convergence failure has occurred [31]. Otherwise, when the ratio of the current to the value frozen into the factors of has drifted outside a deadband, the mass-matrix engines rebuild the pencil from the saved without re-differentiation [31]. JIDA extends the same reuse to the fully implicit form, recomposing from the saved while re-evaluating only , whereas the reference DAE integrator refreshes both partial derivatives at every setup [63, 31]. A convergence-rate memory extrapolates the contraction of the iteration and declares divergence after two iterations rather than exhausting the iteration budget, and failed steps escalate through a ladder that refreshes the Jacobian and shrinks the step [35, 31]. This cost hierarchy shapes the control layer that follows, because any change of the step size or the order moves and invalidates the saved factors, so the controllers are built to change both quantities only as often as accuracy demands.
For the local error control, each solver estimates the local truncation error of the converged step from the difference between the predictor and the corrected solution, scaled by an order-dependent constant, and measures it in the weighted root-mean-square (WRMS) norm
where the weight blends the absolute tolerance atol and the relative tolerance rtol so that accepts the step as accurate to the requested tolerances [61, 31]. Because the stored history spans the adjacent orders, the same difference tables furnish companion error estimates at orders and at negligible additional cost, and these three estimates drive both the step size and the order selection [56, 29].
Each controller converts the error estimate at order into a proposed growth factor for the step size, , through a safety-biased power law of the form , and passes the proposal through a deadband around unity that holds the step size, and thereby the saved factors of , unless the predicted change is large enough to justify a refactorization [61]. The companion estimates at the adjacent orders enter the same way, each candidate order competing through its own estimate. The solvers differ in three respects, summarized in Table 1: the width and asymmetry of the deadband, the statistic that decides the order, and the handling of startup and failures. JBDF and JIDA follow their SUNDIALS references [31, 63], while JNDF follows the adaptive scheme of Shampine and Reichelt [35] adopted by QNDF [34].
Table 1: Comparison of step-size and order control in the three solvers. After each accepted step, all three form and suppress changes in that do not justify refactorizing .
| JBDF | JIDA | JNDF | |
|---|---|---|---|
| Deadband | Hold for η < 1.5 and grow otherwise. An accepted step never reduces h. | Hold for 1 < η < 2. Growth is restricted to doubling and reductions to factors in [0.5, 0.9]. | Hold within a constant-step window lasting through q + 2 consecutive constant steps. A steady-state window suppresses mild reductions, but an accepted step may reduce h. |
| Order statistic | Largest candidate growth factor among q - 1, q, and q + 1. | Smallest scaled truncation-error estimate among q - 1, q, and q + 1. | Largest proposed step size among q - 1, q, and q + 1. |
| Order cadence | Only after a wait counter expires. The wait is q+1 steps after an order change and at least two otherwise. | Every accepted step. Order increases require constant-(h, q) history. | Every accepted step. |
| Startup | No separate regime. The first-step growth cap is large. | After the first accepted step, increase the order and double h until the order stops increasing or a step fails. | No separate regime. |
| Failure recovery | Progressively reduce h, possibly lower the order, and restart at order 1 if necessary. Suppress further changes on the first accepted recovery step. | The first rejection reduces h and may lower the order, the second applies a fixed reduction, and the third forces order 1. Convergence failures reduce h and refresh J. | The second consecutive rejection halves h, the third lowers the order, and a fourth rejection at order 1 restarts the history. |
Beneath the controllers, the QSS NDF and FLC BDF families differ in the response of the multistep coefficients in Eq. (3) to a realized change in the step-size history. The QSS implementation retains the constant-step coefficients at every step, which makes the formula and its error estimates exact only on a uniform step grid, so it prefers long runs at a fixed step size, defers order changes until the history has run uniformly for several steps, and answers a realized change by rescaling the entire backward-difference history onto the new grid [35]. The fully variable-coefficient alternative of EPISODE and VODE recomputes every coefficient from the realized nonuniform history, which gives the strongest stability on rapidly varying steps but lets every change in the history perturb the iteration matrix, sacrificing the reuse of the factorization [57, 64]. The FLC implementation compromises by pinning the leading coefficient at its constant-step value while the trailing coefficients track the realized history, so that the iteration matrix depends on the step history only through and the stability loss relative to the fully variable-coefficient form is modest [59]. JNDF follows the QSS convention with the backward-difference table of Shampine and Reichelt [35], while JBDF follows the FLC convention with the Nordsieck history of Hindmarsh et al. [31] and JIDA with the divided-difference history of Brenan et al. [63]. We refer the reader to the standard references for complete descriptions of the formulas, controllers, and failure heuristics [56, 65, 63, 35, 31, 29].
2.2. Exploiting Sparsity
As established above, the two dominant computational bottlenecks of the VSVO integration are the formation of the Jacobian and the factorization of the pencil matrix within the modified Newton iteration [29, 61]. Conventional discretization methods for PDEs, such as the finite difference method (FDM), the finite volume method (FVM), and the finite element method (FEM), represent local differential operators in a sparse form such that each component of couples to a bounded set of neighbors, so the Jacobian has nonzero entries in a pattern that is fixed by the discretization a priori. Exploiting this property, we store and in sparse data structures that drastically reduce the memory footprint. In this section, we describe how diff-soup uses this structure to speed up the Jacobian computation, pencil matrix factorization, and efficiently handle dense, global variables.
Traditionally, differential equation libraries offer three routes to the Jacobian: analytical Jacobians supplied by hand, as in SUNDIALS and PETSc
[31, 66], which is cumbersome and error-prone for all but the simplest right-hand sides; finite difference approximations, whose truncation and round-off errors degrade the convergence of the Newton iteration [31]; and dense automatic differentiation, which is exact but requires n tangent or cotangent evaluations therefore scaling as [67]. More recently, sparse automatic differentiation has matured in the Julia ecosystem, which pairs automatic sparsity detection with graph coloring to compress the Jacobian into a small number of directional derivatives and deploys the approach throughout its differential equation solvers [34, 68].
diff-soup builds on this template with the automatic differentiation machinery of JAX [69]. We assemble the pattern symbolically by composing the declared patterns of the operators that constitute the right-hand side and we compress the Jacobian following the Curtis-Powell-Reid (CPR) approach with a greedy, largest-first coloring of its column intersection graph [70, 71, 72]. The colors define a seed matrix , whose k-th column sums the unit vectors of the columns assigned to color k, and every nonzero entry of J can be read off from the compressed product
because structurally orthogonal columns deposit their entries into disjoint rows of . For the bounded stencils of FDM and FVM discretizations, is set by the stencil width independent of the resolution, so , and we compute all tangent propagations in parallel with the jax.vmap operator, reducing the cost of the Jacobian from to . The same batching applies to FEM kernels, where jax.vmap evaluates the element-local residuals across all elements, and the local kernels are differentiated and scattered to assemble the sparse Jacobian in .
Because the global variables couple broadly to the state, they typically produce dense rows and columns that give J an arrowhead structure. Bidirectional coloring methods can compress such patterns by combining forward and reverse passes [71, 72], but under the unidirectional column coloring we employ, a single dense row makes every pair of columns share a row, so each column needs its own color. We therefore exclude the global variables and equations from the sparsity pattern and compute the two dense coupling blocks with local kernels: the dense rows are evaluated in reverse mode with one jax.jacrev cotangent per global equation, and the dense columns in forward mode with one jax.jacfwd tangent per global variable.
Using this approach, for most PDE problems the remaining computational bottleneck is the factorization of the pencil matrix during the linear solve of Eq. (4). Among the classical factorizations, we consider only the LU decomposition, as the pencil matrix is nonsymmetric for general right-hand sides, which precludes the Cholesky factorization, while the QR factorization roughly doubles the operation count and produces denser factors, which reserves it for ill-conditioned least-squares problems [73]. An LU solver proceeds in three phases: an analysis phase that determines the pivoting strategy and the structure of the factors, a factorization phase that computes the lower and upper triangular factors L and U, and a solve phase that applies them through forward and backward substitution [55]. For a dense matrix, the LU factorization costs while each subsequent solve costs only , so the algorithm concentrates the expense in the analysis and factorization to make the solves fast. This front-loaded cost profile is well matched to the VSVO structure, because the setup gate freezes the pencil across Newton iterations and time steps, so a single factorization is reused for many cheap triangular solves [61, 31]. Nevertheless, the cubic cost of factorization is an immense barrier for large systems. Much research has focused on linear solvers that exploit sparsity to reduce this cubic cost, and for the purpose of our discussion, we limit ourselves to two families: iterative Newton-Krylov methods and sparse direct solvers [74, 73].
Newton-Krylov methods solve the linearized system in a reduced Krylov subspace and therefore require only matrix-vector products with , and hence only Jacobian-vector products, which makes them attractive for large systems [40]. The workhorse algorithm implemented in most libraries is the generalized minimal residual (GMRES) method, which builds an orthonormal basis of and selects the iterate that minimizes the residual norm over the subspace, imposing no symmetry requirements on [39]. However, the convergence of the Krylov iteration deteriorates on the ill-conditioned spectra that stiff discretizations produce, and much work has been devoted to preconditioners that transform the system before the iteration [74]. The best preconditioners are often problem specific, since their goal is to cluster the eigenvalues of the preconditioned system near unity, and the two most common generic choices are the incomplete LU (ILU) factorization and algebraic multigrid (AMG), for which we refer the reader to Saad [74] and Ruge and Stüben [75] for further details.
In contrast to the iterative methods, sparse direct solvers operate on the sparse representation of W itself and require no problem-specific tuning.
Sparse analogs of the LU factorization, such as the KLU algorithm, retain the analysis, factorization, and solve structure while confining the computation to the nonzero matrix entries [36]. In general, the factors of a sparse matrix are generally much denser than the matrix itself due to fill in during elimination, so the analysis phase must compute a fill-reducing ordering and pay careful attention to the interaction between ordering, pivoting, and sparsity [73]. For matrices arising from two- and three-dimensional meshes under nested dissection orderings, the factorization costs and respectively in the total number of unknowns n, a substantial reduction from the dense although still superlinear [76, 73]. Sparse elimination is inherently serial and branching heavy, so these methods have traditionally struggled to exploit CPU and GPU parallelism. SuperLU_MT achieved a CPU-parallel factorization by scheduling the independent subtrees of the elimination tree across threads and pipelining the remaining panel updates, and we refer the reader to Demmel et al. [77] for the details of the algorithm. Practical GPU implementations have emerged only recently, most notably NVIDIA's cuDSS, a GPU-accelerated sparse direct solver. We have developed diff-soup around cuDSS, mapping its three phases onto the caching structure of the integrator: the symbolic analysis is performed once per sparsity pattern, which the discretization fixes a priori, the numeric factorization is repeated only when the setup gate refreshes , and the cached factors serve every Newton iterate in between through cheap triangular solves. This solver has also allowed us to explore GPU-specific strategies for accelerating the computation, such as working in reduced precision, batching independent solves in parallel, and employing multi-GPU execution, as we discuss in Section 4.
Finally, the partitioning of the state into local and global variables allows us to accelerate the linear solves through a Schur complement. We partition the Newton system of Eq. (4) conformally with the state as
where collects the local differential and algebraic states and the global variables. Through the pencil , each block inherits the structure of the corresponding Jacobian block: carries the sparse local coupling of , is the small dense global block of , and and carry the dense coupling columns and rows . Eliminating from the first block row and substituting into the second reduces the system to the Schur complement S of A,
after which the local increment is recovered as . In practice, we factorize only when the setup gate refreshes and cache the sparse solves forming alongside the factors, so each Newton iterate costs one sparse solve, one small dense solve, and the back-substitution. Since , the Schur system adds negligible cost, and the dense rows and columns never enter the sparse factorization, preserving the local sparsity and the fill-reducing ordering of [36].
2.3. Differentiable Simulation and PDE-constrained Optimization
Recent progress in scientific machine learning has concentrated on differentiable simulation for PDE-constrained applications in learning, inference, design, control, and uncertainty quantification [15, 78, 79, 24, 25]. The PDE-constrained optimization problem takes the form
where is a scalar cost function and collects the parameters of interest. Conventional first-order optimization requires the total derivative of the cost with respect to the parameters,
where the central quantity is the sensitivity matrix , the derivative of the solution with respect to the parameters.
To compute the sensitivity matrix, one must differentiate Eq. (2) with respect to the parameters using either the continuous or discrete sensitivity paradigm. Optimize-then-discretize derives continuous auxiliary equations for the sensitivities and integrates them numerically alongside the state, as in the CVODES and IDAS integrators of SUNDIALS [80, 31] Discretize-then-optimize differentiates the discrete computational graph of the solver program and can be implemented in three ways: hand-derived discrete adjoints, as in PETSc's TSAdjoint [33, 81] and FATODE [82]; symbolic derivation of the adjoint from the recorded variational forms of a finite element solve, as in dolfin-adjoint [83]; and automatic differentiation (AD) of the solver's computational graph, as in diffrax and this work [49, 69]. The Julia ecosystem exposes both routes behind a common sensitivity interface [34, 15]. Both the continuous and discrete paradigms can be computed in forward mode, where one tangent per parameter is propagated forward, or reverse (adjoint) mode, where one cotangent per scalar cost traverses backwards. This gives four methods as described in detail in this section and compared in Table 2: forward sensitivity analysis (FSA) and adjoint sensitivity analysis (ASA) for continuous sensitivities [84, 31], and forward and reverse AD for discrete sensitivities, as implemented in diff-soup [49].
FSA differentiates the governing equations with respect to each parameter. For a state-independent mass matrix, differentiating Eq. (2) with respect to yields the tangent system
where is the -th column of the sensitivity matrix, and the fully implicit form of Eq. (1) differentiates the same way into . The tangent systems are linear and share the pencil matrix with the forward solve, so the sensitivities advance alongside the state through cheap solves with the cached factors [31]. The sensitivity matrix is also useful beyond the gradient, as for least-squares cost functions the product is the canonical Gauss-Newton approximation to the Hessian. Because the integrator carries one tangent system per parameter, the cost of FSA scales as , where denotes the cost of one forward VSVO solve under the sparse methods above.

(b)
(c)
Figure 2: Differentiation through the discrete computational graph of the adaptive integration loop. (a) At the highest level, the simulator is one differentiable map, where the forward solve consumes the initial state and the parameters to produce the trajectory that enters the cost , forward mode pushes the seeds through to the solution tangent , and reverse mode pulls the cost gradient back to . (b) The simulator unrolls into the chain of accepted steps, where each step passes the state forward with its tangent alongside (orange) while the cotangents and the running parameter cotangent flow backward (blue), so exits as the assembled gradient. (c) Inside one accepted step, the implicit function theorem binds both derivative rules at the corrector root : the JVP rule, the pushforward of forward mode, maps the incoming state and tangents into the new state and tangent through one linear solve with the exact pencil , and the VJP rule, the pullback of reverse mode, consumes the replayed state with the incoming cotangents, solves the transposed system for the multiplier , and adds this step's contributions to the running cotangents and . The total derivative holds fixed and collects both the direct parameter dependence and the indirect dependence through the stored history. The multistep history generalizes the single-lag dependence shown, as in Eq. (12).
Alternatively, forward-mode AD propagates tangents through the discrete computational graph of the adaptive integration loop, which diff-soup implements as a lax.while loop [69] as shown in Figure 2. The tangent is defined as the directional derivative of the accepted state along a seed direction , and forward mode advances one tangent per seed [67]. Unrolled, the loop is a chain of accepted steps, and each step is an implicit function of the parameters and of the k stored history states, because the corrector equation inherits the stored states through the multistep formula and the parameters through the right-hand side. Rather than naively differentiating through the Newton algorithm, we apply the implicit function theorem at the converged root [49, 85], which turns the constant mass matrix step dependence into the tangent recurrence
where is the exact pencil of Eq. (4) evaluated at the root, the first term carries the direct parameter dependence, and the sum carries the stored history tangents into the new step. To ensure the correctness of the derivative, a fresh pencil matrix and factorization must be used at an extra computational cost rather than the potentially stale factor used by the forward program. We employ the frozen-controller approximation, such that we apply gradient truncation to the adaptive order and step size control flow. Instead, tangents differentiate the realized control schedule as a fixed discretization [49]. Because forward mode AD carries one tangent per seed, the cost retains the scaling of FSA. To reduce practical cost, we leverage the shared pencil factorization to efficiently batch the tangent computation at each step.
For systems with many parameters, such as training modern deep neural networks, the scaling of the forward methods renders differentiation practically infeasible. Fortunately, reverse-mode and adjoint methods compute the gradient of a scalar cost directly, at a cost that no longer multiplies in . In the continuous setting, adjoint sensitivity analysis introduces the costate and, for a constant mass matrix and a cost of integral form , integrates the adjoint system backward from ,
after which the gradient follows from the quadrature
(14) where carries any parameter dependence of the initial state and terminal costs enter through a nonzero terminal condition. For a singular mass matrix, the terminal condition must itself be consistently initialized, because the algebraic components of the costate are determined by the adjoint constraints, and we refer the reader to Cao et al. [84] for the derivation in the fully implicit and higher-index settings.
The backward solve of Eq. (13) requires the forward trajectory , and the implementations trade memory against recomputation through three strategies: a dense interpolant of the forward solution, checkpointing with segment recomputation, and re-integration of the state backward in time alongside the adjoint [78, 34]. The Julia ecosystem pairs the interpolant with an adaptive Gauss quadrature of the gradient integral in Eq. (14), which typically converges in far fewer evaluations than the time integration itself [34, 86]. For stiff problems, however, two stability concerns constrain these choices: the backward re-integration of the state, popularized for neural ODEs [87], is unstable because the reversed dissipative dynamics amplify small forward errors, and the adjoint system inherits the stiffness of the forward problem, so it must itself be integrated implicitly with the same sparse linear algebra as the forward solve [86]. The number of costates is parameter independent and quadrature accumulates the gradient components additively, so the total cost scales as .
In the JAX-native engines, we instead differentiate the adaptive control loop in reverse mode as a discrete adjoint using the checkpointed while loop in equinox, which implements the optimal online checkpointing algorithms of Stumm and Walther [88] and Wang et al. [89]. In reverse mode, the tangent solve of Eq. (12) transposes, and each step propagates the cotangent backward through one linear solve with , traversing the chain of Figure 2 from the cost to the parameters. Rather than storing the trajectory, the loop retains checkpoints of the accepted states by default, where is the user-prescribed step ceiling, and recomputes the segments between them during the backward sweep, bounding the memory at . One backward sweep costs a constant recomputation of the forward solve and accumulates the parameter cotangent additively across the steps, so the gradient scales as . As in forward mode AD, we employ the frozen-controller assumption, so cotangents flow only through the accepted steps, and we refer the reader to Kidger [49] and the diffrax documentation for a detailed treatment of these checkpointing and control-flow choices.
We summarize the computational cost, memory footprint, accuracy, and stability concerns of the four sensitivity algorithms in Table 2. None of the four algorithms returns the exact gradient of Eq. (9), though the source of the error differs between the two families. The continuous methods approximate the gradient of the continuous problem to a tolerance, with error governed by the tolerances of the selected forward solver, sensitivity solver, and quadrature method[84, 78]. The discrete methods differentiate the frozen discretization selected by the forward solve exactly, to floating point precision, and their gradients deviate from that of the adaptive solution map by a term controlled by the local error tolerance.
Table 2: Comparison of the four sensitivity methods for the PDE-constrained optimization problem of Eq. (9). denotes the cost of one forward VSVO solve under the sparse methods of this section, so no entry incurs a dense cubic factorization. Costs and memory are reported in the state dimension , the parameter count , and the user-prescribed step ceiling . The discrete methods differentiate the realized discretization under frozen step size and order controls.
| FSA | Forward AD | ASA | Reverse AD | |
| Cost | . Tangents share the pencil factorization. | . Tangents batched into multi-RHS solves with jax.vmap. | . One backward solve plus quadrature. | . A constant re-computation overhead from checkpointing. |
| Memory | live tangents. No trajectory storage. | live tangents. No trajectory storage. | Dense interpolant of , or checkpoint-reduced. | checkpoints by default; budget prescribable. |
| Gradient computed | Continuous sensitivities, accurate to the integration tolerances. | Exact tangents of the realized discretization under frozen controls. | Continuous gradient, accurate to the forward, adjoint, and quadrature tolerances. | Exact gradient of the realized discretization under frozen controls. |
| Stiffness concerns | Inherits the stability of the forward solve. | Inherits the stability of the forward solve. | The adjoint system is itself stiff, and backward re-integration of the state is unstable. | Stable. Replays stored or recomputed forward states. |
Beyond smooth trajectories, the control state introduces events, such as protocol switches and state-triggered conditions, that stop the integration, update the state, and restart it from a consistent state. Because the frozen-controller assumption fixes the time grid, the discrete computational graph alone would miss how the switch time moves with the parameters, so we attach custom JVP and VJP rules to each event. These rules differentiate the switch time by the implicit function theorem and carry its shift into the restarted trajectory, so tangents and cotangents pass through an event as through any accepted step of Figure 2. At transversal crossings, the resulting derivatives match the classical event sensitivities of Galán et al. [90] and Hiskens and Pai [91] and their adjoint counterparts [92] This machinery is required for future applications in control protocol design, where the optimization variables move the events themselves.
Finally, we support the computation of discrete second-order sensitivities, which second-order optimization methods for Eq. (9) consume as Hessian-vector products or as the assembled Hessian. We implement three second-order compositions through the solver: forward-over-forward differentiation, which propagates second-order tangents along the realized trajectory and assembles the full Hessian at , reverse-over-forward differentiation, which computes gradients of scalar criteria built from the solution and its forward sensitivities through one reverse sweep over the tangent solve at , and forward-over-reverse differentiation, the canonical strategy for Hessian-vector products [67], which differentiates the checkpointed gradient in forward mode and delivers each product at a constant multiple of the gradient cost, , so Newton-type methods extract curvature without ever assembling the Hessian.
3. diff-soup Software Overview
In this section, we introduce the architecture of diff-soup, specifically the three primary modules for modeling, simulation, and inference as visually outlined in Figure 3. The modeling module provides the tools for declaring a PDE system, its geometry, and its discretization method through diff-soup's Recipe API to construct a sparse, discrete problem for the time-integrators. The simulation module integrates this system in time using the stiff VSVO algorithms and provides discrete parameter sensitivities. Finally, the inference module solves PDE-constrained optimization problems to learn model parameters from data.
diff-Soup
Modeling

grids and meshes
sparse Jacobian
spec = ds.problem("heat")
spec.domain("bowl", mesh)
spec.field("u", mass="differential")
D = spec.param("D", learnable=True)
@spec.equation(writes="u", reads="u",))
def heat(q):
return q.p.D * q.ops.laplacian(q.u)
spec.bc.dirichlet("u", ..., value=0.0)
problem = spec.build()
• grids and meshes: FDM, FVM, FEM
• operators with sparsity patterns
• nonlinear boundary conditions
• global constraints and controls
• learnable parameters and functions
• direct authoring from the residual
Simulation

simulated physics with adaptive time steps
solver = ds.JIDA()
sol = ds.pdesolve(problem, solver,
(0.0, 0.1), y0)
def loss(theta):
sol = ds.pdesolve(..., theta=theta,
adjoint=ds.CheckpointAdjoint())
return sol.ys[-1].sum()
g = jax.grad(loss)(theta)
H = jax.hessian(loss)(theta)
• VSVO integrators: JIDA, JBDF, JNDF
• consistent initialization, events
• modified Newton nonlinear solver
• sparse direct and dense linear solvers
• discrete forward and adjoint sensitivities
Inference

optimization
learned function
measurement = ds.inference.Measurement(
"u", times=ts, values=data, ...)
experiment = ds.inference.Experiment(
problem, solver, (0.0, 0.1), y0,
(measurement,))
est = ds.inference.InferenceProblem(
experiment, parameters=D)
fit = ds.inference.optsolve(est,
ds.inference.NewtonTrustRegion())
posterior = ds.inference.laplace(
est, fit)
• solvers: Newton trust-region, Levenberg-Marquardt, L-BFGS
• multiple shooting and data assimilation
• classical and neural function approximation
• statistical estimation and uncertainty quantification
JAX
JIT compilation · automatic differentiation
vectorization · optax, equinox, blackjax

cuDSS · batched solves
reduced precision · multi-GPU parallelism
Figure 3: Visual overview of the three primary modules of diff-soup for modeling, differentiable simulation, and inference.
3.1. Modeling
In this subsection, we describe the modeling module, the primary user entry point in diff-soup, and its lowering to an internal representation (IR) system used for simulations. We have designed the Recipe API as a user-friendly workflow for specifying physical equations in math-like notation without needing a symbolic algebra system. For example, consider the heat equation on the unit interval with diffusivity D,
which translates to the following diff-soup Recipe:
import numpy as np import diff_soup as ds from diff_soup.domains import cartesian_grid_1d
n = 64 spec = ds.problem("heat") # open the builder spec.domain("rod", cartesian_grid_1d(n, 0.0, 1.0, method="fvm")) # 64 cells spec.field("u", mass="differential", scale=1.0, init=lambda x: x * (1.0 - x)) D = spec.param("D", value=0.1, learnable=True, bounds=(0.01, 2.0)) # learnable
@spec.equation(writes="u", reads="u",)) def heat(q): return q.p.D * q.ops.laplacian(q.u) # du/dt = D lap(u)
spec.bc.dirichlet("u", node_indices=np.array([0, n - 1]), value=0.0)
problem = spec.build() # lower the recipe
Listing 1: The heat equation of Eq. (15) declared through the Recipe API. The unit interval is discretized on 64 finite-volume cells, the diffusivity is declared as a learnable parameter with box bounds, both ends are pinned to zero, and build lowers the recipe into the problem that the simulation module consumes.
First, the user specifies the domain on which the physical system will be simulated. diff-soup provides a flexible domain and discretization system with support for both structured grids through FDM, FVM, and FEM, and unstructured meshes through FEM. Once a domain is registered, the unknowns are declared on it as fields, scalar- or vector-valued variables that are specified as differential or algebraic variables. The user then writes the PDE system in strong form as a plain Python closure over an access object q, composing the field values, the declared parameters, and the differential operators of the domain. diff-soup maintains a readily extendable library of common differential operators for science and engineering, with each operator declaring the induced sparsity pattern for composition into the sparse
Jacobian discussed in Sec. 2.2. Finally, boundary conditions are attached to each field, selected by node index on a grid or by named tags on a mesh, with diff-soup providing the standard linear and nonlinear boundary conditions such as Dirichlet, Neumann, Robin, periodic, and flux boundary conditions.
For more complex workflows, we provide additional modeling features for declaring global constraints, externally controlled inputs, and learnable parameters or parameterized functions. For nonlocal constraints, such as prescribed domain or boundary integrals, the user declares global algebraic variables and a corresponding global constraint to close the system. Since constraints couple densely, we handle global variables using the Schur complement, as described in Section 2.2, to avoid compromising local sparsity. We also provide controls for external forcing protocols in two forms, a direct control for an input variable read inside the equations and a derived control for a quantity the solver assembles. Furthermore, for differentiable simulation we require the user to mark explicitly which parameters and parameterized functions are learnable, and optionally specify box bounds for the optimizer.
Internally, spec.build() lowers the Recipe to an internal representation that provides the residual, sparse Jacobian, learnable parameters, and controls to the solver. By default, an equation closure returns the right-hand side of the mass-matrix form of Eq. (2), and if an equation uses the symbolic time derivative of a field, the fully implicit form of Eq. (1) is used. For advanced use cases, mass-matrix and implicit problems can be authored directly from the residual and sparsity pattern.
3.2. Simulation
In this subsection, we describe the simulation module, which integrates the physical system in time, and exposes a JIT-compiled, differentiable function for the inference module. A simulation is run by calling pdesolve on the lowered problem and providing a desired solver algorithm, the time interval, and an initial state, as shown in Listing 2. diff-soup implements three native VSVO solvers: JIDA, JBDF, and JNDF, as discussed in Section 2.1. Additionally, we provide a wrapper to diffrax [49], for verification and non-stiff problems. For DAEs, the first step in each simulation is consistent initialization, in which the differential variables are held at their initial values and the resulting nonlinear system of algebraic variables and differential slopes is solved to satisfy all algebraic equations and constraints. Each time step then follows the control flow of Figure 1. The modified Newton corrector solves the sparse linear system with cuDSS on the GPU, KLU on the CPU, or optionally a dense solver, and handles the global variables through the Schur complement of Section 2.2. Finally, events interrupt the integration when a user-specified condition is met to terminate the solve or modify the state and controls before continuing.
import jax import numpy as np
y0 = spec.assemble_state({}) solver = ds.JIDA() ts = np.linspace(0.02, 0.1, 5) sol = ds.pdesolve(problem, solver, (0.0, 0.1), y0, saveat=ds.SaveAt(ts=ts)) sol.ys, sol.ok, sol.stats theta = ds.default_theta(problem)
the parameter pytree
def final_state(theta): return ds.pdesolve(problem, solver, (0.0, 0.1), y0, theta=theta).ys[-1]
S = jax.jacfwd(final_state)(theta)
forward mode (default)
def loss(theta): sol = ds.pdesolve(problem, solver, (0.0, 0.1), y0, theta=theta, adjoint=ds.CheckpointAdjoint()) # checkpointed reverse mode return sol.ys[-1].sum()
g = jax.grad(loss)(theta) H = jax.hessian(loss)(theta)
one backward sweep
forward over reverse
Listing 2: A solve and differentiation of the running heat equation example given in Eq. (15). The JIDA solver integrates the problem of Listing 1 to five output times, forward mode differentiates the final state with respect to the parameters at the default settings, and the checkpointed adjoint enables the reverse-mode gradient and the forward-over-reverse Hessian of a scalar loss.
The pdesolve function is compatible with the standard JAX transformations including JIT compilation, automatic differentiation, and batching through jax.vmap. The compiled solve is cached for each problem and solver configuration, so the time interval, initial conditions, parameters, and controls can change without recompilation. To differentiate through the solve, we employ the discretize-then-optimize approach of Section 2.3 with a frozen controller. By default, forward mode automatic differentiation propagates one tangent per input direction through the adaptive loop, with batching used when possible. Reverse mode uses a discrete checkpointed adjoint to compute the gradient of a scalar objective with respect to all parameters in one backward pass within a user-prescribed memory budget. Second-order sensitivities compose both forward and reverse AD, with forward-over-reverse differentiation the default method for computing Hessian-vector products at a constant multiple of the gradient cost, and full Hessians. Additionally, events are differentiable, with tangents and cotangents carried through the crossing by the implicit-function rule at the trigger root of Section 2.3. Many independent solves are batched through jax.vmap into one program that advances every solve together and factorizes the batch of matrices in a single call. GPU acceleration is further exploited through a reduced precision mode to enable computations in Float64, Float32, or mixed precision mode – which factorizes in Float32 precision and does iterative refinement with the Float64 precision residual. Finally, diff-soup can distribute computation across multiple GPUs using both data and model parallelism to either distribute independent solves across GPUs or spread a single sparse factorization across several devices on one node or across the nodes of a cluster, as we quantify for one node in Section 4.3.
3.3. Inference
Next, we describe the inference module of diff-soup, which is designed to solve the PDE-constrained optimization problem of Eq. (9) for learning physics-based models from data. To estimate the diffusivity value in the model heat equation problem, we employ the workflow shown in Listing 3.
data: the solution at D = 0.3 at the times ts, plus Gaussian noise of scale 1e-3
measurement = ds.inference.Measurement("u", times=ts, values=data, likelihood=ds.inference.Gaussian(sigma=1e-3)) experiment = ds.inference.Experiment(problem, solver, (0.0, 0.1), y0, (measurement,)) est = ds.inference.InferenceProblem(experiment, parameters=D) # maximum likelihood fit = ds.inference.optsolve(est, ds.inference.NewtonTrustRegion()) fit[D], fit.status # fitted D, termination status
posterior = ds.inference.laplace(est, fit) # Gaussian approximation at the fit ident = ds.inference.identifiability(est, fit) # the information spectrum
Listing 3: A fit of the running heat equation example given in Eq. (15) and its uncertainty quantification. The observed measurement is declared as synthetic data generated with D = 0.3 at 5 time points with Gaussian noise. The corresponding experiment is registered, and the inference problem is posed to recover the maximum likelihood estimate of the diffusivity using a Newton trust-region solver. Following the inference problem, a variety of diagnostics are used to assess the solution including posterior estimation and a practical identifiability report.
First, the observed data streams are registered as measurement objects and collected together with the corresponding lowered problem in an experiment object. Using one or more experiments, the user then defines an inference problem over the parameters of interest and solves it using ds.inference.optsolve with the desired first-order or second-order optimization algorithm. After solving, the result object provides the optimized parameters, the cost history, a termination status, and diagnostics of the solution quality.
We provide extensive support for posing the inference problem as a statistical estimation problem to determine the maximum likelihood estimate (MLE) under a frequentist approach or the maximum a posteriori (MAP) estimate under a Bayesian approach. To compute the MLE, a likelihood can be specified, as in Listing 3. To compute the MAP, in addition to the likelihood, priors can be declared on the parameters. After the inference problem is solved, a Laplace approximation to the posterior can be derived from the Hessian or Gauss-Newton Hessian approximation around the MAP. For more sophisticated posterior estimation, the posterior can be sampled using the Markov chain Monte Carlo No-U-Turn sampler (NUTS) in blackjax with preconditioning from the Laplace covariance. Samples are used to create credible intervals around the fitted parameters. Additionally, practical identifiability can be assessed from the Fisher information matrix and from the profile likelihood of each parameter, in which that parameter is fixed and all others are refit.
We implement three native optimization algorithms in diff-soup: a Newton trust-region method using the exact Hessian or its Gauss-Newton approximation, a Levenberg-Marquardt method, and a limited-memory BFGS method. Additionally, we provide wrappers to the optax and optimistix libraries for first-order training of embedded deep learning models and for further solvers.
We provide a variety of tools and modules in diff-soup for typical inference workflows including data assimilation, batching, and function approximation. Specifically, we provide pre-built tools for projecting image data onto a mesh, refining the mesh, and estimating initial and boundary conditions from image data. For batching, multiple shooting is employed to partition large trajectories into shorter windows that are joined by continuity constraints. This both reduces the computational cost of long trajectory simulations and improves the robustness and conditioning of the optimization problem [93, 25]. In addition, we offer a variety of prebuilt modules for approximating functions and operators that commonly occur in PDEs. Orthogonal polynomials, neural networks, and neural operators are supplied for approximating constitutive relationships, functions, and operators within PDEs. We provide Karhunen–Loève expansions and coordinate networks for approximating spatial fields both classically and using deep learning. Additionally, a variety of differentiable, piecewise interpolants such as constant, linear, and cubic polynomials are offered for time-varying signals.
As discussed in Section 3.2, diff-soup employs both data and model parallelism for distributing computation across multiple GPUs. Under data parallelism, subsets of a larger dataset, either distinct experiments or windows for multiple shooting, are distributed across all GPUs, and the losses, gradients, and curvature are then summed across the devices. We specialize this for hierarchical inference problems where the dataset consists of many experiments on distinct domains with multiple episodes per domain. The problem can be distributed into three types of parameters: global parameters shared by all experiments, cluster parameters that are shared by a single domain, and local parameters that are specific to a distinct episode. This allows us to exploit the arrowhead structure of the resulting joint Hessian and employ a block Newton solver that uses a Schur complement over the shared block. Under model parallelism, a single simulation whose sparse factorization outgrows the memory resources of one GPU is factored across several devices.
4. Benchmarks
In this section, we benchmark diff-soup against widely used scientific computing frameworks for stiff dynamical systems, including the CPU libraries SUNDIALS [31], PETSc [33], DifferentialEquations.jl [34], and MATLAB ode15s [35], and the GPU-based JAX library diffrax [49]. We use three problems of increasing complexity: the heat equation, which admits a closed-form solution in both the continuous and the discrete setting, the Brusselator system, which is a model benchmark problem for stiff PDEs [65], and a challenging coupled chemo-mechanical Cahn-Hilliard problem inspired by PFHub benchmark problem 4 [94].
4.1. Comparing time integrators with the heat equation
The heat equation on the unit interval with homogeneous Dirichlet boundaries takes the following form:
which is discretized with second-order central differences on interior nodes with spacing as
and integrated to T = 0.2. Both the continuous problem and the semidiscrete system admit closed-form solutions,
(18)
where are the discrete sine coefficients of the initial condition and are the eigenvalues of the negative discrete Laplacian. Figure 4 shows the decay of the solution over the benchmark window.

Figure 4: Solution of the heat equation of Eq. (16) at the eleven output times of the benchmark, evenly spaced over and colored by time.
We note that the eigenvalues of the discrete Laplacian span to , which causes the stiffness, typically characterized by the ratio of the largest to smallest eigenvalues, to grow as [95]. Furthermore, explicit solvers for the heat equation face a CFL limit on the largest stable time step, for the explicit Euler method, due to the coupling of the temporal and spatial discretizations, so the step count grows as regardless of the accuracy requested. As such, it is common to employ implicit time integrators to achieve unconditional stability with respect to the time step. However, implicit time integrators require a linear solve at every step, which creates a computational burden of per step if dense linear solvers are used. By contrast, diff-soup uses the adaptive VSVO time integrators described in Section 2.1 with the sparse numerical methods of Section 2.2, which scale quasilinearly in .

(b)

(c)

(d)

Figure 5: The one-dimensional heat equation solved at rtol = atol = with diff-soup and diffrax on grids from to interior nodes. A maximum wall time of 1800 s is imposed on every timed cell of the benchmark comparisons, indicated by the dotted gray horizontal line. All problems are solved on the GPU in Float64 precision unless indicated otherwise. (a) Relative trajectory error against the continuous solution, with the exactly integrated grid system (black dashed) as the spatial floor and the analytic series truncated to the grid's modes (gray dotted). At the same tolerance, diff-soup keeps descending to the finest grid and finishes an order of magnitude below Kvaerno5, whose error saturates at the largest sizes. (b) wall time against resolution. diff-soup stays flat at a sub-second cost, while the diffrax lanes grow as power laws, the implicit Kvaerno5 approaching cubic scaling at the largest sizes. (c) The work-precision diagram, in which diff-soup gains accuracy at nearly constant cost while every diffrax lane pays a growing cost for each gain in accuracy. (d) The same diff-soup solver on the CPU with the KLU sparse linear solver and on the GPU with cuDSS, plotted against the Jacobian nonzeros and the degrees of freedom . The crossover where the CPU cost exceeds the fixed overhead of the GPU solver occurs near nonzeros and 4770 degrees of freedom.
In Figure 5, we demonstrate that even for this simple parabolic problem, the discrete spectrum of the differential operator induces stiffness that makes the specialized VSVO stiff solver extremely advantageous. Specifically we find the JIDA integrator with sparse linear algebra more cost-effective than the GPU time integrators diffrax (Figure 5c). Every method tracks the spatial floor at the resolutions it reaches, although Kvaerno5 saturates near from onward (Figure 5a). However, only the JIDA solver of diff-soup holds this accuracy at a low, fixed cost across all resolutions (Figure 5b).
Across this range of resolution, diff-soup exhibits a nearly fixed cost of about 0.1 s, indicating that the wall time is dominated by the overhead of launching GPU kernels and of host-device synchronization at the branch points of the adaptive integration loop. To discriminate the performance gains of the GPU accelerator versus the sparse VSVO algorithm, we run the same algorithm on the CPU with the KLU sparse linear solver (Figure 5d). We note that once the cost is dominated by the sparse linear solver, the precise scaling follows the total cost of the factorization kernels, which depends nontrivially on both the number of nonzeros and the exact sparsity structure of the problem, so we plot the cost against the Jacobian nonzeros rather than the degrees of freedom. We find the cost of the CPU solver exceeds the GPU solver above approximately nonzero Jacobian entries for this problem.
4.2. Comparing performance with the Brusselator and Cahn-Hilliard problems
To establish the performance of diff-soup, we benchmark our solvers against comparable scientific computing libraries that offer stiff time integrators, sparse linear solvers, and sensitivity analysis, namely SUNDIALS, PETSc, DifferentialEquations.jl, and ode15s in MATLAB. We select the two-dimensional Brusselator and a coupled chemo-mechanical Cahn-Hilliard system as model stiff problems. The Brusselator is a reaction-diffusion model [96] that is a conventional benchmark for stiff integrators [65, 97],
where and are the concentrations of the two species, and are the feed and conversion rates, and is the diffusivity. The problem is solved on the unit square for , with every wall held at the reaction steady state , , from the initial condition ,
. Under these conditions, the system exhibits stiffness from the diffusion term, the nonlinearity, and the oscillatory behavior visible in Figure 6.
(a)

(b)
Figure 6: Solution of the two-dimensional Brusselator benchmark, the species u (a) and v (b) on a grid at five times from t = 0 to 10, each row on its own color scale.
To stress-test the solvers, we select the fourth-order Cahn-Hilliard problem coupled to mechanical equilibrium, inspired by the elastic precipitate benchmark of the PFHub phase-field community [94, 98], defined as follows:
(20)
where is the conserved order parameter, is its chemical potential, is the mobility, is the bulk free energy, is the gradient energy coefficient, is the strain of the displacement , is the dilatational misfit strain of the transformed phase, is the stiffness interpolated between the two phases, and is the elastic energy density. We use an initial condition of two cosine modes with wavelengths near the most unstable wavelength, and integrate the system for s on a nm square domain. This problem is an index-1 DAE with both local differential and algebraic states, and it exhibits significant stiffness due to the fourth-order spatial derivative, the nonlinearity, and the unstable spatial modes shown in Figure 7. The full problem statement and its parameters are given in Section 7.1.

Figure 7: Solution of the Cahn-Hilliard problem with elasticity on its 50 nm square domain at cells, five snapshots from t = 0 to 36 s. (a) The conserved order parameter phase separating from the sinusoidal seed. (b, c, d) The strain components , , and of the displacement that holds the solid in mechanical equilibrium, the normal components on one shared scale and the shear on its own.
Figure 8 compares the JIDA solver of diff-soup on the CPU and GPU with the CPU lanes of SUNDIALS, PETSc, DifferentialEquations.jl, and MATLAB on both problems.
Brusselator, N = 128

(b)
Brusselator, rtol = atol =

(c)
Cahn-Hilliard + elasticity, N = 64

(d)
Cahn-Hilliard + elasticity, rtol = atol =
diff-soup JIDA (GPU, cuDSS)
SUNDIALS GMRES
PETSc KLU
Julia SciML FBDF
diff-soup JIDA (CPU, KLU)
SUNDIALS ILU
PETSc ILU
Julia SciML QNDF
SUNDIALS KLU
SUNDIALS SuperLU_MT
PETSc multigrid
MATLAB ode15s
Figure 8: Work-precision and scaling diagrams for the Brusselator (a, b) and the Cahn-Hilliard problem (c, d) for diff-soup on GPU (solid blue) and CPU (dashed blue), SUNDIALS (dashed red), PETSc (dashed green), Julia DifferentialEquations.jl (dashed purple), and MATLAB (dashed gray), with the marker denoting the particular solver as described in the legend. All benchmarks are run according to the procedure described in Section 7.1. Notably, data points are omitted where the solve did not converge or exceeded the wall cap. (a) The work-precision diagram for the Brusselator problem shows the diff-soup GPU solver outperforming all solvers, with the Newton-Krylov solvers of SUNDIALS trailing by a small factor and the other libraries by an order of magnitude or more. (b) The Brusselator scaling diagram shows the diff-soup GPU solver exhibiting a transition from fixed overhead to power-law scaling, whereas the CPU based solvers all exhibit a sharper power-law growth. (c) The Cahn-Hilliard work-precision diagram shows a similar order of magnitude improvement of the diff-soup GPU solver over the other libraries, with the closest solvers being the sparse direct SuperLU_MT in SUNDIALS and ode15s in MATLAB. (d) The Cahn-Hilliard scaling diagram shows the diff-soup GPU solver exhibiting a two order of magnitude improvement over the other libraries at scale, with the CPU based solvers again growing more steeply.
As demonstrated in Figure 8, the selected benchmarks show the diff-soup GPU solver far outperforms the other solvers, especially above
degrees of freedom. We demonstrate up to a speedup over the next fastest solver at scale. This performance is explained by using GPUs to overcome the predominant bottlenecks in stiff implicit integration, namely Jacobian computation and factorization of the pencil matrix .
In diff-soup, we employ a parallelized, sparse colored Jacobian computation [70, 72]. By contrast, all other compared solvers, except DifferentialEquations.jl, must be supplied an analytical sparse Jacobian, as done in this benchmark (Section 7.1). DifferentialEquations.jl supports sparse automatic differentiation by Jacobian coloring; however, it evaluates the colors serially and remains slower than the analytical Jacobian computation, as shown in Table 3.
Table 3: Wall time of one residual evaluation, one analytical Jacobian assembly, and one sparse autodiff Jacobian assembly at the work-precision sizes of the two benchmark problems. Ratios are taken against the analytical Jacobian of the same framework on the same device, and the coloring uses 12 and 67 colors in DifferentialEquations.jl and 14 and 73 in diff-soup for the Brusselator and the Cahn-Hilliard problem, respectively.
| Computation | Device | Brusselator, N = 128 | Cahn-Hilliard, N = 64 | ||
|---|---|---|---|---|---|
| Time (ms) | Ratio | Time (ms) | Ratio | ||
| Residual evaluation | |||||
| DifferentialEquations.jl | CPU | 0.31 | - | 0.15 | - |
| diff-soup | CPU | 0.125 | - | 0.27 | - |
| diff-soup | GPU | 0.072 | - | 0.125 | - |
| Analytical Jacobian | |||||
| DifferentialEquations.jl | CPU | 0.46 | - | 7.3 | - |
| diff-soup | CPU | 0.37 | - | 5.0 | - |
| diff-soup | GPU | 0.052 | - | 0.154 | - |
| Sparse autodiff Jacobian | |||||
| DifferentialEquations.jl, serial | CPU | 4.6 | 10 | 10.4 | 1.4 |
| diff-soup, serial | CPU | 2.1 | 5.9 | 29 | 5.8 |
| diff-soup, batched | CPU | 0.99 | 2.7 | 30 | 6.0 |
| diff-soup, batched | GPU | 0.12 | 2.4 | 0.35 | 2.3 |
On the CPU, the residual and automatic differentiation operations quickly become memory bound, so every color of the serial sweep costs a full residual evaluation, and the sparse autodiff Jacobian runs up to an order of magnitude slower than the analytical one. Batching offers at most a modest gain, since the cores are already saturated. To compensate, CPU codes can rely on
BDF and NDF algorithms, which generally require fewer Jacobian refreshes than the IDA class of algorithms. On the GPU, the same batch of colors is evaluated in parallel across the device, which brings the batched diff-soup Jacobian to within a factor of about 2.4 of the analytical Jacobian (Table 3), so the factorization of the pencil matrix W remains the bottleneck.
For the two-dimensional problems considered here, the fill-in of the sparse factorization grows superlinearly with the degrees of freedom [76, 73], so the factorization dominates the solver cost at scale. Both diff-soup and the alternative scientific computing libraries employ sparse direct LU solvers, however at the scale of large two- and three-dimensional PDEs the superlinear scaling of the factorization becomes prohibitively expensive for CPU based algorithms like SuperLU_MT, KLU, and the sparse LU of MATLAB, which are limited to a single core or a small number of threads. diff-soup is able to overcome this on much larger problems because cuDSS distributes the factorization across the GPU and exploits its massive parallelism, achieving up to a speedup compared to the same JIDA integration algorithm using a CPU-based KLU solver.
However, the GPU based diff-soup code incurs a fixed overhead, since the device kernels sacrifice per-operation efficiency for parallelism and every step requires GPU kernel launches and host-device synchronization. Consequently, the GPU solver exhibits a nearly constant cost on the Brusselator and Cahn-Hilliard problems until the factorization grows large enough to dominate the wall time (Figure 8b and d). The one-dimensional Brusselator, at sizes too small for the GPU to pay off, is reported in Appendix B. To better separate the gains due to the GPU from those due to the sparse direct algorithm, in Figure 9 we compare diff-soup against the hybrid GPU execution offered by SUNDIALS and PETSc, in which the time stepper and the Newton iteration remain on the host while the Newton-Krylov kernels execute on the GPU.
Brusselator, N = 128

(b)
Brusselator, rtol = atol =

(c)
Cahn-Hilliard + elasticity, N = 64

(d)
Cahn-Hilliard + elasticity, rtol = atol =
diff-soup JIDA (device-resident) SUNDIALS ILU (hybrid) PETSc multigrid (hybrid) SUNDIALS GMRES (hybrid) PETSc ILU (hybrid)
Figure 9: Work-precision and scaling diagrams for the Brusselator (a, b) and the Cahn-Hilliard problem (c, d) for device-resident diff-soup (solid blue) and the hybrid GPU execution of SUNDIALS (dash-dot red) and PETSc (dash-dot green), with the marker denoting the particular solver as described in the legend. All benchmarks are run according to the procedure described in Section 7.1. Notably, data points are omitted where the solve did not converge or exceeded the wall cap. (a) The work-precision diagram for the Brusselator problem shows diff-soup outperforming both hybrid solvers, with the unpreconditioned Newton-Krylov solver of SUNDIALS following within a small factor and the multigrid-preconditioned PETSc solver trailing by over an order of magnitude. (b) The Brusselator scaling diagram shows diff-soup extending its lead over the hybrid SUNDIALS solver as the problem grows, with the PETSc solver trailing by more than an order of magnitude at scale. (c) The Cahn-Hilliard work-precision diagram shows diff-soup outperforming both hybrid solvers by one to three orders of magnitude, with the closest being the preconditioned Newton-Krylov solver of SUNDIALS. (d) The Cahn-Hilliard scaling diagram shows only diff-soup reaching the largest sizes, with both hybrid solvers growing far more steeply before they stop.
Traditionally, Newton-Krylov methods are used to scale CPU based codes to large problems, since they require only Jacobian-vector products rather than materializing and factorizing the full Jacobian [40]. However, their efficacy is strongly problem dependent, as their performance hinges on a well-tuned preconditioner. Comparing Figure 8a and c, the Newton-Krylov solvers work quite well for the Brusselator, with the standard ILU preconditioner or none at all, since the problem is only mildly nonlinear and stiff. On the Cahn-Hilliard problem, whose nonlinearity and stiffness are far stronger, the generic preconditioners are much less effective, and the more robust sparse direct solvers perform best. This trend carries over to our hybrid GPU benchmark in Figure 9, where we find that on the easier problem the Newton-Krylov based SUNDIALS solver closely tracks the performance of diff-soup in both the work-precision and the scaling diagram (Figure 9a and b), but for the harder Cahn-Hilliard problem the Newton-Krylov based solvers fall behind diff-soup by orders of magnitude (Figure 9c and d). The GPU therefore accelerates a Newton-Krylov method only where the Krylov iteration already converges well, whereas the sparse direct factorization benefits from the device on both problems. Consequently, we have focused on developing diff-soup around sparse direct methods, as they are generally more robust across a wide range of nonlinear, stiff PDE problems. However, we note that Newton-Krylov methods are still extremely effective when using problem-specific preconditioners, especially for three-dimensional PDEs where sparse direct methods become memory bound due to the superlinear fill in (Section 4.3) [76]. As such, we plan to expand diff-soup in the near future to support preconditioned Newton-Krylov-methods.
Lastly, we compare the performance of differentiating through the forward PDE solver by taking the gradient of a loss function defined on the model output with respect to the model parameters in both forward and reverse mode. We replace the Brusselator reaction term and the Cahn-Hilliard enthalpic term with pointwise neural networks, which leave the sparsity pattern of the Jacobian unchanged [15], to measure the scaling from small classical to large parameter counts. Here, among the libraries of the forward comparison, only SUNDIALS, through CVODES and IDAS, and DifferentialEquations.jl, through SciMLSensitivity, combine stiff integrators and sparse direct solvers with native sensitivity analysis, since the adjoint of PETSc does not support its BDF time stepper and MATLAB provides no sensitivity analysis for ode15s. We analyze the cost and accuracy tradeoff, the scaling with respect to the parameter count, and the scaling with respect to the degrees of freedom, as shown in Figure 10.

(b)
(c)
(d)
(e)
(f)
diff-soup JIDA Julia SciML forward mode SUNDIALS reverse mode
Figure 10: Work-precision and scaling diagrams for the gradient of a loss function with respect to the closure weights of the Brusselator (a, b, c) and the Cahn-Hilliard problem (d, e, f) for diff-soup (blue), the CVODES and IDAS sensitivity methods of SUNDIALS (red), and SciMLSensitivity with FBDF in Julia (purple), with the line style and marker denoting forward or reverse mode as described in the legend. All benchmarks are run according to the procedure described in Section 7.1. Notably, data points are omitted where the solve did not finish or exceeded the wall cap. The work-precision diagrams hold the state and the network fixed, the parameter diagrams grow the active weights at fixed tolerance, and the state diagrams grow the degrees of freedom at fixed network width for the diff-soup lanes alone. The vertical dashed line marks the noise floor of the reference gradient. (a) The Brusselator work-precision diagram at and shows diff-soup in reverse mode outperforming the adjoint solvers by one to two orders of magnitude at every tolerance. (b) The Brusselator parameter scaling diagram shows the reverse-mode cost of every library independent of the number of weights while the forward-mode cost grows with it, with diff-soup alone completing forward mode beyond the smallest network. (c) The Brusselator state scaling diagram shows both modes of diff-soup growing as a power law in the degrees of freedom, with reverse mode reaching the largest size. (d) The Cahn-Hilliard work-precision diagram at and shows a similar order of magnitude improvement, with every library reaching comparable gradient errors. (e) The Cahn-Hilliard parameter scaling diagram shows the same separation as (b), with forward mode on the CPU completing at most the smallest network. (f) The Cahn-Hilliard state scaling diagram shows both diff-soup modes growing as a slightly steeper power law and reaching the largest size.
As discussed in Section 2.3, the cost of a reverse-mode gradient is one backward sweep independent of the parameter count, , whereas forward mode carries one tangent system per parameter and scales as , and Figure 10b and e exhibit this separation, with the reverse-mode cost of every library nearly independent of the number of weights and the forward-mode cost growing with it. Consistent with the forward benchmarks, we find that diff-soup is one to two orders of magnitude faster than the CPU codes at scale, since each step of the backward sweep requires one sparse direct solve with the transposed pencil matrix, which is performed by the same GPU-accelerated factorization as the forward solve. We measure accuracy in Figure 10a and d as the relative error against the reference gradient of Section 7.1, which we validated against central finite differences. On the Cahn-Hilliard problem, the gradient error of every library remains above at all tolerances, since the unstable spatial modes of Eq. (20) amplify the local error of the solve into the gradient. The GPU acceleration also extends the range of network sizes over which forward mode remains practical, owing to the tangent batching of Section 2.3, which assembles all tangents into a single batched multiple right-hand-side solve against the primal factorization, so that diff-soup differentiates networks of hundreds to thousands of weights in forward mode, whereas the CPU codes complete only the smallest network close to the wall cap. Finally, the checkpointed adjoint bounds the memory of the backward sweep, so reverse mode reaches the largest states of both ladders in Figure 10c and f, whereas forward mode stores one tangent of the full state per parameter and, with 128 parameters, exhausts the device memory beyond about degrees of freedom on the Brusselator ladder. As we explore in Section 5.2, these performance advantages enable the training of embedded neural networks at scale within a general-purpose stiff PDE solver.
4.3. Reduced Precision and Multi-GPU Parallelism
Traditionally, sparse direct solvers have struggled to remain competitive with Newton-Krylov methods for large, three-dimensional problems due to the superlinear growth of their computational cost and memory requirements [76, 73]. However, as discussed in Section 4.2, sparse direct methods have significant robustness advantages over Newton-Krylov methods, which has led us to explore GPU-specific strategies for extending sparse direct methods to three-dimensional problems. Using the three-dimensional Brusselator with the same parameters and wall data as Eq. (19), we test the advantages of reduced precision and multi-GPU model parallelism in Figure 11.
(a)
Brusselator 3D, fp64 vs fp32

(b)
Brusselator 3D, placements

Figure 11: Scaling diagrams for the three-dimensional Brusselator for diff-soup JIDA at rtol = atol = on L40S devices, with the line style denoting the precision or the device placement as described in the legend. Wall time is measured according to the procedure described in Section 7.1, with no cap line because these runs are bounded by the scheduler slice rather than by the wall cap. Notably, data points are omitted where the factorization did not fit in memory. (a) The single-device diagram shows Float32 precision outperforming Float64 precision by an order of magnitude at scale and reaching a larger grid. (b) The placement diagram shows two devices roughly halving the cost of one and four devices improving on two with diminishing returns, with host spill keeping the largest grid solvable on one device at a far higher cost.
For the memory-bound sparse factorization of three-dimensional systems, precision is a significant lever, since many accelerators run Float64 precision at a small fraction of their Float32 precision rate. As seen in Figure 11a, the cost of the Float32 precision solve falls by an order of magnitude at scale, and it prevents the memory overflow of the Float64 precision factor at degrees of freedom. At matched tolerance, its final state agrees with the Float64 precision solve to within in relative norm at every smaller size. Consequently, if the stiffness of the problem tolerates a Float32 precision factor, reduced precision is the most effective acceleration available, especially in three dimensions where the bottleneck is the factorization of the pencil matrix. In reverse mode, the Float32 precision gradient of the Brusselator closure problem on a grid at rtol = agrees with the Float64 precision gradient to a relative error of . Distributing the factorization across devices is a weaker lever, as seen in Figure 11b, roughly halving the cost on two devices and improving only modestly on four.
We attribute this to a distributed factorization parallelizing the independent subtrees of the elimination tree while the large separators at the top of the tree are still factored on a single device, which caps the speedup in three dimensions. The more significant gain is memory capacity, as pooling the devices enables problems that no longer fit on a single GPU, whereas spilling the factor into host memory keeps such problems feasible on one device at a much higher cost. Even so, the exact factorization eventually exceeds the combined memory of four devices, which sets the practical limit of this approach.
5. Applications to PDE-constrained Optimization
diff-soup combines physics modeling, differentiable simulation, and optimization in a single package that serves both classical and deep-learning based inference. In this section, we demonstrate end-to-end workflows implemented entirely in diff-soup for two different inference paradigms: a conventional Bayesian inference problem for learning the constitutive relationships of binary phase-separating materials, inspired by Zhao et al. [79] and Cohen et al. [25], and a modern deep learning problem in which a neural field is embedded in a packed bed reactor model and trained to represent its three-dimensional catalyst activity.
5.1. Inference with Uncertainty Quantification
First, we demonstrate diff-soup on a classic Bayesian inverse problem, in which the constitutive relationships of a phase-separating material are inferred from image data. We reproduce the results of Zhao et al. [79], inferring the composition-dependent tracer diffusivity and the homogeneous chemical potential from a single noisy movie of spinodal decomposition and quantifying the uncertainty by sampling the posterior. The composition c evolves according to the Cahn-Hilliard equation
(21)
where is the chemical potential in units of per particle, is the gradient energy coefficient, and is the tracer diffusivity, related to the mobility
by the Einstein relation. We parameterize both functions with orthogonal polynomials,
where is the shifted Legendre polynomial of degree normalized in , the logarithmic term retains the ideal entropy of mixing, the exponential keeps the diffusivity positive, and collects the coefficients. Following Zhao et al. [79], we assume the coefficients are distributed as
where the variance decays with the polynomial degree, so that the prior damps oscillations that the data cannot resolve, and the scale s is set by empirical Bayes (Section 7.2). We then solve for the maximum a posteriori (MAP) estimate
where is the measured frame at time , is the standard deviation of the measurement noise, and is the prior of Eq. (23). We use multiple shooting, so that each prediction is integrated from the previous measured frame rather than from the start of the movie, which keeps each solve short and greatly accelerates the optimization [93]. As in Cohen et al. [25], we treat each measured frame as an exact initial state for its window, so the likelihood of Eq. (24) accounts for the noise in the predicted frame but not in the initial one. We solve Eq. (24) with the Newton trust region algorithm and then sample the posterior with the No-U-Turn sampler (NUTS) [99] implemented in blackjax [53].

(b)
(c)
(d)
- truth ... initial — learned ■ 95% CI
Figure 12: Recovery of the diffusivity and the homogeneous chemical potential of a Cahn-Hilliard model from one noisy movie of spinodal decomposition at the 10% measurement noise level. (a) The dynamical trajectory as measured (left) and as predicted by the model at iterate 0, at iterate 7, and at the final iterate. (b) Mean squared error in c against trust-region iteration, converging to the measurement noise floor (gray dashed). (c, d) The learned laws (solid) and the initial laws (dotted) against the ground truth (black dashed) with the 95% credible interval (CI) of the NUTS posterior.
Figure 12 summarizes the results. The learned model reproduces the dynamics of the noisy movie, as shown in panel (a). The Newton trust region algorithm converges rapidly, reaching the noise level of the measurement within ten iterations in panel (b). The inferred functions in panels (c) and (d) lie very close to the ground truth, and the posterior samples quantify their uncertainty through 95% credible intervals. During spinodal decomposition, the measured compositions lie predominantly near the two equilibrium values and only rarely inside the spinodal gap , so the learned functions in this region are informed primarily by the prior and carry a considerably larger uncertainty.
5.2. Embedded Deep Learning Model
diff-soup provides the capability to embed large deep learning models directly into PDE simulations, owing to its foundations in JAX and its GPU acceleration. In this example, we demonstrate physics-constrained deep learning at scale by training a neural network through the solution of a three-dimensional packed bed reactor model, in which the network represents the heterogeneous catalyst activity . The concentration c of the reactant evolves according to the advection-dispersion-reaction equation
where the reactant enters the bed at the concentration , is a fixed velocity profile along the axial coordinate , carries the axial and radial dispersion coefficients, and is the saturation constant of the Langmuir-Hinshelwood rate law. We generate a synthetic dataset by solving Eq. (25) on a grid with a known activity field and adding Gaussian noise. The true activity is a log-normal random field multiplied by a poisoning front and a streak of low-activity pellets, which together form a challenging heterogeneous target for the reconstruction. We parameterize the activity field with a wavelet-based neural field (WIRE) [100] consisting of parameters. The final layer is a softplus function to ensure positivity, and we initialize the network to match the uniform nominal activity . Since the neural field depends only on position, it enters the residual as a field and leaves the sparsity pattern of the Jacobian unchanged. We train the neural field by minimizing the mean squared error between the simulated and measured concentrations using the AdamW optimizer [101] with a weight decay of and a peak learning rate of under a linear warmup and cosine decay schedule.
(b)

(c)
(d) across the streak, x = 2.77 W
(e)
(f)
Figure 13: Recovery of a three-dimensional catalyst activity field from noisy concentration measurements in a packed bed reactor. (a) The true activity , with the breakthrough surface of the poisoning front (dashed) and the axis of the low-activity streak (solid) marked. (b) The measured concentration at three snapshot times. (c) The breakthrough surface of the poisoning front, as learned (color) and in the ground truth (contours). (d) The activity across the low-activity streak, normalized by the surrounding bed, as learned (solid) against the ground truth (dashed). (e) The true and the learned activity on an axial plane through the streak. (f) Mean squared error in c against optimizer step, converging to the measurement noise floor (gray dashed), with the relative error of the activity in the inset.
Figure 13 shows the problem and the learned reconstruction. The training converges rapidly, reaching the noise level of the measurement within a few hundred steps in panel (f). The learned field recovers the heterogeneity of the true field, capturing the breakthrough surface of the poisoning front in panel (c), the streak of low-activity pellets in panel (d), and the large-scale texture of the random field in panel (e), with a relative error in k of about 5%. We note that the remaining error is concentrated in the fine-scale features of the field, since dispersion smooths them out of the measured concentration. The full training of 1200 steps required a little over four hours on a single NVIDIA L40S GPU.
6. Conclusion
We have presented diff-soup, a software package for GPU-accelerated simulation and inference of large-scale dynamical systems built around the cuDSS sparse direct solver. Accelerating the linear solves of stiff implicit integration on the GPU yields up to faster simulations and faster gradients than established CPU libraries. Nonlinear PDEs on structured and unstructured domains are expressed in a general-purpose modeling system, integrated as stiff ODEs and DAEs in JAX, and differentiated end to end through the discretize-then-optimize approach. The resulting gradients enable PDE-constrained optimization for both classical and modern inference and learning problems. Our methods were evaluated in a systematic benchmark suite against SUNDIALS, PETSc, DifferentialEquations.jl, MATLAB, and diffrax on the heat equation, the Brusselator, and a chemomechanical Cahn-Hilliard problem, for both forward solves and gradients. We demonstrated these workflows by inferring the constitutive relationships of a phase-separating material with uncertainty quantification and by training a neural field embedded in a three-dimensional packed bed reactor model.
This work has opened up several interesting directions for future study. Specifically, as PDE solvers advance and large-scale physics foundation models emerge, there is a critical need for more rigorous benchmarking of stiff PDEs on both regular and irregular geometries. On the software side, we plan to improve the high-performance computing (HPC) compatibility and acceleration of diff-soup with more thorough support for large, distributed simulation and optimization problems. Developing better multi-GPU parallelism strategies for sparse matrix factorization is a promising and important direction of future research. Furthermore, we note the need for support of our algorithms on general accelerator devices and for a modular automatic differentiation library. Finally, we plan to generalize the inference module to adjacent applications of PDE-constrained optimization, such as model pre-dictive control and design of experiments, and to constrained optimization algorithms like IPOPT [102].
By modernizing the PDE modeling, simulation, and inference stack, we aim to build an open-source ecosystem for dynamical systems that advances engineering and drives innovation in AI for science.
7. Methods
7.1. Benchmarking
The benchmarks of Section 4 solve the heat equation, the Brusselator reaction-diffusion system, and the Cahn-Hilliard problem with elasticity. All problems are posed on Cartesian domains, the heat equation discretized by finite differences as in Section 4.1 and the other two by the finite-volume method. The Brusselator adapts the constants of the BRUSS problem of Hairer and Wanner [65]. The Cahn-Hilliard problem follows the elastic precipitate benchmark of PFHub [98] with a regular-solution bulk free energy, with and , a gradient energy coefficient and a mobility . The misfit strain is a dilatational strain of 0.005, and the cubic stiffness constants are in the matrix and 1.1 times those in the precipitate, both interpolated between the phases by . The initial condition adds two zero-flux cosine modes of index 7 with peak amplitude 0.05 to a uniform composition of 0.5 on a 50 nm square domain. The boundaries are no-flux in and and traction free, and three displacement degrees of freedom at two corner cells are pinned to remove the rigid-body modes. In the gradient benchmark, the replaced constitutive relationship in both systems is a pointwise tanh network with two hidden layers of width 128, initialized by LeCun normal initialization [103] and fitted with Adam to the term it replaces. Its active weights are drawn from each layer in proportion to its size, the remaining weights are held fixed, and is the mean squared misfit at eight equally spaced times to target trajectories generated with the weights perturbed by 1%.
Every benchmark runs on nodes of one type in an HPC cluster, with Intel Xeon Platinum 8562Y+ processors and NVIDIA L40S GPUs. In the forward benchmarks, the external comparators run each solve on eight CPU cores, except PETSc, which runs on one, and their hybrid GPU lanes on one L40S and one CPU core. The diff-soup lanes of Figures 5, 8, 9 and
10 run diff-soup 1.0.0 with cuDSS 1.0.0.35 and JAX 0.11.2, with the CPU lanes on KLU over eight cores (one core in Figure 5); Figure 11 and the appendix figures were measured with earlier development versions of the same integrators, and the deposited records provide the benchmark data. The comparators run SUNDIALS 7.8.0, PETSc 3.25.3, Julia 1.12.6 with OrdinaryDiffEq 7.8.1 and SciMLSensitivity 7.119.13, MATLAB R2025b, and diffrax 0.7.0. The full manifest in the companion repository provides the configuration of every benchmark. SUNDIALS [31, 32], PETSc [66, 33] and MATLAB lack a native automatic differentiation library for their integrators, so they are supplied the analytical sparse Jacobian of each problem. DifferentialEquations.jl [34] assembles its Jacobian by sparse automatic differentiation with ForwardDiff.jl and graph coloring. Reported wall time is the median of the warm calls of one process after one cold call, and we employ a strict wall cap of 1800 s for each benchmark cell to minimize the computational burden of the large benchmark suite. Accuracy is the mean absolute error of the final state against the reference, and for a gradient the relative error against the reference gradient. The Brusselator references are external CVODE solves (SciPy Radau in one dimension) and the Cahn-Hilliard references are diff-soup solves, each at tolerances tightened beyond the plotted range and validated by agreement with a second solve at a neighbouring tolerance. The reference gradients are diff-soup reverse-mode gradients at tightened tolerances, validated against a second solve and against central finite differences. Independent SUNDIALS solves reproduce the diff-soup references, with IDA matching the Cahn-Hilliard reference to and the CVODES and IDAS adjoints matching both reference gradients well below every plotted error.
SUNDIALS integrates the Brusselator with CVODE and the Cahn-Hilliard problem with IDA, on the KLU [36] and SuperLU_MT [77] direct solvers and on GMRES [39], with and without the ILU(0) preconditioner [74] written for this study. PETSc integrates with TSBDF at orders up to five with a lagged Jacobian and preconditioner, and solves the Newton systems with KLU, with GMRES and ILU(0), and with algebraic multigrid. For the Newton-Krylov methods, we tune the Krylov dimension above the library defaults, to 50 on the Brusselator and 60 on the Cahn-Hilliard problem in SUNDIALS and in the ILU(0) lanes of PETSc, and to 100 in the multigrid lanes of PETSc. DifferentialEquations.jl integrates with FBDF and QNDF on KLU and differentiates through SciMLSensitivity with a Gauss adjoint in reverse mode and ForwardDiff in forward mode. The gradient lanes run Julia on one thread, with 8 BLAS threads for the Cahn-Hilliard problem and 16 for the Brusselator. MATLAB runs ode15s [35] with the hand-written sparse Jacobian and library defaults otherwise. diffrax [49] runs Kvaerno5 and Tsit5 under its default controller and explicit Euler at the CFL limit in Figure 5. The manifests, the per-lane settings and command lines, the reference tolerances, the step budgets and the record of every cell are in the companion repository named in the data availability statement.
7.2. Worked Example 1
The movie of Figure 12 was generated by solving Eq. (21) with the regular-solution laws and on the unit square at cells, with , no flux and no wetting at the walls, and an initial state of uniform composition 0.5 plus seeded noise. Six frames at geometrically spaced times from to 1.0 were corrupted with Gaussian noise at 10 % of the standard deviation of the noise-free movie and clipped to [0.01, 0.99] so that the logarithmic term stays finite. The prior scale was set by empirical Bayes, scanning the Laplace approximation to the evidence at the fit over six values of and taking the vertex of the quadratic through the three largest, which gave . Every window was solved with JIDA and cuDSS in single precision with forward-mode sensitivities, at rtol = atol = in the fit and in the sampler, and the fit took 37 s on one NVIDIA A100, compilation included. The posterior was sampled in four replicates of four chains, each for 200 warmup and 100 sampling transitions, with the chains whitened by the Laplace approximation at the fit, at 1.6 to 1.7 h per replicate. All sixteen chains mixed, with a split below 1.01 and no divergent transition, and the credible bands of Figure 12 are the pointwise 95 % intervals of the two laws over the 1,600 draws. The data generation, the fit and the sampler scripts are in the companion repository named in the data availability statement.
7.3. Worked Example 2
The reactor of Figure 13 is a three-dimensional packed bed of dimensions , non-dimensionalized by the bed width W, the mean superficial speed U and the inlet concentration . The velocity profile is the steady solution of the Brinkman equation on the cross-section,
(26) with the Kozeny-Carman permeability and the Vortmeyer-Schuster wall porosity at the distance from the nearest wall, for a particle diameter , a bulk porosity , and , scaled to unit mean (Figure 14). The dispersion coefficients follow from particle Péclet numbers of 2 axially and 10 radially, the reactant enters through a Danckwerts flux condition at the inlet and leaves with zero gradient at the outlet, the walls carry no flux, and advection is discretized with central fluxes. The reaction uses and .

Figure 14: The superficial velocity profile of the packed bed from Eq. (26), which channels the flow along the walls.
The true activity is a log-normal random field with correlation length 0.25 W and standard deviation 0.3 in , multiplied by a smooth poisoning front that follows the velocity profile and by a cylindrical streak of low-activity pellets at 30% of the surrounding activity. The dataset was generated from an empty bed, saved at every cell at eight times from t = 1 to 8 and corrupted with Gaussian noise of standard deviation . The WIRE network has three hidden layers of width 192 with wavelet parameters and . The network was trained for 1200 steps on one NVIDIA L40S with the AdamW optimizer [101] in optax [52], every step integrating the model as a single trajectory from t = 0 with JNDF and cuDSS in Float32 precision at rtol = and atol = and using the discrete checkpointed adjoint. The model, the truth, the data generation and the training scripts are in the companion repository named in the data availability statement.
CRediT authorship contribution statement
Samuel Degnan-Morgenstern: Conceptualization, Methodology, Software, Validation, Formal analysis, Investigation, Data curation, Writing - original draft, Writing - review & editing, Visualization, Project administration, Funding acquisition. Martin Z. Bazant: Writing - review & editing, Supervision, Project administration, Funding acquisition.
Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Acknowledgements
S.D.M. acknowledges support from the National Science Foundation Graduate Research Fellowship under Grant No. 2141064. The authors acknowledge the MIT Office of Research Computing and Data for providing high performance computing resources that have contributed to the research results reported within this paper. The authors also thank Chihyun Nam, Alexander Cohen, Jacob Sass, Sungho Shin, Steven Johnson, and Simon Daubner for valuable discussions.
Data availability
The source code of diff-soup is deposited in the CPC Program Library and developed at https://github.com/stmorgenstern/diff-soup. The benchmark suite, manifests, result stores, figures, and the scripts of the two worked examples are deposited in the CPC Program Library with the source code.
Declaration of generative AI and AI-assisted technologies in the writing process
During the preparation of this work the authors used Claude Code (Anthropic) in order to assist in software generation and manuscript editing. After using this service, the authors reviewed and edited the content as needed and take full responsibility for the content of the published article.
Appendix A. The three diff-soup VSVO solvers
In this appendix, we compare the three native VSVO solvers of diff-soup on each benchmark problem of Section 4. Figure A.15 shows that the three solvers generally exhibit similar performance at matched error, with no significant leader. For this reason, we adopt JIDA for the main text results, as it is generally the most robust stiff implicit integration algorithm and handles the most general problem form.
Brusselator 2D, N = 128

(b)
Brusselator 2D, scaling

(c)
Brusselator 3D, N = 64
(d)
Brusselator 3D, scaling

(e)
Brusselator closure, state
(f)
Cahn-Hilliard closure, state

(g)
Brusselator closure, width

(h)
Cahn-Hilliard closure, width

diff-soup JIDA
diff-soup JBDF
diff-soup JNDF
reverse mode (e to h)
forward mode (e to h)
Figure A.15: Work-precision and scaling diagrams for the two-dimensional (a, b) and three-dimensional (c, d) Brusselator and gradient scaling diagrams for the Brusselator (e, g) and Cahn-Hilliard (f, h) closures for the diff-soup solvers JIDA (navy), JBDF (blue), and JNDF (light blue), with the marker denoting the solver and the line style the differentiation mode as described in the legend. All benchmarks are run according to the procedure described in Section 7.1. Notably, data points are omitted where the solve did not converge or exceeded the wall cap. (a, c) The work-precision diagrams show the three solvers sharing one performance-accuracy frontier. (b, d) The scaling diagrams show the three solvers exhibiting the same asymptotic scaling within a small factor of one another. (e, f, g, h) The gradient diagrams show the three solvers within a small factor of one another in both differentiation modes, with the mass-matrix solvers JBDF and JNDF marginally faster on the Brusselator closure and JIDA the fastest on the Cahn-Hilliard closure.
Appendix B. One-dimensional Brusselator comparison
(a)

(b)

Figure B.16: Work-precision (a) and scaling (b) diagrams for the one-dimensional Brusselator for diff-soup (solid blue), SUNDIALS (dashed red), PETSc (dashed green), Julia DifferentialEquations.jl (dashed purple), and MATLAB (dashed gray), with the marker denoting the particular solver as described in the legend. All benchmarks are run according to the procedure described in Section 7.1. Notably, data points are omitted where the solve did not converge or exceeded the wall cap. Generally, we find that for a one-dimensional problem below the crossover of Figure 5d the fixed overhead of the GPU dominates and the CPU based solvers lead. (a) The work-precision diagram shows the CPU based solvers outperforming diff-soup, the fastest of them by over an order of magnitude, with only the multigrid-preconditioned PETSc solver trailing it. (b) The scaling diagram shows diff-soup exhibiting a fixed overhead across the ladder, whereas the CPU based solvers exhibit power-law growth.
References
[1] P. Bauer, A. Thorpe, G. Brunet, The quiet revolution of numerical weather prediction, Nature 525 (2015) 47–55. URL: https://www.nature.com/articles/nature14956. doi:10.1038/nature14956.
[2] T. N. Palmer, Stochastic weather and climate models, Nature Reviews Physics 1 (2019) 463–471. URL: https://www.nature.com/articles/s42254-019-0062-2. doi:10.1038/s42254-019-0062-2.
[3] P. Moin, K. Mahesh, DIRECT NUMERICAL SIMULATION: A Tool in Turbulence Research, Annual Review of Fluid Mechanics 30 (1998) 539–578. URL: https://www.annualreviews.org/doi/10.
1146/annurev.fluid.30.1.539. doi:10.1146/annurev.fluid.30.1.539.
[4] T. Lu, C. K. Law, Toward accommodating realistic fuel chemistry in large-scale computations, Progress in Energy and Combustion Science 35 (2009) 192–215. URL: https://linkinghub.elsevier.com/retrieve/pii/S036012850800066X. doi:10.1016/j.pecs.2008.10.002.
[5] J. W. Cahn, J. E. Hilliard, Free Energy of a Nonuniform System. I. Interfacial Free Energy, The Journal of Chemical Physics 28 (1958) 258–267. URL: https://pubs.aip.org/jcp/article/28/2/258/74794/Free-Energy-of-a-Nonuniform-System-I-Interfacial. doi:10.1063/1.1744102.
[6] L.-Q. Chen, Phase-Field Models for Microstructure Evolution, Annual Review of Materials Research 32 (2002) 113–140. URL: https://www.annualreviews.org/doi/10.1146/annurev.matsci.32.112001.132041. doi:10.1146/annurev.matsci.32.112001.132041.
[7] I. Steinbach, Phase-field models in materials science, Modelling and Simulation in Materials Science and Engineering 17 (2009) 073001. URL: https://iopscience.iop.org/article/10.1088/0965-0393/17/7/073001. doi:10.1088/0965-0393/17/7/073001.
[8] J. Newman, W. Tiedemann, Porous-electrode theory with battery applications, AIChE Journal 21 (1975) 25–41. URL: https://aiche.onlinelibrary.wiley.com/doi/10.1002/aic.690210103. doi:10.1002/aic.690210103.
[9] M. Doyle, T. F. Fuller, J. Newman, Modeling of Galvanostatic Charge and Discharge of the Lithium/Polymer/Insertion Cell, Journal of The Electrochemical Society 140 (1993) 1526–1533. URL: https://iopscience.iop.org/article/10.1149/1.2221597. doi:10.1149/1.2221597.
[10] V. Ramadesigan, P. W. C. Northrop, S. De, S. Santhanagopalan, R. D. Braatz, V. R. Subramanian, Modeling and Simulation of Lithium-Ion Batteries from a Systems Engineering Perspective, Journal of The Electrochemical Society 159 (2012) R31–R45. URL: https:// iopscience.iop.org/article/10.1149/2.018203jes. doi:10.1149/2.018203jes.
[11] A. M. Turing, The chemical basis of morphogenesis, Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences 237 (1952) 37–72. URL: https://royalsocietypublishing.org/rstb/article/237/641/37/112910/The-chemical-basis-of-morphogenesis. doi:10.1098/rstb.1952.0012.
[12] S. Kondo, T. Miura, Reaction-Diffusion Model as a Framework for Understanding Biological Pattern Formation, Science 329 (2010) 1616–1620. URL: https://www.science.org/doi/10.1126/science.1179047. doi:10.1126/science.1179047.
[13] M. Raissi, P. Perdikaris, G. Karniadakis, Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations, Journal of Computational Physics 378 (2019) 686–707. URL: https://linkinghub.elsevier.com/retrieve/pii/S0021999118307125. doi:10.1016/j.jcp.2018.10.045.
[14] G. E. Karniadakis, I. G. Kevrekidis, L. Lu, P. Perdikaris, S. Wang, L. Yang, Physics-informed machine learning, Nature Reviews Physics 3 (2021) 422–440. URL: https://www.nature.com/articles/s42254-021-00314-5. doi:10.1038/s42254-021-00314-5.
[15] C. Rackauckas, Y. Ma, J. Martensen, C. Warner, K. Zubov, R. Supekar, D. Skinner, A. Ramadhan, A. Edelman, Universal Differential Equations for Scientific Machine Learning, 2021. URL: http://arxiv.org/abs/2001.04385. doi:10.48550/arXiv.2001.04385, arXiv preprint arXiv:2001.04385.
[16] M. Reichstein, G. Camps-Valls, B. Stevens, M. Jung, J. Denzler, N. Carvalhais, Prabhat, Deep learning and process understanding for data-driven Earth system science, Nature 566 (2019) 195–204. URL: https://www.nature.com/articles/s41586-019-0912-1. doi:10.1038/s41586-019-0912-1.
[17] D. Kochkov, J. Yuval, I. Langmore, P. Norgaard, J. Smith, G. Mooers, M. Klöwer, J. Lottes, S. Rasp, P. Düben, S. Hatfield, P. Battaglia, A. Sanchez-Gonzalez, M. Willson, M. P. Brenner, S. Hoyer, Neural general circulation models for weather and climate, Nature 632 (2024) 1060–1066. URL: https://www.nature.com/articles/s41586-024-07744-y. doi:10.1038/s41586-024-07744-y.
[18] S. L. Brunton, B. R. Noack, P. Koumoutsakos, Machine Learning for Fluid Mechanics, Annual Review of Fluid Mechanics 52 (2020) 477–508. URL: https://www.annualreviews.org/doi/10.1146/annurev-fluid-010719-060214. doi:10.1146/annurev-fluid-010719-060214.
[19] K. Um, R. Brand, Y. Fei, P. Holl, N. Thuerey, Solver-in-the-Loop: Learning from Differentiable Physics to Interact with Iterative PDE-Solvers, in: Advances in Neural Information Processing Systems, volume 33, 2020. URL: https://arxiv.org/abs/2007.00016.
[20] D. Kochkov, J. A. Smith, A. Alieva, Q. Wang, M. P. Brenner, S. Hoyer, Machine learning-accelerated computational fluid dynamics, Proceedings of the National Academy of Sciences 118 (2021) e2101784118. URL: https://pnas.org/doi/full/10.1073/pnas.2101784118. doi:10.1073/pnas.2101784118.
[21] S. H. Rudy, S. L. Brunton, J. L. Proctor, J. N. Kutz, Data-driven discovery of partial differential equations, Science Advances 3 (2017) e1602614. URL: https://www.science.org/doi/10.1126/sciadv.1602614. doi:10.1126/sciadv.1602614.
[22] Z. Wang, X. Huan, K. Garikipati, Variational system identification of the partial differential equations governing the physics of pattern-formation: Inference under varying fidelity and noise, Computer Methods in Applied Mechanics and Engineering 356 (2019) 44–74. URL: https://linkinghub.elsevier.com/retrieve/pii/S0045782519304037. doi:10.1016/j.cma.2019.07.007.
[23] H. Zhao, H. D. Deng, A. E. Cohen, J. Lim, Y. Li, D. Fraggedakis, B. Jiang, B. D. Storey, W. C. Chueh, R. D. Braatz, M. Z. Bazant, Learning heterogeneous reaction kinetics from X-ray videos pixel by pixel, Nature 621 (2023) 289–294. URL: https://www.nature.com/articles/s41586-023-06393-x. doi:10.1038/s41586-023-06393-x.
[24] P. Holl, V. Koltun, N. Thuerey, Learning to Control PDEs with Differentiable Physics, in: International Conference on Learning Representations, 2020. URL: https://arxiv.org/abs/2001.07457.
[25] A. E. Cohen, S. Degnan-Morgenstern, S. Daubner, J. Dunkel, M. Z. Bazant, Differentiable learning and control of free-energy-driven pattern dynamics, Physical Review Research 8 (2026) 023344. URL: https://link.aps.org/doi/10.1103/b8kc-vpwq. doi:10.1103/b8kc-vpwq.
[26] D. Liu, Z. Shadike, R. Lin, K. Qian, H. Li, K. Li, S. Wang, Q. Yu, M. Liu, S. Ganapathy, X. Qin, Q. Yang, M. Wagemaker, F. Kang, X. Yang, B. Li, Review of Recent Development of In Situ/Operando Characterization Techniques for Lithium Battery Research, Advanced Materials 31 (2019) 1806620. URL: https://advanced.onlinelibrary.wiley.com/doi/10.1002/adma.201806620. doi:10.1002/adma.201806620.
[27] Y. Wu, N. Liu, Visualizing Battery Reactions and Processes by Using In Situ and In Operando Microscopies, Chem 4 (2018) 438–465. URL: https://linkinghub.elsevier.com/retrieve/pii/S2451929417305247. doi:10.1016/j.chempr.2017.12.022.
[28] Y. Yang, Y. Xiong, R. Zeng, X. Lu, M. Krumov, X. Huang, W. Xu, H. Wang, F. J. DiSalvo, J. D. Brock, D. A. Muller, H. D. Abruña, Operando Methods in Electrocatalysis, ACS Catalysis 11 (2021) 1136–1178. URL: https://pubs.acs.org/doi/10.1021/acscatal.0c04789. doi:10.1021/acscatal.0c04789.
[29] G. D. Byrne, A. C. Hindmarsh, Stiff ODE Solvers: A Review of Current and Coming Attractions, Journal of Computational Physics 70 (1987) 1–62. doi:10.1016/0021-9991(87)90001-5.
[30] C. B. Moler, Numerical Computing with <span style="font-variant:small-caps;">Matlab</span>, Society for Industrial and Applied Mathematics, 2004. URL: https://epubs.siam.org/doi/book/10.1137/1.9780898717952. doi:10.1137/1.9780898717952.
[31] A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban, D. E. Shumaker, C. S. Woodward, SUNDIALS: Suite of nonlinear and differential/algebraic equation solvers, ACM Transactions on Mathematical Software 31 (2005) 363–396.
[32] D. J. Gardner, D. R. Reynolds, C. S. Woodward, C. J. Balos, Enabling New Flexibility in the SUNDIALS Suite of Nonlinear and Differential/Algebraic Equation Solvers, ACM Transactions on Mathematical Software 48 (2022) 1–24. URL: https://dl.acm.org/doi/10.1145/3539801. doi:10.1145/3539801.
[33] S. Abhyankar, J. Brown, E. M. Constantinescu, D. Ghosh, B. F. Smith, H. Zhang, PETSc/TS: A Modern Scalable ODE/DAE Solver Library, 2018. URL: https://arxiv.org/abs/1806.01437v1, arXiv preprint arXiv:1806.01437.
[34] C. Rackauckas, Q. Nie, Differential Equations.jl – A Performant and Feature-Rich Ecosystem for Solving Differential Equations in Julia, Journal of Open Research Software 5 (2017) 15. doi:10.5334/jors.151.
[35] L. F. Shampine, M. W. Reichelt, The MATLAB ODE suite, SIAM Journal on Scientific Computing 18 (1997) 1–22.
[36] T. A. Davis, E. Palamadai Natarajan, Algorithm 907: KLU, a direct sparse solver for circuit simulation problems, ACM Transactions on Mathematical Software 37 (2010) 36:1–36:17.
[37] X. S. Li, An overview of SuperLU: Algorithms, implementation, and user interface, ACM Transactions on Mathematical Software 31 (2005) 302–325. URL: https://dl.acm.org/doi/10.1145/1089014.1089017. doi:10.1145/1089014.1089017.
[38] T. A. Davis, Algorithm 832: UMFPACK V4.3—an unsymmetric-pattern multifrontal method, ACM Transactions on Mathematical Software 30 (2004) 196–199. URL: https://dl.acm.org/doi/10.1145/992200.992206. doi:10.1145/992200.992206.
[39] Y. Saad, M. H. Schultz, GMRES: A generalized minimal residual algorithm for solving nonsymmetric linear systems, SIAM Journal on
Scientific and Statistical Computing 7 (1986) 856–869. doi:10.1137/0907058.
[40] D. A. Knoll, D. E. Keyes, Jacobian-free Newton-Krylov methods: a survey of approaches and applications, Journal of Computational Physics 193 (2004) 357–397. doi:10.1016/j.jcp.2003.08.010.
[41] P. Sao, R. Vuduc, X. S. Li, A Distributed CPU-GPU Sparse Direct Solver, in: I. Dutra, F. Silva, V. Santos Costa (Eds.), Euro-Par 2014 Parallel Processing, volume 8632, Springer International Publishing, Cham, 2014, pp. 487–498. URL: http://link.springer.com/10.1007/978-3-319-09873-9_41. doi:10.1007/978-3-319-09873-9_41, series Title: Lecture Notes in Computer Science.
[42] P. Ghysels, R. Synk, High performance sparse multifrontal solvers on modern GPUs, Parallel Computing 110 (2022) 102897. URL: https://linkinghub.elsevier.com/retrieve/pii/S0167819122000059. doi:10.1016/j.parco.2022.102897.
[43] C. J. Balos, D. J. Gardner, C. S. Woodward, D. R. Reynolds, Enabling GPU accelerated computing in the SUNDIALS time integration library, Parallel Computing 108 (2021) 102836. URL: https://linkinghub.elsevier.com/retrieve/pii/S0167819121000831. doi:10.1016/j.parco.2021.102836.
[44] R. T. Mills, M. F. Adams, S. Balay, J. Brown, A. Dener, M. Knepley, S. E. Kruger, H. Morgan, T. Munson, K. Rupp, B. F. Smith, S. Zampini, H. Zhang, J. Zhang, Toward performance-portable PETSc for GPU-based exascale systems, Parallel Computing 108 (2021) 102831. URL: https://linkinghub.elsevier.com/retrieve/pii/S016781912100079X. doi:10.1016/j.parco.2021.102831.
[45] U. Utkarsh, V. Churavy, Y. Ma, T. Besard, P. Srisuma, T. Gymnich, A. R. Gerlach, A. Edelman, G. Barbastathis, R. D. Braatz, C. Rackauckas, Automated translation and accelerated solving of differential equations on multiple GPU platforms, Computer Methods in Applied Mechanics and Engineering 419 (2024) 116591. URL: https://linkinghub.elsevier.com/retrieve/pii/S0045782523007156. doi:10.1016/j.cma.2023.116591.
[46] C. Li, S. Huang, J. Deng, jaxdae: A JAX-native Differentiable Solver for Differential-Algebraic Equations in Coupled Multi-physics, 2026. URL: https://arxiv.org/abs/2607.23202. doi:10.48550/ARXIV.2607.23202, arXiv preprint arXiv:2607.23202.
[47] D. A. Bezgin, A. B. Buhendwa, N. A. Adams, JAX-Fluids: A fully-differentiable high-order computational fluid dynamics solver for compressible two-phase flows, Computer Physics Communications 282 (2023) 108527. URL: https://linkinghub.elsevier.com/retrieve/pii/S0010465522002466. doi:10.1016/j.cpc.2022.108527.
[48] T. Xue, S. Liao, Z. Gan, C. Park, X. Xie, W. K. Liu, J. Cao, JAX-FEM: A differentiable GPU-accelerated 3D finite element solver for automatic inverse design and mechanistic data science, Computer Physics Communications 291 (2023) 108802. URL: https://linkinghub.elsevier.com/retrieve/pii/S0010465523001479. doi:10.1016/j.cpc.2023.108802.
[49] P. Kidger, On Neural Differential Equations, PhD thesis, University of Oxford, 2021. URL: https://arxiv.org/abs/2202.02435.
[50] NVIDIA Corporation, cuDSS: NVIDIA CUDA Direct Sparse Solver library, 2024. URL: https://docs.nvidia.com/cuda/cudss/.
[51] P. Kidger, C. Garcia, Equinox: neural networks in JAX via callable PyTrees and filtered transformations, 2021. URL: https://arxiv.org/abs/2111.00254. doi:10.48550/ARXIV.2111.00254, arXiv preprint arXiv:2111.00254.
[52] DeepMind, I. Babuschkin, K. Baumli, A. Bell, S. Bhupatiraju, J. Bruce, P. Buchlovsky, D. Budden, T. Cai, A. Clark, I. Danihelka, A. Dedieu, C. Fantacci, J. Godwin, C. Jones, R. Hemsley, T. Hennigan, M. Hessel, S. Hou, S. Kapturowski, T. Keck, I. Kemaev, M. King, M. Kunesch, L. Martens, H. Merzic, V. Mikulik, T. Norman, G. Papamakarios, J. Quan, R. Ring, F. Ruiz, A. Sanchez, L. Sartran, R. Schneider, E. Sezener, S. Spencer, S. Srinivasan, M. Stanojević, W. Stokowiec, L. Wang, G. Zhou, F. Viola, The DeepMind JAX Ecosystem, 2020. URL: http://github.com/google-deepmind.
[53] A. Cabezas, A. Corenflos, J. Lao, R. Louf, A. Carnec, K. Chaudhari, R. Cohn-Gordon, J. Coullon, W. Deng, S. Duffield, G. Durán-Martín, M. Elantkowski, D. Foreman-Mackey, M. Gregori, C. Iguaran, R. Kumar, M. Lysy, K. Murphy, J. C. Orduz, K. Patel, X. Wang, R. Zinkov, BlackJAX: Composable Bayesian inference in JAX, 2024. URL: https://arxiv.org/abs/2402.10797. doi:10.48550/ARXIV.2402.10797, arXiv preprint arXiv:2402.10797.
[54] L. F. Shampine, C. W. Gear, A User’s View of Solving Stiff Ordinary Differential Equations, SIAM Review 21 (1979) 1–17. doi:10.1137/1021001.
[55] K. J. Beers, Numerical Methods for Chemical Engineering: Applications in MATLAB, Cambridge University Press, Cambridge, 2006. URL: https://www.cambridge.org/core/books/numerical-methods-for-chemical-engineering/0E8FDD0E2265EDE9F728FFEDD18F0695. doi:10.1017/CB09780511812194.
[56] C. W. Gear, Numerical Initial Value Problems in Ordinary Differential Equations, Prentice-Hall Series in Automatic Computation, Prentice-Hall, Englewood Cliffs, NJ, 1971.
[57] G. D. Byrne, A. C. Hindmarsh, A Polyalgorithm for the Numerical Solution of Ordinary Differential Equations, ACM Transactions on Mathematical Software 1 (1975) 71–96. doi:10.1145/355626.355636.
[58] C. F. Curtiss, J. O. Hirschfelder, Integration of stiff equations, Proceedings of the National Academy of Sciences 38 (1952) 235–243.
[59] K. R. Jackson, R. Sacks-Davis, An Alternative Implementation of Variable Step-Size Multistep Formulas for Stiff ODEs, ACM Transactions on Mathematical Software 6 (1980) 295–318. doi:10.1145/355900.355903.
[60] R. W. Klopfenstein, Numerical differentiation formulas for stiff systems of ordinary differential equations, RCA Review 32 (1971) 447–462.
[61] L. F. Shampine, Implementation of Implicit Formulas for the Solution of ODEs, SIAM Journal on Scientific and Statistical Computing 1 (1980) 103–118. doi:10.1137/0901005.
[62] L. R. Petzold, A Description of DASSL: A Differential/Algebraic System Solver, in: R. S. Stepleman, M. Carver, R. Peskin, W. F. Ames, R. Vichnevetsky (Eds.), Scientific Computing, volume 1 of IMACS Transactions on Scientific Computation, North-Holland, Amsterdam, 1983, pp. 65–68.
[63] K. E. Brenan, S. L. Campbell, L. R. Petzold, Numerical Solution of Initial-Value Problems in Differential-Algebraic Equations, SIAM, Philadelphia, 1996.
[64] P. N. Brown, G. D. Byrne, A. C. Hindmarsh, VODE: A Variable-Coefficient ODE Solver, SIAM Journal on Scientific and Statistical Computing 10 (1989) 1038–1051. doi:10.1137/0910062.
[65] E. Hairer, G. Wanner, Solving Ordinary Differential Equations II: Stiff and Differential-Algebraic Problems, 2 ed., Springer, Berlin, 1996.
[66] S. Balay, W. D. Gropp, L. C. McInnes, B. F. Smith, Efficient Management of Parallelism in Object-Oriented Numerical Software Libraries, in: E. Arge, A. M. Bruaset, H. P. Langtangen (Eds.), Modern Software Tools for Scientific Computing, Birkhäuser, Boston, 1997, pp. 163–202.
[67] A. Griewank, A. Walther, Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation, 2 ed., SIAM, Philadelphia, 2008.
[68] G. Dalle, A. Hill, A Common Interface for Automatic Differentiation, Journal of Machine Learning Research 27 (2026) 1–13. URL: http://jmlr.org/papers/v27/25-1024.html.
[69] J. Bradbury, R. Frostig, P. Hawkins, M. J. Johnson, C. Leary, D. Maclaurin, G. Necula, A. Paszke, J. VanderPlas, S. Wanderman-Milne, Q. Zhang, JAX: composable transformations of Python+NumPy programs, 2018. URL: http://github.com/google/jax.
[70] A. R. Curtis, M. J. D. Powell, J. K. Reid, On the estimation of sparse Jacobian matrices, Journal of the Institute of Mathematics and its Applications 13 (1974) 117–119.
[71] T. F. Coleman, A. Verma, The Efficient Computation of Sparse Jacobian Matrices Using Automatic Differentiation, SIAM Journal on Scientific Computing 19 (1998) 1210–1233. URL: https://epubs.siam.org/doi/10.1137/S1064827595295349. doi:10.1137/S1064827595295349.
[72] A. H. Gebremedhin, F. Manne, A. Pothen, What color is your Jacobian? Graph coloring for computing derivatives, SIAM Review 47 (2005) 629–705.
[73] T. A. Davis, Direct Methods for Sparse Linear Systems, Fundamentals of Algorithms, SIAM, Philadelphia, 2006.
[74] Y. Saad, Iterative Methods for Sparse Linear Systems, 2 ed., SIAM, Philadelphia, 2003.
[75] J. W. Ruge, K. Stüben, Algebraic multigrid, in: S. F. McCormick (Ed.), Multigrid Methods, Frontiers in Applied Mathematics, SIAM, Philadelphia, 1987, pp. 73–130.
[76] A. George, Nested dissection of a regular finite element mesh, SIAM Journal on Numerical Analysis 10 (1973) 345–363. doi:10.1137/0710032.
[77] J. W. Demmel, J. R. Gilbert, X. S. Li, An asynchronous parallel supernodal algorithm for sparse Gaussian elimination, SIAM Journal on Matrix Analysis and Applications 20 (1999) 915–952.
[78] F. Sapienza, J. Bolibar, F. Schäfer, B. Groenke, A. Pal, V. Bousange, P. Heimbach, G. Hooker, F. Pérez, P.-O. Persson, C. Rackauckas, Differentiable Programming for Differential Equations: A Review, arXiv preprint arXiv:2406.09699 (2024). URL: https://arxiv.org/abs/2406.09699. doi:10.48550/arXiv.2406.09699.
[79] H. Zhao, R. D. Braatz, M. Z. Bazant, Image inversion and uncertainty quantification for constitutive laws of pattern formation, Journal of Computational Physics 436 (2021) 110279. URL: https://linkinghub.elsevier.com/retrieve/pii/S0021999121001741. doi:10.1016/j.jcp.2021.110279.
[80] R. Serban, A. C. Hindmarsh, CVODES: The Sensitivity-Enabled ODE Solver in SUNDIALS, in: ASME 2005 International Design Engineering Technical Conferences and Computers and Information in Engineering Conference, American Society of Mechanical Engineers Digital Collection, 2008, pp. 257–269. URL: https://dx.doi.org/10.1115/DETC2005-85597. doi:10.1115/DETC2005-85597.
[81] H. Zhang, E. M. Constantinescu, B. F. Smith, PETSc TSAdjoint: A Discrete Adjoint ODE Solver for First-Order and Second-Order Sensitivity Analysis, SIAM Journal on Scientific Computing 44 (2022) C1–C24. URL: https://doi.org/10.1137/21M140078X. doi:10.1137/21M140078X.
[82] H. Zhang, A. Sandu, FATODE: A Library for Forward, Adjoint, and Tangent Linear Integration of ODEs, SIAM Journal on Scientific Computing 36 (2014) C504–C523. URL: https://epubs.siam.org/doi/10.1137/130912335. doi:10.1137/130912335.
[83] P. E. Farrell, D. A. Ham, S. W. Funke, M. E. Rognes, Automated Derivation of the Adjoint of High-Level Transient Finite Element Programs, SIAM Journal on Scientific Computing 35 (2013) C369–C393. URL: https://epubs.siam.org/doi/10.1137/120873558. doi:10.1137/120873558.
[84] Y. Cao, S. Li, L. Petzold, R. Serban, Adjoint Sensitivity Analysis for Differential-Algebraic Equations: The Adjoint DAE System and Its Numerical Solution, SIAM Journal on Scientific Computing 24 (2003) 1076–1089. doi:10.1137/S1064827501380630.
[85] M. Blondel, Q. Berthet, M. Cuturi, R. Frostig, S. Hoyer, F. Llinares-López, F. Pedregosa, J.-P. Vert, Efficient and Modular Implicit Differentiation, in: Advances in Neural Information Processing Systems, volume 35, 2022. URL: https://arxiv.org/abs/2105.15183.
[86] S. Kim, W. Ji, S. Deng, Y. Ma, C. Rackauckas, Stiff Neural Ordinary Differential Equations, Chaos: An Interdisciplinary Journal of Nonlinear Science 31 (2021) 093122. URL: https://arxiv.org/abs/2103.15341. doi:10.1063/5.0060697.
[87] R. T. Q. Chen, Y. Rubanova, J. Bettencourt, D. Duvenaud, Neural Ordinary Differential Equations, in: Advances in Neural Information Processing Systems, volume 31, 2018. URL: https://arxiv.org/abs/1806.07366.
[88] P. Stumm, A. Walther, New Algorithms for Optimal Online Checkpointing, SIAM Journal on Scientific Computing 32 (2010) 836–854. doi:10.1137/080742439.
[89] Q. Wang, P. Moin, G. Iaccarino, Minimal Repetition Dynamic Checkpointing Algorithm for Unsteady Adjoint Calculation, SIAM Journal on Scientific Computing 31 (2009) 2549–2567. doi:10.1137/080727890.
[90] S. Galán, W. F. Feehery, P. I. Barton, Parametric sensitivity functions for hybrid discrete/continuous systems, Applied Numerical Mathematics 31 (1999) 17–47. doi:10.1016/S0168-9274(98)00125-1.
[91] I. Hiskens, M. Pai, Trajectory sensitivity analysis of hybrid systems, IEEE Transactions on Circuits and Systems I: Fundamental Theory and Applications 47 (2000) 204–220. URL: http://ieeexplore.ieee.org/document/828574/. doi:10.1109/81.828574.
[92] S. Corner, A. Sandu, C. Sandu, Adjoint sensitivity analysis of hybrid multibody dynamical systems, Multibody System Dynamics 49 (2020) 395–420. URL: http://link.springer.com/10.1007/s11044-020-09726-0. doi:10.1007/s11044-020-09726-0.
[93] H. Bock, K. Plitt, A Multiple Shooting Algorithm for Direct Solution of Optimal Control Problems, IFAC Proceedings Volumes 17 (1984) 1603–1608. URL: https://linkinghub.elsevier.com/retrieve/pii/S1474667017612059. doi:10.1016/S1474-6670(17)61205-9.
[94] A. Jokisaari, P. Voorhees, J. Guyer, J. Warren, O. Heinonen, Phase field benchmark problems for dendritic growth and linear elasticity, Computational Materials Science 149 (2018) 336–347. URL: https://linkinghub.elsevier.com/retrieve/pii/S092702561830168X. doi:10.1016/j.commatsci.2018.03.015.
[95] R. J. LeVeque, Finite Difference Methods for Ordinary and Partial Differential Equations: Steady-State and Time-Dependent Problems, Society for Industrial and Applied Mathematics, 2007. URL:
https://epubs.siam.org/doi/book/10.1137/1.9780898717839.
doi:10.1137/1.9780898717839.
[96] I. Prigogine, R. Lefever, Symmetry Breaking Instabilities in Dissipative Systems. II, The Journal of Chemical Physics 48 (1968) 1695–1700. URL: https://pubs.aip.org/jcp/article/48/4/1695/83930/Symmetry-Breaking-Instabilities-in-Dissipative. doi:10.1063/1.1668896.
[97] C. Rackauckas, Q. Nie, Confederated modular differential equation APIs for accelerated algorithm development and benchmarking, Advances in Engineering Software 132 (2019) 1–6. URL: https://linkinghub.elsevier.com/retrieve/pii/S0965997818310251. doi:10.1016/j.advengsoft.2019.03.009.
[98] D. Wheeler, T. Keller, S. J. DeWitt, A. M. Jokisaari, D. Schwen, J. E. Guyer, L. K. Aagesen, O. G. Heinonen, M. R. Tonks, P. W. Voorhees, J. A. Warren, PFHub: The Phase-Field Community Hub, Journal of Open Research Software 7 (2019) 29. URL: https://openresearchsoftware.metajnl.com/article/10.5334/jors.276/. doi:10.5334/jors.276.
[99] M. D. Hoffman, A. Gelman, The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo, Journal of Machine Learning Research 15 (2014) 1593–1623. URL: https://jmlr.org/papers/v15/hoffman14a.html.
[100] V. Saragadam, D. LeJeune, J. Tan, G. Balakrishnan, A. Veeraraghavan, R. G. Baraniuk, WIRE: Wavelet Implicit Neural Representations, in: 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), IEEE, Vancouver, BC, Canada, 2023, pp. 18507–18516. URL: https://ieeexplore.ieee.org/document/10204916/. doi:10.1109/CVPR52729.2023.01775.
[101] I. Loshchilov, F. Hutter, Decoupled Weight Decay Regularization, in: International Conference on Learning Representations (ICLR), 2019. URL: https://openreview.net/forum?id=Bkg6RiCqY7.
[102] A. Wächter, L. T. Biegler, On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming, Mathematical Programming 106 (2006) 25–57. URL: http:
//link.springer.com/10.1007/s10107-004-0559-y. doi:10.1007/s10107-004-0559-y.
[103] Y. LeCun, L. Bottou, G. B. Orr, K.-R. Müller, Efficient Back-Prop, in: Neural Networks: Tricks of the Trade, number 1524 in Lecture Notes in Computer Science, Springer, Berlin, Heidelberg, 1998, pp. 9–50. URL: https://doi.org/10.1007/3-540-49430-8_2. doi:10.1007/3-540-49430-8_2.