Sparser, Better, Faster, Stronger: Sparsity Detection for Efficient Automatic Differentiation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Hill, Adrian, Dalle, Guillaume
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915335817396224
author Hill, Adrian
Dalle, Guillaume
author_facet Hill, Adrian
Dalle, Guillaume
contents From implicit differentiation to probabilistic modeling, Jacobian and Hessian matrices have many potential use cases in Machine Learning (ML), but they are viewed as computationally prohibitive. Fortunately, these matrices often exhibit sparsity, which can be leveraged to speed up the process of Automatic Differentiation (AD). This paper presents advances in sparsity detection, previously the performance bottleneck of Automatic Sparse Differentiation (ASD). Our implementation of sparsity detection is based on operator overloading, able to detect both local and global sparsity patterns, and supports flexible index set representations. It is fully automatic and requires no modification of user code, making it compatible with existing ML codebases. Most importantly, it is highly performant, unlocking Jacobians and Hessians at scales where they were considered too expensive to compute. On real-world problems from scientific ML, graph neural networks and optimization, we show significant speed-ups of up to three orders of magnitude. Notably, using our sparsity detection system, ASD outperforms standard AD for one-off computations, without amortization of either sparsity detection or matrix coloring.
format Preprint
id arxiv_https___arxiv_org_abs_2501_17737
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Sparser, Better, Faster, Stronger: Sparsity Detection for Efficient Automatic Differentiation
Hill, Adrian
Dalle, Guillaume
Machine Learning
Mathematical Software
From implicit differentiation to probabilistic modeling, Jacobian and Hessian matrices have many potential use cases in Machine Learning (ML), but they are viewed as computationally prohibitive. Fortunately, these matrices often exhibit sparsity, which can be leveraged to speed up the process of Automatic Differentiation (AD). This paper presents advances in sparsity detection, previously the performance bottleneck of Automatic Sparse Differentiation (ASD). Our implementation of sparsity detection is based on operator overloading, able to detect both local and global sparsity patterns, and supports flexible index set representations. It is fully automatic and requires no modification of user code, making it compatible with existing ML codebases. Most importantly, it is highly performant, unlocking Jacobians and Hessians at scales where they were considered too expensive to compute. On real-world problems from scientific ML, graph neural networks and optimization, we show significant speed-ups of up to three orders of magnitude. Notably, using our sparsity detection system, ASD outperforms standard AD for one-off computations, without amortization of either sparsity detection or matrix coloring.
title Sparser, Better, Faster, Stronger: Sparsity Detection for Efficient Automatic Differentiation
topic Machine Learning
Mathematical Software
url https://arxiv.org/abs/2501.17737