  Leveraging spatial sparsity has become a popular approach to accelerate 3D
computer graphics applications. Spatially sparse data structures and efficient
sparse kernels (such as parallel stencil operations on active voxels), are key
to achieve high performance. Existing work focuses on improving performance
within a single sparse computational kernel. We show that a system that looks
beyond a single kernel, plus additional domain-specific sparse data structure
analysis, opens up exciting new space for optimizing sparse computations.
Specifically, we propose a domain-specific data-flow graph model of imperative
and sparse computation programs, which describes kernel relationships and
enables easy analysis and optimization. Combined with an asynchronous execution
engine that exposes a wide window of kernels, the inter-kernel optimizer can
then perform effective sparse computation optimizations, such as eliminating
unnecessary voxel list generations and removing voxel activation checks. These
domain-specific optimizations further make way for classical general-purpose
optimizations that are originally challenging to directly apply to computations
with sparse data structures. Without any computational code modification, our
new system leads to $4.02\times$ fewer kernel launches and $1.87\times$ speed
up on our GPU benchmarks, including computations on Eulerian grids, Lagrangian
particles, meshes, and automatic differentiation.
