Torch.distributed.barrier() hangs in DDP

This is resolved, please see discussion in Using torch.distributed.barrier() makes the whole code hang · Issue #54059 · pytorch/pytorch · GitHub