Dynamic Automatic Differentiation of GPU Broadcast Kernels

Jarrett Revels, Tim Besard, Valentin Churavy, Bjorn De Sutter, Juan Pablo Vielma
10/18/2018
cs.MS

Official code: JuliaDiff/Capstan.jl (56 stars, Julia, last commit 2023-03-14).

Abstract

We show how forward-mode automatic differentiation (AD) can be employed within larger reverse-mode computations to dynamically differentiate broadcast operations in a GPU-friendly manner. Our technique fully exploits the broadcast Jacobian's inherent sparsity structure, and unlike a pure reverse-mode approach, this "mixed-mode" approach does not require a backwards pass over the broadcasted operation's subgraph, obviating the need for several reverse-mode-specific programmability restrictions on user-authored broadcast operations.

Show full abstract

Most notably, this approach allows broadcast fusion in primal code despite the presence of data-dependent control flow. We discuss an experiment in which a Julia implementation of our technique outperformed pure reverse-mode TensorFlow and Julia implementations for differentiating through broadcast operations within an HM-LSTM cell update calculation.

View on arXivView PDF

Code Implementations(1)

A Cassette-based automatic differentiation package for the Julia language

566JuliaDec 28, 20173 years agoNOASSERTION

Similar Papers

Cite this paper

@article{revels2018dynamic,
  title  = {Dynamic Automatic Differentiation of GPU Broadcast Kernels},
  author = {Jarrett Revels and Tim Besard and Valentin Churavy and Bjorn De Sutter and Juan Pablo Vielma},
  year   = {2018},
  eprint = {1810.08297},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1810.08297}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1810.08297.svg)](https://codeofpaper.com/paper/1810.08297)

Discussion