Using Rewrite Strategies for Efficient Functional Automatic Differentiation

被引:0
|
作者
Boehler, Timon [1 ]
Richter, David [1 ]
Mezini, Mira [1 ,2 ]
机构
[1] Tech Univ Darmstadt, Darmstadt, Germany
[2] Hessian AI, Darmstadt, Germany
关键词
differentiable programming; domain-specific language; optimization; term rewriting;
D O I
10.1145/3605156.3606456
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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 to generate high-performance code in a compiler for a functional language. In this work, we implement dual numbers AD in a functional array programming language using rewrite rules and strategy combinators for optimization. We aim to combine the elegance of differentiation using dual numbers with a succinct expression of the optimization schedule using a strategy language. We give preliminary evidence suggesting the viability of the approach on a micro-benchmark.
引用
收藏
页码:51 / 57
页数:7
相关论文
共 50 条
  • [1] The efficient computation of structured gradients using automatic differentiation
    Coleman, TF
    Jonsson, GF
    SIAM JOURNAL ON SCIENTIFIC COMPUTING, 1999, 20 (04): : 1430 - 1437
  • [2] Efficient computation of structured gradients using automatic differentiation
    Coleman, Thomas F.
    Jonsson, Gudbjorn F.
    SIAM Journal on Scientific Computing, 20 (04): : 1430 - 1437
  • [3] Using Rewrite Strategies for Testing BUpL Agents
    Astefanoaei, Lacramioara
    de Boer, Frank S.
    van Riemsdijk, M. Birna
    LOGIC-BASED PROGRAM SYNTHESIS AND TRANSFORMATION, 2010, 6037 : 143 - +
  • [4] COMPLETENESS OF REWRITE RULES AND REWRITE STRATEGIES FOR FP
    HALPERN, JY
    WILLIAMS, JH
    WIMMERS, EL
    JOURNAL OF THE ACM, 1990, 37 (01) : 86 - 143
  • [5] ON THE MEMORY EFFICIENT AUTOMATIC DIFFERENTIATION
    SHIRIAEV, D
    ZEITSCHRIFT FUR ANGEWANDTE MATHEMATIK UND MECHANIK, 1992, 72 (06): : T632 - T634
  • [6] Efficient Computation of Sparse Hessians Using Coloring and Automatic Differentiation
    Gebremedhin, Assefaw H.
    Tarafdar, Arijit
    Pothen, Alex
    Walther, Andrea
    INFORMS JOURNAL ON COMPUTING, 2009, 21 (02) : 209 - 223
  • [7] On efficient solutions to the continuous sensitivity equation using automatic differentiation
    Borggaard, J
    Verma, A
    SIAM JOURNAL ON SCIENTIFIC COMPUTING, 2000, 22 (01): : 39 - 62
  • [8] The efficient computation of sparse jacobian matrices using automatic differentiation
    Coleman, TF
    Verma, A
    SIAM JOURNAL ON SCIENTIFIC COMPUTING, 1998, 19 (04): : 1210 - 1233
  • [9] Efficient selection of hyperparameters in large Bayesian VARs using automatic differentiation
    Chan, Joshua C. C.
    Jacobi, Liana
    Zhu, Dan
    JOURNAL OF FORECASTING, 2020, 39 (06) : 934 - 943
  • [10] Efficient Hessian Calculations Using Automatic Differentiation and the Adjoint Method with Applications
    Rumpfkeil, Markus P.
    Mavriplis, Dimitri J.
    AIAA JOURNAL, 2010, 48 (10) : 2406 - 2417