HackerPapers

arXiv:2008.11256cs.PL

Differentiating a Tensor Language

Gilbert Bernstein, Michael Mara, Tzu-Mao Li, Dougal Maclaurin, Jonathan Ragan-Kelley

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

How does one compile derivatives of tensor programs, such that the resulting code is purely functional (hence easier to optimize and parallelize) and provably efficient relative to the original program? We show that naively differentiating tensor code---as done in popular systems like Tensorflow and PyTorch---can cause asymptotic slowdowns in pathological cases, violating the Cheap Gradients Principle. However, all existing automatic differentiation methods that guarantee this principle (for variable size data) do so by relying on += mutation through aliases/pointers---which complicates downstream optimization. We provide the first purely functional, provably efficient, adjoint/reverse-mode derivatives of array/tensor code by explicitly accounting for sparsity. We do this by focusing on the indicator function from Iverson's APL. We also introduce a new "Tensor SSA" normal form and a new derivation of reverse-mode automatic differentiation based on the universal property of inner-products.

arXiv comments
In-progress Draft; unsubmitted
Journal reference
DOI
Subjects
cs.PLProgramming Languages cs.GRGraphics

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Feb 2022 to Feb 2022.

Comments linking this paper, per year.

Discussed in comments1 thread

    • Shame that reporting for "normal" earthlings is unlikely to include a few sample lines of code of this new language. Draft paper: https://arxiv.org/pdf/2008.11256.pdf Sample code (looks like a DSL embedded in Python)…

      jll29View on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.