“… the best setup would be creating 4 processes on each machine, …”

Hey @HuangLED, in this case, the world_size should be 8, and the ranks should range from 0-3 on the first machine and 4-7 on the second machine. This page might help explain:
  
      

      github.com
  

  
    pytorch/examples 57

  master/distributed/ddp

  A set of examples around pytorch in Vision, Text, Reinforcement Learning, etc.