The Wire ยท Showcase
TORCHRL CHECKPOINTS NOW MEMORY-MAPPED BY DEFAULT, FIXING WINDOWS FILE-LOCK CORRUPTION
By RepoJournal ยท Filed ยท About PyTorch
TorchRL's trainer checkpoint loader was materializing entire files into non-evictable RAM and aliasing external state into live components, causing permission errors on Windows and potential corruption if checkpoints were rewritten externally.
The fix lands in two coordinated PRs: Trainer.load_from_file now defaults to torch.load(mmap=True) [1], slashing checkpoint load memory footprint, while all load_state_dict implementations now copy tensors instead of aliasing them [2], breaking the pin on checkpoint file mappings that was blocking file overwrites. The mmap change alone cuts resident memory during restore, critical for large checkpoints that previously had to materialize fully before distribution to components. Meanwhile, doc build times got slashed from 78 to under 40 minutes by introducing MujocoEnv.render_every to skip rendering on frames the VideoRecorder drops anyway [3]. Device precedence rules that were duplicated across four different collector and inference server implementations got unified into a single shared resolution function [4], eliminating the manual replication burden on future changes. ExecuTorch shipped nested superscale quantization for CUDA weights, bringing int4 and int6 down to fp16 metadata packed in 256-weight superblocks [5], and added genuine INT5 support with the same quantization scheme [6]. WebGPU shader codegen now generates vec1/vec4 variants and is fp16-ready [7], while PruneEmptyTensorsPass was hardened against data-dependent shapes that were crashing export [8].
Action items
- โ Upgrade TorchRL and redeploy checkpoints using new mmap defaults before next load cycle pytorch/rl [immediate]
- โ If running Windows RL training with large checkpoints, prioritize this upgrade to unblock file overwrites pytorch/rl [immediate]
- โ Monitor ExecuTorch INT5 quantization rollout for CUDA backend performance on your models pytorch/executorch [monitor]
- โ Plan to rebuild TorchTitan docs after MujocoEnv.render_every lands to verify build time improvement pytorch/torchtitan [plan]
References
- [1] [Performance] Memory-map trainer checkpoints on load โ pytorch/rl
- [2] [BugFix] Copy tensors in load_state_dict instead of aliasing the source โ pytorch/rl
- [3] [Doc] Cut doc-build time: MujocoEnv render_every, tutorial CI fast path, per-example time budget โ pytorch/rl
- [4] [Refactor] Share device-precedence resolution across collectors and inference servers โ pytorch/rl
- [5] [cuda] Nestest Superscale Quantization for CUDA Weights (int4 / int6) (#20571) pytorch/executorch
- [6] [cuda backend] int5 quantization support โ pytorch/executorch
- [7] [ExecuTorch][WebGPU] WGSL shader-variant codegen (vec1/vec4, fp16-ready) + rms_norm dedup โ pytorch/executorch
- [8] Fix PruneEmptyTensorsPass crash on data-dependent shapes (#20809) pytorch/executorch