Are you capturing the SpawnContext object returned by the call to torch.multiprocess.spawn? This SpawnContext is returned only when join=False, and must be saved for the spawned processes to coordinate IPC. If you allow the object to be destructed, you will see this error.
Here is a GitHub issue with some more information: https://github.com/pytorch/pytorch/issues/30461 21