Using Rewrite Strategies for Efficient Functional Automatic Differentiation
Timon B\"ohler, David Richter, Mira Mezini

TL;DR
This paper presents a novel approach to implementing efficient functional automatic differentiation using rewrite rules and strategy combinators, combining correctness with optimized performance in a functional array language.
Contribution
It introduces a method to optimize dual number-based AD in functional languages through rewrite strategies, enabling fine-grained control over optimization scheduling.
Findings
Preliminary micro-benchmark shows viability of the approach.
Demonstrates the potential for combining elegance and efficiency in functional AD.
Uses rewrite rules and strategies for optimization control.
Abstract
Automatic Differentiation (AD) has become a dominant technique in ML. AD frameworks have first been implemented for imperative languages using tapes. Meanwhile, functional implementations of AD have been developed, often based on dual numbers, which are close to the formal specification of differentiation and hence easier to prove correct. But these papers have focussed on correctness not efficiency. Recently, it was shown how an approach using dual numbers could be made efficient through the right optimizations. Optimizations are highly dependent on order, as one optimization can enable another. It can therefore be useful to have fine-grained control over the scheduling of optimizations. One method expresses compiler optimizations as rewrite rules, whose application can be combined and controlled using strategy languages. Previous work describes the use of term rewriting and strategies…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
