Hey @Yi_Zhang, you can set a timeout in init_process_group. For NCCL backend, it also requires setting NCCL_BLOCKING_WAIT env var to 1.
More explanation can be found here https://pytorch.org/docs/stable/distributed.html#torch.distributed.init_process_group 58. (search for NCCL_BLOCKING_WAIT )