skip to main content
research-article

ADiJaC -- Automatic Differentiation of Java Classfiles

Published: 02 September 2016 Publication History

Abstract

This work presents the current design and implementation of ADiJaC, an automatic differentiation tool for Java classfiles. ADiJaC uses source transformation to generate derivative codes in both the forward and the reverse modes of automatic differentiation. We describe the overall architecture of the tool and present various details and examples for each of the two modes of differentiation. We emphasize the enhancements that have been made over previous versions of ADiJaC and illustrate their influence on the generality of the tool and on the performance of the generated derivative codes. The ADiJaC tool has been used to generate derivatives for a variety of problems, including real-world applications. We evaluate the performance of such codes and compare it to derivatives generated by Tapenade, a well-established automatic differentiation tool for Fortran and C/C++. Additionally, we present a more detailed performance analysis of a real-world application. Apart from being the only general-purpose automatic differentiation tool for Java bytecode, we argue that ADiJaC’s features and performance are comparable to those of similar mature tools for other programming languages such as C/C++ or Fortran.

References

[1]
Jason Abate, Christian H. Bischof, Alan Carle, and Lucas Roh. 1997. Algorithms and design for a second-order automatic differentiation module. In International Symposium on Symbolic and Algebraic Computing. SIAM, Philadelphia, PA, 149--155.
[2]
ADiJaC. 2016. ADiJaC Website. (2016). http://adijac.cs.pub.ro Accessed Jan 2016.
[3]
Ali-Reza Adl-Tabatabai, Michał Cierniak, Guei-Yuan Lueh, Vishesh M. Parikh, and James M. Stichnoth. 1998. Fast, effective code generation in a just-in-time java compiler. SIGPLAN Notices 33, 5 (1998), 280--290.
[4]
Autodiff. 2016. Community Portal for Automatic Differentiation. (2016). http://www.autodiff.org.
[5]
Brett M. Averick, Richard G. Carter, Jorge J. Moré, and Guo L. Xue. 1992. The Minpack-2 Test Problem Collection. Argonne National Laboratory, Mathematics and Computer Science Division, ANL/MCS-P153-0692.
[6]
Bradley M. Bell. 2016. A Package for Differentiation of C++ Algorithms. (2016). http://www.coin-or.org/CppAD/ Accessed January 19 2016.
[7]
Bradley M. Bell and James V. Burke. 2008. Algorithmic differentiation of implicit functions and optimal values. In Advances in Automatic Differentiation. Springer, 67--77.
[8]
Claus Bendtsen and Ole Stauning. 1996. FADBAD, a Flexible C++ Package for Automatic Differentiation. Technical Report 17. Department of Mathematical Modelling, Technical University of Denmark, Lyngby, Denmark.
[9]
Martin Berz, Christian H. Bischof, and George Corliss. 1996. Computational differentiation: Techniques, applications, and tools. In SIAM Proceedings in Applied Mathematics (1996).
[10]
Christian H. Bischof, Ali Bouaricha, Alan Carle, and Peyvand Khademi. 1996a. Efficient computation of gradients and Jacobians by transparent exploitation of sparsity in automatic differentiation. Optimization Methods and Software 7 (1996), 1--39.
[11]
Christian H. Bischof and H. Martin Bücker. 2000. Computing Derivatives of Computer Programs. Vol. 3. John von Neumann Institute for Computing. 315--327 pages.
[12]
Christian H. Bischof, H. Martin Bücker, Bruno Lang, Arno Rasch, and Andre Vehreschild. 2002. Combining source transformation and operator overloading techniques to compute derivatives for MATLAB programs. In Proceedings of the 2nd IEEE International Workshop on Source Code Analysis and Manipulation. IEEE Computer Society, Los Alamitos, CA, 65--72.
[13]
Christian H. Bischof, Alan Carle, George Corliss, and Andreas Griewank. 1992. ADIFOR: Automatic differentiation in a source translator environment. International Symposium on Symbolic and Algebraic Computing 92 (1992), 294--302.
[14]
Christian H. Bischof, Alan Carle, Peyvand Khademi, and Andrew Mauer. 1996b. ADIFOR 2.0: Automatic differentiation of Fortran 77 programs. IEEE Computational Science & Engineering 3, 3 (1996), 18--32.
[15]
Christian H. Bischof, Alan Carle, Peyvand Khademi, and Gordon Pusch. 1995. Automatic differentiation: Obtaining fast and reliable derivatives -- fast. In Control Problems in Industry. Springer, 1--16.
[16]
Christian H. Bischof and Andreas Griewank. 1992. ADIFOR: A fortran system for portable automatic differentiation. In Proceedings of the 4th AIAA/USAF/NASA/OAI Symposium on Multidisciplinary Analysis and Optimization (1992), 433--441.
[17]
Christian H. Bischof, Lucas Roh, and Andrew Mauer-Oats. 1997. ADIC: An extensible automatic differentiation tool for ANSI-C. Software: Practice and Experience 27 (1997), 1427--1456.
[18]
Ronald F. Boisvert, José Moreira, Michael Philippsen, and Roldan Pozo. 2001. Java and numerical computing. Computing in Science & Engineering 3, 2 (2001), 18--24.
[19]
H. Martin Bücker, George Corliss, Paul Hovland, Uwe Naumann, and Boyana Norris. 2006. Automatic Differentiation: Applications, Theory, and Implementations. Vol. 50. Springer.
[20]
J. Mark Bull, Lorna A. Smith, L. Pottage, and Robin Freeman. 2001. Benchmarking Java against C and Fortran for scientific applications. In Proceedings of the 2001 Joint ACM-ISCOPE Conference on Java Grande (JGI’01). ACM, 97--105.
[21]
Richard L. Burden and J. Douglas Faires. 2001. Numerical analysis. Brooks/Cole (2001).
[22]
Benjamin Dauvergne and Laurent Hascoët. 2006. The data-flow equations of checkpointing in reverse automatic differentiation. In Computational Science (ICCS’06). Springer, 566--573.
[23]
Johannes M. Dieterich and Bernd Hartke. 2010. OGOLEM: Global cluster structure optimization for arbitrary mixtures of flexible molecules. A multiscaling, object-oriented approach. Molecular Physics 108, 3--4 (2010), 279--291.
[24]
Arni Einarsson and Janus Nielsen. 2008. A survivor’s guide to Java program analysis with soot. BRICS (2008).
[25]
Vincent Fischer, Laurent Gerbaud, and Frédéric Wurtz. 2005. Using automatic code differentiation for optimization. IEEE Transactions on Magnetics 41, 5 (2005), 1812--1815.
[26]
Shaun A. Forth. 2006. An efficient overloaded implementation of forward mode automatic differentiation in MATLAB. ACM Transactions on Mathematical Software 32, 2 (2006), 195--222.
[27]
Assefaw Hadish Gebremedhin, Fredrik Manne, and Alex Pothen. 2005. What color is your Jacobian? Graph coloring for computing derivatives. SIAM Review 47, 4 (2005), 629--705.
[28]
Keith O. Geddes, Bruce W. Char, Gaston H. Gonnet, Benton L. Leong, Michael B. Monagan, and Stephen M. Watt. 1993. Maple V: Language Reference Manual. Springer.
[29]
Devendra Ghate and Michael B. Giles. 2007. Efficient hessian calculation using automatic differentiation. In 25th AIAA Applied Aerodynamics Conference 4059 (2007).
[30]
Ralf Giering and Thomas Kaminski. 1998a. Recipes for adjoint code construction. ACM Transactions on Mathematical Software 24, 4 (1998), 437--474.
[31]
Ralf Giering and Thomas Kaminski. 1998b. Using TAMC to generate efficient adjoint code: Comparison of automatically generated code for evaluation of first and second order derivatives to hand written code from the Minpack-2 collection. Automatic Differentiation for Adjoint Code Generation 3555 (1998), 31--37.
[32]
Ralf Giering and Thomas Kaminski. 2003. Applying TAF to generate efficient derivative code of fortran 77-95 programs. PAMM 2, 1 (2003), 54--57.
[33]
James Gosling, Bill Joy, Guy L. Steele, Gilad Bracha, and Alex Buckley. 2013. The Java Language Specification: Java SE 7 Ed. Prentice Hall.
[34]
Andreas Griewank. 1989. On automatic differentiation. In Mathematical Programming: Recent Developments and Applications. Kluwer Academic Publishers, 83--108.
[35]
Andreas Griewank. 2003. A mathematical view of automatic differentiation. Acta Numerica 12 (2003), 321--398.
[36]
Andreas Griewank, David Juedes, and Jean Utke. 1996. Algorithm 755: ADOL-C: A package for the automatic differentiation of algorithms written in C/C++. ACM Transactions on Mathematical Software 22, 2 (1996), 131--167.
[37]
Andreas Griewank and Andrea Walther. 2000. Algorithm 799: Revolve: An implementation of checkpointing for the reverse or adjoint mode of computational differentiation. ACM Transactions on Mathematical Software 26, 1 (2000), 19--45.
[38]
Andreas Griewank and Andrea Walther. 2008. Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation. SIAM.
[39]
Laurent Hascoët. 2009. Reversal strategies for adjoint algorithms. In From Semantics to Computer Science. Essays in Memory of Gilles Kahn. Cambridge University Press, 487--503.
[40]
Laurent Hascoët and Mauricio Araya-Polo. 2006. The adjoint data-flow analyses: Formalization, properties, and applications. In Automatic Differentiation: Applications, Theory, and Implementations. Springer, 135--146.
[41]
Laurent Hascoët, Uwe Naumann, and Valérie Pascual. 2005. “To be recorded” analysis in reverse-mode automatic differentiation. Future Generation Computer Systems 21, 8 (2005), 1401--1417.
[42]
Laurent Hascoët and Valérie Pascual. 2013. The tapenade automatic differentiation tool: Principles, model, and specification. ACM Transactions on Mathematical Software 39, 3 (2013), 20:1--20:43.
[43]
Michael A. Heroux, Roscoe A. Bartlett, Vicki E. Howle, Robert J. Hoekstra, Jonathan J. Hu, Tamara G. Kolda, Richard B. Lehoucq, Kevin R. Long, Roger P. Pawlowski, and Eric T. Phipps. 2005. An overview of the trilinos project. ACM Transactions on Mathematical Software 31, 3 (2005), 397--423.
[44]
Rich Hickey. 2008. The Clojure programming language. In Proceedings of the 2008 Symposium on Dynamic Languages. ACM.
[45]
Robin J. Hogan. 2014. Fast reverse-mode automatic differentiation using expression templates in c++. ACM Transactions on Mathematical Software 40, 4 (2014), 26:1--26:24.
[46]
JAutoDiff. 2014. JAutoDiff: A pure Java library for automatic differentiation. (2014). https://github.com/uniker9/JAutoDiff.
[47]
Michael Kofler. 1997. Maple: An Introduction and Reference. Addison-Wesley Longman Publishing Co.
[48]
Daniel Kwiecinski. 2016. Deriva. (2016). https://github.com/lambder/Deriva. Accessed January 2016.
[49]
Tim Lindholm, Frank Yellin, Gilad Bracha, and Alex Buckley. 2013. The Java Virtual Machine Specification. Addison-Wesley.
[50]
Roman E. Maeder. 1991. Programming in Mathematica. Addison-Wesley Longman Publishing Co.
[51]
Kyoko Makino and Martin Berz. 2006. Cosy infinity version 9. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors, and Associated Equipment 558, 1 (2006), 346--350.
[52]
Massimiliano Martinelli and Laurent Hascoët. 2008. Tangent-on-tangent vs. tangent-on-reverse for second differentiation of constrained functionals. In Advances in Automatic Differentiation. Springer, 151--161.
[53]
Michael Monagan and René R. Rodoni. 1996. An implementation of the forward and reverse mode in maple. In Computational Differentiation: Techniques, Applications, and Tools. SIAM, Philadelphia, 353--362.
[54]
María E. Portillo Montiel, Nelson Arapé, and Pirela Morillo. 2013. Biblioteca de diferenciación automática para la máquina virtual de java automatic differentiation library for the java virtual machine. Revista Tecnocientífica Universidad Rafael Urdaneta 5 (2013), 11--25.
[55]
Jose E. Moreira, Samuel P. Midkiff, Manish Gupta, Pedro V. Artigas, Marc Snir, and Richard D. Lawrence. 2000. Java programming for high-performance numerical computing. IBM Systems Journal 39, 1 (2000), 21--56.
[56]
Sri Hari Krishna Narayanan, Boyana Norris, and Beata Winnicka. 2010. ADIC2: Development of a component source transformation system for differentiating c and c++. Procedia Computer Science 1, 1 (2010), 1845--1853.
[57]
Uwe Naumann. 2002. Reducing the memory requirement in reverse mode automatic differentiation by solving TBR flow equations. In Computational Science (ICCS’02), 1039--1048.
[58]
Uwe Naumann. 2008. Optimal jacobian accumulation is np-complete. Mathematical Programming 112, 2 (2008), 427--441.
[59]
Uwe Naumann. 2011. The Art of Differentiating Computer Programs: An Introduction to Algorithmic Differentiation. SIAM.
[60]
Uwe Naumann, Jean Utke, Andrew Lyons, and Michael Fagan. 2004. Control flow reversal for adjoint code generation. In 4th IEEE International Workshop on Source Code Analysis and Manipulation. IEEE, 55--64.
[61]
Martin Odersky, Philippe Altherr, Vincent Cremet, Burak Emir, Stphane Micheloud, Nikolay Mihaylov, Michel Schinz, Erik Stenman, and Matthias Zenger. 2016. The Scala language specification. (2016). http://www.scala-lang.org/files/archive/spec/2.11/. Accessed January 19, 2016.
[62]
Valérie Pascual and Laurent Hascoët. 2008. TAPENADE for C. In Advances in Automatic Differentiation. Springer, 199--209.
[63]
Phuong Pham-Quang and Benoit Delinchant. 2012. Java automatic differentiation tool using virtual operator overloading. In Recent Advances in Algorithmic Differentiation. Springer, 241--250.
[64]
Louis B. Rall. 1981. Automatic Differentiation: Techniques and Applications. Lecture Notes in Computer Science, Vol. 120. Springer, Berlin.
[65]
Michael I. Schwartzbach. 2008. Lecture notes on static analysis. University of Aarhus, Denmark.
[66]
Dimitri Shiriaev and Andreas Griewank. 1996. ADOL-F: Automatic differentiation of fortran codes. In Computational Differentiation: Techniques, Applications, and Tools. 375--384.
[67]
Rune Skjelvik. 2001. Automatic differentiation in Java. Department of Informatics, University of Bergen, Norway.
[68]
Emil-Ioan Sluşanschi. 2008. Algorithmic differentiation of Java programs. Universitätsbibliothek, RWTH-Aachen University.
[69]
Robert F. Stark, Egon Borger, and Joachim Schmid. 2001. Java and the Java Virtual Machine: Definition, Verification, Validation. Springer-Verlag New York, Secaucus, NJ.
[70]
Christian W. Straka. 2005. ADF95: Tool for automatic differentiation of a fortran code designed for large numbers of independent variables. Computer Physics Communications 168, 2 (2005), 123--139.
[71]
Jean Utke, Uwe Naumann, Mike Fagan, Nathan Tallent, Michelle Strout, Patrick Heimbach, Chris Hill, and Carl Wunsch. 2008. OpenAD/F: A modular open-source tool for automatic differentiation of fortran codes. ACM Transactions on Mathematical Software 34, 4 (2008), 18.
[72]
Raja Vallée-Rai, Phong Co, Etienne Gagnon, Laurie Hendren, Patrick Lam, and Vijay Sundaresan. 1999. Soot -- A Java bytecode optimization framework. In Proceedings of the 1999 Conference of the Centre for Advanced Studies on Collaborative Research (1999), 13.
[73]
Bill Venners. 1996. Inside the Java Virtual Machine. McGraw-Hill.
[74]
Arun Verma. 1999. ADMAT: Automatic differentiation in MATLAB using object oriented methods. In SIAM Interdisciplinary Workshop on Object Oriented Methods for Interoperability (1999), 174--183.
[75]
Johannes Willkomm, Christian H. Bischof, and H. Martin Bücker. 2014. A new user interface for ADiMat: Toward accurate and efficient derivatives of MATLAB programs with ease of use. International Journal of Computational Science and Engineering 9, 5/6 (2014), 408--415.
[76]
Johannes Willkomm, Christian H. Bischof, and H. Martin Bücker. 2015. RIOS: Efficient I/O in reverse direction. Software: Practice and Experience 45, 10 (2015), 1399--1427.
[77]
Stephen Wolfram. 1991. Mathematica. Addison-Wesley.

