arXiv:2610.37333cs.MSOct 2026

Manuscript Offprint

arXiv:2610.37333

diff-soup: GPU-native Differentiable Simulation and Inference for Large-scale Stiff Dynamical Systems

Samuel Degnan-Morgenstern, Martin Z. Bazant

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

References (84)