AD in Fortran, Part 2: Implementation via Prepreprocessor
Alexey Radul, Barak A. Pearlmutter, Jeffrey Mark Siskind

TL;DR
This paper presents a prepreprocessor implementation for Farfel Fortran AD extensions, enabling seamless integration of forward and reverse AD into Fortran programs by generating code compatible with existing AD tools.
Contribution
It introduces a prepreprocessor that transforms Farfel AD constructs into subprograms suitable for existing AD preprocessors, enhancing flexibility and modularity.
Findings
Enables nested AD in Fortran with existing tools
Improves modularity and ease of use for AD in Fortran
Facilitates integration of AD into Fortran programming workflow
Abstract
We describe an implementation of the Farfel Fortran AD extensions. These extensions integrate forward and reverse AD directly into the programming model, with attendant benefits to flexibility, modularity, and ease of use. The implementation we describe is a "prepreprocessor" that generates input to existing Fortran-based AD tools. In essence, blocks of code which are targeted for AD by Farfel constructs are put into subprograms which capture their lexical variable context, and these are closure-converted into top-level subprograms and specialized to eliminate EXTERNAL arguments, rendering them amenable to existing AD preprocessors, which are then invoked, possibly repeatedly if the AD is nested.
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.
