Hello! Can you please give more info about your environment, dockerfile, port openings between hosts and whether there any firewalls?
I tried to repro your use-case and used the following environment:
2 ec2 servers in the same VPC and subnet. All ports are open between them.
The docker file is:
FROM pytorch/pytorch:1.9.0-cuda10.2-cudnn7-runtime

WORKDIR /app

COPY . /app

The command that I am running:
docker run --network host -it aivanou-test1 /bin/bash
python -m torch.distributed.run --rdzv_id 555 --rdzv_backend c10d --rdzv_endpoint 172.31.25.111:29400 --nnodes 2 simple.py
The 172.31.25.111 is the ip address of the host0.
The following works for pytorch 1.9 and 1.10