Non-intrusive Differentiation of High-Performance Seismic Solvers
Abstract
Differentiable frameworks for seismic tomography compute model gradients without hand-derived adjoint sources. Some differentiate through wave propagation, which can be costly in time and memory at scale. Others use native adjoints with automatically constructed sources, and the efficiency is largely determined by forward and adjoint solves. Mature seismic solvers offer efficient, well-tested propagation, but a reusable workflow is still needed to connect them to user-defined misfit functions. Here we present a non-intrusive workflow and an Agent Skill for adapting existing seismic solvers to differentiable inversion. We apply automatic differentiation (AD) to the preprocessing and misfit, stopping backpropagation at the synthetic data. The solver injects this data derivative at the receivers to form the adjoint source, then computes the model gradient from the native forward and adjoint simulations. To assess accuracy and computational cost, we compared our hybrid implementation (HybridADFWI) with full AD in ADFWI using the same forward solver. Across six settings, the gradients agreed to within $1.4\times10^{-6}$ in relative $L_2$ norm. For one iteration, HybridADFWI was 2.4-4.6 times as fast as ADFWI and used 5-22% less peak reserved GPU memory. Guided by the Skill, a coding agent adds missing adjoint routines, verifies gradients, and runs recovery tests for user-selected model parameters. We applied the Skill to two independent solvers, building DiffSPECFEM2D and DiffAxiSEM3D. In the P-wave velocity tests, DiffSPECFEM2D recovered the main dipping layers of Marmousi-II, and DiffAxiSEM3D recovered the overall shape of the SEG/EAGE salt body. Both frameworks support user-defined misfits while preserving native kernels and parallel execution.
- Comment
- 18 pages, 5 figures, 1 table