trunk/42f04f29182a6cd7a72a493e9cca1136756cc312: [torch] Make singletons immortal (#194371) (#194371)
- PyTorch: 350 events in the last 90 days
- PyTorch: 347th Release in the last 90 days
- Previous: earlier the same day · trunk/62146ea0c777ac1a6fcc637a647335b06fba3019: [xpu][fix]Relax fp16 grad tolerance for combinations on XPU (#195403)
What happened
Summary: Every value in the torch namespace is a process-lifetime singleton, and on a free-threaded build every one of them is an ordinary mortal PyObject . Loading a mortal object owned by another thread takes the shared incref path, an atomic read-modify-write on one cache line, so a dtype=torch.long keyword or a torch.cat lookup in a hot loop becomes a point of contention for the whole process. Measured across mu…
Summary assembled by rule from the sources below