Scheduled Jacobian Chaining
Simon Märtens, Uwe Naumann
TL;DR
The paper reframes the Jacobian accumulation problem for differentiable programs as a Jacobian Chain Product with the goal of minimizing the number of scalar $\text{fma}$ operations through optimal bracketing. It then introduces Scheduling-aware Dynamic Programming to solve a precedence-constrained, in-tree variant of the problem, producing near-optimal elimination sequences that exploit parallelism under a given machine count $m$ and memory constraints. Although the underlying scheduling problem is NP-hard, the DP approach remains a practical heuristic, and its effectiveness is validated against a Branch-and-Bound global optimum using large-scale statistical benchmarks. The work provides a reference implementation, case-study guidance, and avenues for future work in runtime tape partitioning, communication costs, and sparsity-aware extensions, underscoring the practical impact for high-performance AD in computational engineering.
Abstract
This paper addresses the efficient computation of Jacobian matrices for programs composed of sequential differentiable subprograms. By representing the overall Jacobian as a chain product of the Jacobians of these subprograms, we reduce the problem to optimizing the sequence of matrix multiplications, known as the Jacobian Matrix Chain Product problem. Solutions to this problem yield "optimal bracketings", which induce a precedence-constraint scheduling problem. We investigate the inherent parallelism in the solutions and develop a new dynamic programming algorithm as a heuristic that incorporates the scheduling. To assess its performance, we benchmark it against the global optimum, which is computed via a branch-and-bound algorithm.
