[Paper Review] Enabling user-driven Checkpointing strategies in Reverse-mode Automatic Differentiation
This paper introduces user-driven checkpointing in Tapenade, an Automatic Differentiation tool, enabling selective application of checkpointing to reduce memory usage and execution time in reverse-mode AD. By allowing users to choose which procedures to differentiate in split mode (without checkpointing), the method achieves up to 35% memory reduction and 90% execution time improvement in real scientific codes, providing empirical insights for future optimal automatic checkpointing strategies.
This paper presents a new functionality of the Automatic Differentiation (AD) tool Tapenade. Tapenade generates adjoint codes which are widely used for optimization or inverse problems. Unfortunately, for large applications the adjoint code demands a great deal of memory, because it needs to store a large set of intermediates values. To cope with that problem, Tapenade implements a sub-optimal version of a technique called checkpointing, which is a trade-off between storage and recomputation. Our long-term goal is to provide an optimal checkpointing strategy for every code, not yet achieved by any AD tool. Towards that goal, we first introduce modifications in Tapenade in order to give the user the choice to select the checkpointing strategy most suitable for their code. Second, we conduct experiments in real-size scientific codes in order to gather hints that help us to deduce an optimal checkpointing strategy. Some of the experimental results show memory savings up to 35% and execution time up to 90%.
Motivation & Objective
- To address the high memory consumption of reverse-mode AD in large scientific codes by enabling user control over checkpointing placement.
- To move beyond sub-optimal, default checkpointing at every procedure call, which often degrades performance.
- To empirically identify effective checkpointing strategies through experiments on real industrial codes.
- To gather data and heuristics for developing a future fully automatic, optimal checkpointing strategy in Tapenade.
- To improve the performance of adjoint codes by balancing memory usage and recomputation cost through user-guided checkpointing.
Proposed method
- Extending Tapenade to support a new 'split mode' where procedures are differentiated independently in forward and backward sweeps, avoiding checkpointing.
- Modifying existing data-flow analyses—adjoint-liveness and TBR analysis—to correctly handle split-mode differentiation.
- Applying user-selected checkpointing strategies to real scientific codes, including CFD and geophysical simulation applications.
- Measuring memory usage and execution time across different checkpointing configurations to compare performance.
- Using experimental results to derive heuristics for optimal checkpointing placement, such as prioritizing short, frequently called procedures.
- Analyzing tape and snapshot sizes, as well as PUSH/POP overhead, to understand performance bottlenecks in checkpointing.
Experimental results
Research questions
- RQ1What are the performance trade-offs between checkpointing every procedure call versus selective checkpointing in reverse-mode AD?
- RQ2How does user-driven checkpointing impact memory consumption and execution time in real scientific codes?
- RQ3Which code characteristics (e.g., execution time, data size) determine optimal checkpointing placement?
- RQ4Can experimental results from real codes inform the design of a general-purpose automatic checkpointing strategy?
- RQ5Why do time gains from multiple split-mode procedures not always add up linearly, and what does this imply for optimization models?
Key findings
- The Split-All strategy—checkpointing all procedures—resulted in a 100x slowdown in execution time for the stics benchmark due to excessive tape and snapshot management overhead.
- In the stics experiment, differentiating only densirac, croira, and onebigloop in split mode reduced the execution time ratio to about 7, approaching typical AD tool performance.
- Memory savings of up to 35% were achieved by applying checkpointing selectively to long-running or memory-intensive procedures.
- Execution time improvements of up to 90% were observed when checkpointing was applied only to procedures with high computational cost and large intermediate data.
- Tape sizes were significantly smaller than snapshot sizes for certain subroutines, making split mode beneficial with no memory cost and substantial time gains.
- The non-additive nature of time gains across multiple split-mode procedures suggests complex interactions between checkpointing overhead and data movement, necessitating iterative performance modeling.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.