Environment: PyTorch 2.12.0+cu130, Python 3.14, Ubuntu 22.04, CUDA 13.0. In a standard training loop using DataLoader with num_workers > 0, training occasionally crashes with RuntimeError: could not unlink the shared memory file /torch_<pid>_<rand> : No such file or directory (2) inside default_collate → collate_tensor_fn → _new_shared → _new_using_fd_cpu. The same code and PyTorch version on Python 3.12 never hit this. The crash only appears after midnight (a period after 00:00), never during daytime runs. Sometimes the error terminates training, sometimes it does not. Previously, when using fork (the default on Python 3.12), the run was silent with no error message.
I suspect a race between PyTorch’s shared-memory file lifecycle (create in /dev/shm, then immediately unlink) and systemd’s RemoveIPC cleanup, which can delete the file between creation and unlink. Python 3.14 changed the default multiprocessing start method from fork to forkserver, which likely widens this race window and explains why 3.12 is unaffected.
I am not sure whether this affects experimental results. Also, when using fork, the run was silent with no error—does that mean it was already broken silently, or does it not affect results?