TorchTitan's recompute switch cut activation memory to 7.93 GiB — but only after fixing a case where recomputing used more memory than stashing
Making torch_remat work in TorchTitan

TorchTitan swapped aten-level selective activation checkpointing for torch_remat's named regions, and distributed training made it far trickier than replaying forward. Collectives had to become explicit before they could be wrapped, counters and nondeterministic top-k routing had to be pinned down during replay, and the loss of early stop meant trailing adds forced extra tensors to be stashed. Wrapping those adds in always-saved regions dropped activation memory from 8.18 to 7.93 GiB on Qwen3 MoE and 9.11 to 8.67 GiB on DeepSeek-V3 16B.
This is one of the rare cases where recompute (without our fix) requires more memory than save.