Skip to content
nonconvexcard

Optimal checkpointing frequency

ProofIntermediate⏱ 30 minFine-Tuninggradient checkpointingoptimisation

Problem

  1. Prove that storing every kk-th layer gives peak activation storage L/k+kL/k + k and that k⋆=Lk^\star=\sqrt L minimises it.
  2. Compute the saving for L=32L = 32 and L=80L = 80.
  3. Suppose recomputation costs a fraction θ\theta of a full training step. Write total cost as a function of kk under a memory constraint and say when checkpointing is not worth it.

Write a complete argument. Every inequality you use should be one you could state precisely.

Solution

Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.

Related problems

All problems
SolvedProblemFieldTypeDifficultyTime
When activations dominateFine-TuningNumericalBeginner30 min
Will this fine-tune fit?Fine-TuningNumericalBeginner30 min
Choosing the draft lengthLLM OpsNumericalAdvanced30 min
Implement gradient descent and verify all four rates runOptimizationCodingAdvanced3 hours
Optimal clipping for a Laplace-distributed tensorQuantizationProofAdvanced1 hour