$ the-wire · showcase
CPU caching allocator teardown race fixed, torchtitan shares one training engine
By RepoJournal · Filed · About PyTorch · Composed from the cited sources · methodology
A long-standing thread-safety hole in CPUCachingAllocator's destructor is closed, torchtitan collapses its eager and RL trainers onto one TrainingEngine, and TensorRT finishes a half-done API migration that had been passing stale arguments for months.
Prevent allocation-map races during `CPUCachingAllocator` teardown (#196759) (#196759) pytorch/pytorch
Teardown of a CPUCachingAllocator mutated the shared allocation map without holding its mutex, so it could race with allocations and tensor cleanup on other threads; the fix takes the existing mutex before freeing cached blocks and skips the lock entirely when the cache is empty, which keeps empty allocators destructible during static teardown without touching global state. The patch lands with...
fix(fx): drop the dynamic_range argument from the 8 remaining mark_as_int8_layer calls pytorch/TensorRT
A previous change removing dynamic_range from mark_as_int8_layer left eight call sites still passing two positional arguments; this drops the extra argument at each of them. If you maintain a fork or downstream converter that copied those call sites, the same one-argument signature now applies.
grid_sample: support mode='bicubic' with 5-D input, including its double backward (#194787) pytorch/pytorch
grid_sample accepted 4-D and 5-D input but mode='bicubic' only worked for 4-D; this adds the 5-D path with the same separable Keys kernel (A = -3/4) applied over the third axis, with forward, backward and double backward on both CPU and CUDA. The stated motivation is medical volumes resampled through a stored transform or displacement field, which is exactly the 5-D case.
[dynamo] Split OrderedSetVariable off SetVariable to match CPython (#196167) pytorch/pytorch
OrderedSetVariable inherited SetVariable even though torch.utils._ordered_set.OrderedSet is a pure-Python MutableSet and issubclass(OrderedSet, set) is False, so Dynamo used set behavior wherever the two diverge and some paths treated the tracked object as a set or dict it is not. Splitting the variable off brings Dynamo in line with CPython semantics for the same objects.
[RL] Share the core training engine pytorch/torchtitan
TrainingEngine moves into torchtitan/training_engine.py and is shared by the core eager trainer and the RL trainer, with tokenizer, dataloader, create_seed_checkpoint and metrics staying specific to the supervised trainer. The author's note is explicit that this is a pure refactor with no numerics change. Elsewhere in the long tail: torchrl adds MenagerieEnv to load any MuJoCo Menagerie robot b...