It could be possible that the shared file system doesn’t support the flock system call. If you are training on one node, can you use the local file system instead?
If you are training with multiple nodes, you can instead use TCP initialization described here: Distributed communication package - torch.distributed — PyTorch 1.9.0 documentation 1.