Skip to main content
QUICK REVIEW

[Paper Review] Checkmate: Breaking the Memory Wall with Optimal Tensor Rematerialization

Paras Jain, Ajay N. Jain|arXiv (Cornell University)|Oct 7, 2019
Parallel Computing and Optimization TechniquesComputer Science51 citations
TL;DR

The paper formulates tensor rematerialization as a constrained optimization problem and presents Checkmate, which computes optimal rematerialization schedules via MILP or near-optimal LP rounding to reduce training memory with minimal overhead, enabling larger input sizes.

ABSTRACT

We formalize the problem of trading-off DNN training time and memory requirements as the tensor rematerialization optimization problem, a generalization of prior checkpointing strategies. We introduce Checkmate, a system that solves for optimal rematerialization schedules in reasonable times (under an hour) using off-the-shelf MILP solvers or near-optimal schedules with an approximation algorithm, then uses these schedules to accelerate millions of training iterations. Our method scales to complex, realistic architectures and is hardware-aware through the use of accelerator-specific, profile-based cost models. In addition to reducing training cost, Checkmate enables real-world networks to be trained with up to 5.1x larger input sizes. Checkmate is an open-source project, available at https://github.com/parasj/checkmate.

Motivation & Objective

  • Formalize tensor rematerialization as a memory-constrained optimization problem for arbitrary DAGs.
  • Develop an MILP formulation that minimizes training time under a memory budget.
  • Provide a fast approximation via LP rounding to scale to realistic networks.
  • Make Checkmate hardware- and cost-aware by profiling on target accelerators.
  • Deliver an open-source system to improve practical DNN training efficiency.

Proposed method

  • Model the training DAG as a memory-costed computation graph with memory M_v and cost C_v per node.
  • Unroll execution into T stages and define binary variables R_t,i and S_t,i to represent recomputation and checkpoint retention.
  • Formulate a memory-constrained MILP (and linearized variants) to minimize total compute cost under M_budget.
  • Introduce memory accounting U_t,k and deallocation indicators Free_t,i,k to capture dynamic memory usage; linearize polynomial constraints via Boolean reformulations.
  • Use frontier-advancing stage partitioning to reduce the solution space and improve MILP solvers’ performance.
  • Provide a two-phase LP-based rounding algorithm to obtain near-optimal integral solutions when exact MILP is intractable.

Experimental results

Research questions

  • RQ1How can tensor rematerialization be formulated as an optimization problem under memory constraints for arbitrary neural network graphs?
  • RQ2What is the trade-off between memory savings and computational overhead when applying optimal rematerialization?
  • RQ3Can an LP-based approximation method yield near-optimal schedules for complex architectures within practical time limits?
  • RQ4How well does Checkmate scale to realistic networks and hardware profiles?
  • RQ5Does optimal rematerialization enable training with larger inputs or batch sizes compared to prior methods?

Key findings

  • Optimal rematerialization reduces memory usage and enables larger input sizes with modest overhead across image classification and segmentation architectures.
  • The approach supports arbitrary DAGs and nonuniform layer costs, outperforming baselines on memory efficiency and computation time.
  • Checkmate enables up to 5.1x larger input sizes at the same accelerator memory.
  • A complete MILP can solve moderate networks within under an hour using standard solvers, and frontier-advancing partitions dramatically speed up solving.
  • Two-phase rounding provides near-optimal integral solutions in polynomial time for many benchmarks.
  • The system is implemented in TensorFlow 2.0 and is open-source (GitHub: parasj/checkmate).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.