Graph-based Reversible Evaluation and Tangents Library

RESOURCE

Abstract

GRETL is a C++ library for evaluation, re-evaluation and algorithmic differentiation of functional operations on an arbitrary computational graph with limited memory usage. Similar to popular machine learning frameworks in Python, like PyTorch and JAX, it tracks and stores both operations and output data as functions are evaluated. Once this composition of functions is built up, the entire chain of operations can be back propagated to compute sensitivities of the final result with respect to any number of inputs. In contrast to most machine learning applications, memory usage becomes the bottleneck for back propagation in many physics applications, especially for time-dependent PDEs. Dynamic check pointing becomes essential. An important distinguishing feature of GRETL is its ability to limit the maximum memory usage by automatically dynamic checkpointing the data output for each graph operation (see Wang, Moin, Iaccarino, 2009). During backpropagation, parts of the graph that are no longer in memory are automatically re-evaluated from upstream checkpointed states as needed for derivative sensitivity calculations (or more precisely, for vector-Jacobian products). GRETL is particularly beneficial for applications, such as coupled multi-physics, where deriving adjoint-based sensitivities and managing checkpoint memory across modules becomes onerous. Cases which can be readily handled by the GRETL library include:  More>>
Developers:
Tupek, Michael [1]
  1. Lawrence Livermore National Laboratory (LLNL), Livermore, CA (United States)
Release Date:
2025-09-26
Project Type:
Open Source, Publicly Available Repository
Software Type:
Scientific
Version:
0.0.1
Licenses:
BSD 3-clause "New" or "Revised" License
Sponsoring Org.:
Code ID:
173099
Site Accession Number:
LLNL-CODE-2013480
Research Org.:
Lawrence Livermore National Laboratory (LLNL), Livermore, CA (United States)
Country of Origin:
United States

RESOURCE

Citation Formats

Tupek, Michael R. Graph-based Reversible Evaluation and Tangents Library. Computer Software. https://github.com/LLNL/gretl. USDOE National Nuclear Security Administration (NNSA). 26 Sep. 2025. Web. doi:10.11578/dc.20260112.3.
Tupek, Michael R. (2025, September 26). Graph-based Reversible Evaluation and Tangents Library. [Computer software]. https://github.com/LLNL/gretl. https://doi.org/10.11578/dc.20260112.3.
Tupek, Michael R. "Graph-based Reversible Evaluation and Tangents Library." Computer software. September 26, 2025. https://github.com/LLNL/gretl. https://doi.org/10.11578/dc.20260112.3.
@misc{ doecode_173099,
title = {Graph-based Reversible Evaluation and Tangents Library},
author = {Tupek, Michael R.},
abstractNote = {GRETL is a C++ library for evaluation, re-evaluation and algorithmic differentiation of functional operations on an arbitrary computational graph with limited memory usage. Similar to popular machine learning frameworks in Python, like PyTorch and JAX, it tracks and stores both operations and output data as functions are evaluated. Once this composition of functions is built up, the entire chain of operations can be back propagated to compute sensitivities of the final result with respect to any number of inputs. In contrast to most machine learning applications, memory usage becomes the bottleneck for back propagation in many physics applications, especially for time-dependent PDEs. Dynamic check pointing becomes essential. An important distinguishing feature of GRETL is its ability to limit the maximum memory usage by automatically dynamic checkpointing the data output for each graph operation (see Wang, Moin, Iaccarino, 2009). During backpropagation, parts of the graph that are no longer in memory are automatically re-evaluated from upstream checkpointed states as needed for derivative sensitivity calculations (or more precisely, for vector-Jacobian products). GRETL is particularly beneficial for applications, such as coupled multi-physics, where deriving adjoint-based sensitivities and managing checkpoint memory across modules becomes onerous. Cases which can be readily handled by the GRETL library include: different time-integration algorithms per physics (e.g., coupled predictor-corrector algorithms, IMEX, etc.), sub-cycling, asynchronous integrators, state dependent timestep sizes, iterative solvers and coupling algorithms, controller algorithms, and more.},
doi = {10.11578/dc.20260112.3},
url = {https://doi.org/10.11578/dc.20260112.3},
howpublished = {[Computer Software] \url{https://doi.org/10.11578/dc.20260112.3}},
year = {2025},
month = {sep}
}