Cited By

View all
  • (2023)On the correctness of automatic differentiation for neural networks with machine-representable parametersProceedings of the 40th International Conference on Machine Learning10.5555/3618408.3619197(19094-19140)Online publication date: 23-Jul-2023
  • (2023)Data-flow Reversal and Garbage CollectionACM Transactions on Mathematical Software10.1145/362753750:1(1-20)Online publication date: 18-Nov-2023
  • (2023)Towards Differentiable Agent-Based SimulationACM Transactions on Modeling and Computer Simulation10.1145/356581032:4(1-26)Online publication date: 11-Jan-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

ACM Transactions on Mathematical Software  Volume 43, Issue 2
June 2017
200 pages
ISSN:0098-3500
EISSN:1557-7295
DOI:10.1145/2988256
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 02 September 2016
Accepted: 01 March 2016
Revised: 01 February 2016
Received: 01 August 2015
Published in TOMS Volume 43, Issue 2

Permissions

Request permissions for this article.

Check for updates

Author Tag

  1. Source transformation

Qualifiers

  • Research-article
  • Research
  • Refereed

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)21
  • Downloads (Last 6 weeks)4
Reflects downloads up to 21 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2023)On the correctness of automatic differentiation for neural networks with machine-representable parametersProceedings of the 40th International Conference on Machine Learning10.5555/3618408.3619197(19094-19140)Online publication date: 23-Jul-2023
  • (2023)Data-flow Reversal and Garbage CollectionACM Transactions on Mathematical Software10.1145/362753750:1(1-20)Online publication date: 18-Nov-2023
  • (2023)Towards Differentiable Agent-Based SimulationACM Transactions on Modeling and Computer Simulation10.1145/356581032:4(1-26)Online publication date: 11-Jan-2023
  • (2021)Differentiable Agent-Based Simulation for Gradient-Guided Simulation-Based OptimizationProceedings of the 2021 ACM SIGSIM Conference on Principles of Advanced Discrete Simulation10.1145/3437959.3459261(27-38)Online publication date: 21-May-2021
  • (2020)Dual Numbers and Automatic Differentiation to Efficiently Compute Velocities and AccelerationsActa Applicandae Mathematicae: an international survey journal on applying mathematics and mathematical applications10.1007/s10440-020-00351-9170:1(649-659)Online publication date: 1-Dec-2020
  • (2018)Fast Automatic Differentiation for Large Scale Bundle AdjustmentIEEE Access10.1109/ACCESS.2018.28121736(11146-11153)Online publication date: 2018
  • (2017)Automatic differentiation in machine learningThe Journal of Machine Learning Research10.5555/3122009.324201018:1(5595-5637)Online publication date: 1-Jan-2017

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy