Peak-Memory Schedules You Can Trust: Exact Realization, Certified Optimality, and the Limits of Recomputation for Inference
TL;DR - This paper presents a compiler-level method for realizing and certifying peak-memory-optimal inference schedules without added latency or numerical changes. It also characterizes when selective recomputation can reduce memory beyond the optimal operator ordering.
- Regenerating code from an improved operator order proved unreliable in PyTorch Inductor, often missing predicted memory peaks and sometimes worsening memory use or changing GPU results.
- Reordering statements within the generated program achieved modeled peaks exactly and preserved bitwise-identical CPU outputs when allocation was history-independent; GPU caching allocators violate this condition.
- New minimum-cut-based lower bounds certified optimal schedules for 94% of held-out wrapper graphs and all 16 tested microcontroller-class models in under one second.
- Reordering cut DeepLabV3 peak memory by 10.0%, while selective recomputation reduced ReDimNet peaks by 5.2–6.1% with under 0.4% additional MACs.