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

Original title: Making torch_remat work in TorchTitan

> Hacker News story 50584268 · language: en · submitted 2026-11-21
> Web version: https://zeli.app/story/50584268
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 6 · by [matt_d](<https://news.ycombinator.com/user?id=matt_d>) · 💬 0
[original](<https://docs.pytorch.org/devlogs/distributed/2026-11-19-torch-remat-in-torchtitan/>) · [HN discussion](<https://news.ycombinator.com/item?id=50584268>)

## Summary

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.

## Key quote

> This is one of the rare cases where recompute (without our fix) requires more memory than save.

---

## Cite

- Page: https://zeli.app/story/50584268
- Date: 2026-11-21
- Source: docs.pytorch.org (https://docs.pytorch.org/devlogs/distributed/2026-11-19-torch-remat-in-torchtitan/)
- Hacker News: https://news.ycombinator.com/item?id=50584268

## Other languages

- ko: https://zeli.app/ko/story/50584268 · markdown: https://zeli.app/ko/story/50584268.md
