← Back to events
ActiveAIRelease6.1

trunk/42f04f29182a6cd7a72a493e9cca1136756cc312: [torch] Make singletons immortal (#194371) (#194371)

Photo: PyTorch Releases

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

Why it's spreading

Sources