about
Instead of Rewriting Foreign Code for ML Automatically Synthesize Fast Gradients (arxiv.org)
3 points by matt_d on Oct 8, 2020 | hide | past | pdf | discuss on HN

In plain words: A compiler add-on automatically builds gradients for ordinary code in languages like C, C++, and Fortran, so it plugs straight into machine-learning tools without being rewritten. Because it works after the compiler speeds up the code, it runs 4.5 times faster than differentiating beforehand.

Abstract · Instead of Rewriting Foreign Code for Machine Learning, Automatically Synthesize Fast Gradients

Applying differentiable programming techniques and machine learning algorithms to foreign programs requires developers to either rewrite their code in a machine learning framework, or otherwise provide derivatives of the foreign code. This paper presents Enzyme, a high-performance automatic differentiation (AD) compiler plugin for the LLVM compiler framework capable of synthesizing gradients of statically analyzable programs expressed in the LLVM intermediate representation (IR). Enzyme synthesizes gradients for programs written in any language whose compiler targets LLVM IR including C, C++, Fortran, Julia, Rust, Swift, MLIR, etc., thereby providing native AD capabilities in these languages. Unlike traditional source-to-source and operator-overloading tools, Enzyme performs AD on optimized IR. On a machine-learning focused benchmark suite including Microsoft's ADBench, AD on optimized IR achieves a geometric mean speedup of 4.5x over AD on IR before optimization allowing Enzyme to achieve state-of-the-art performance. Packaging Enzyme for PyTorch and TensorFlow provides convenient access to gradients of foreign code with state-of-the art performance, enabling foreign code to be directly incorporated into existing machine learning workflows.

William S. Moses, Valentin Churavy
arXiv:2010.01709 · cs.MS, cs.AI, cs.LG, cs.PF, cs.PL · submitted Oct 4, 2020
abstract · pdf · html · To be published in NeurIPS 2020

add comment on HN