Algorithm 1005: Fortran subroutines for reverse mode algorithmic differentiation of BLAS matrix operations

Kristjan Jonasson, Sven Sigurdsson, Hordur Freyr Yngvason, Petur Orri Ragnarsson, Pall Melsted

Research output: Contribution to journalArticlepeer-review

Abstract

A set of Fortran subroutines for reverse mode algorithmic (or automatic) differentiation of the basic linear algebra subprograms (BLAS) is presented. This is preceded by a description of the mathematical tools used to obtain the formulae of these derivatives, with emphasis on special matrices supported by the BLAS: triangular, symmetric, and band. All single and double precision BLAS derivatives have been implemented, together with the Cholesky factorization from Linear Algebra Package (LAPACK). The subroutines are written in Fortran 2003 with a Fortran 77 interface to allow use from C and C++, as well as dynamic languages such as R, Python, Matlab, and Octave. The subroutines are all implemented by calling BLAS, thereby attaining fast runtime. Timing results show derivative runtimes that are about twice those of the corresponding BLAS, in line with theory. The emphasis is on reverse mode because it is more important for the main application that we have in mind, numerical optimization. Two examples are presented, one dealing with the least squares modeling of groundwater, and the other dealing with the maximum likelihood estimation of the parameters of a vector autoregressive time series. The article contains comprehensive tables of formulae for the BLAS derivatives as well as for several non-BLAS matrix operations commonly used in optimization.

Original languageEnglish
Article number9
JournalACM Transactions on Mathematical Software
Volume46
Issue number1
DOIs
Publication statusPublished - Mar 2020

Bibliographical note

Publisher Copyright:
© 2020 Owner/Author.

Other keywords

  • AD
  • algorithmic differentiation
  • automatic differentiation
  • matrix operations
  • Numerical linear algebra
  • reverse mode
  • RMAD

Fingerprint

Dive into the research topics of 'Algorithm 1005: Fortran subroutines for reverse mode algorithmic differentiation of BLAS matrix operations'. Together they form a unique fingerprint.

Cite this