The Wire · Showcase
PYTORCH CUTS MPS DEAD CODE, DREAMER V3 FIXES GPU MEMORY LEAK
By RepoJournal · Filed · About PyTorch
PyTorch is aggressively pruning unused Metal Performance Shaders infrastructure while TorchRL patches a critical memory leak that kept loss tensors pinned to CUDA for entire training runs.
The PyTorch team merged a five-part series stripping dead code from MPS, removing unused shader helpers, kernel dispatch machinery, and graph cache formatting utilities that lost their callers as operations migrated to TensorIterator [1] [2] [3] [4]. In parallel, they consolidated MPS test coverage by running MPS-only tests in normal CI pipelines instead of gating them behind macOS-specific shards, reducing redundant test infrastructure [5]. Over on TorchRL, a critical bugfix eliminates GPU memory retention by ensuring loss tensors don't persist in CUDA memory across the full training duration and allowing Dreamer v3 to use available accelerators by default [6] [7]. The RL team also landed comprehensive numerical contract tests for TQC covering pooled target truncation, quantile-Huber loss gradients, and terminal-NaN masking [8], plus a performance optimization skipping unnecessary reshapes in MuJoCo playground's 1-dimensional batch inference path [9]. ExecuTorch completed the Muse Glimmer rename across test documentation and comments [10] [11], and the Arm backend now prefixes BSS sections to reduce object file bloat by letting the compiler optimize zero-initialized data at compile time rather than linker time [12] [13].
One email a day. Unsubscribe in one click.
Keep up with PyTorch in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Upgrade TorchRL to latest and rebuild Dreamer v3 training jobs to recover CUDA memory pytorch/rl [immediate]
- → Review MPS test consolidation changes if you run macOS CI pipelines pytorch/pytorch [plan]
- → Monitor Arm ExecuTorch builds for BSS section improvements in binary size pytorch/executorch [monitor]
References
- [1] [BE] Removing dead code from MPS (5/5) (#193734) pytorch/pytorch
- [2] [BE] Removing dead code from MPS (4/5) (#193733) pytorch/pytorch
- [3] [BE] Removing dead code from MPS (3/5) (#193732) pytorch/pytorch
- [4] [BE] Removing dead code from MPS (2/5) (#193731) pytorch/pytorch
- [5] Run MPS-only tests in normal test selection (#193586) pytorch/pytorch
- [6] [BugFix] Fix dreamerv3 GPU usage, loss tensors in memory ↗ pytorch/rl
- [7] [BugFix] Fix dreamerv3 GPU usage, loss tensors in memory (#4118) pytorch/rl
- [8] [Test] [TQC] [3/3] Add TQC numerical contracts test ↗ pytorch/rl
- [9] [Performance] mujoco playground skip 1d reshape ↗ pytorch/rl
- [10] [ExecuTorch] Complete Muse Glimmer rename ↗ pytorch/executorch
- [11] [ExecuTorch] Complete Muse Glimmer rename (#21863) pytorch/executorch
- [12] Arm backend: Add .bss prefix to bss sections (#21839) pytorch/executorch
- [13] Arm backend: Add .bss prefix to bss sections ↗ pytorch/executorch