MPI backend cannot work!

I use the MPI as the backend in distributed pytorch among multiple nodes.

exec code:
mpirun --hostfile hostfile -n 2 python *.py

and I revised the init line which looks like init line in pytorch file ,

the init command line :slight_smile:
os.environ[‘MASTER_ADDR’] = '’
os.environ[‘MASTER_PORT’] = ‘23456’

dist.init_process_group(init_method='env://', backend='mpi')
group = dist.new_group([i for i in range(dist.get_world_size())]) 

I am sure that openmpi is installed correctly. Pytorch is build from source with MPI support.

I really appreciate any help.

1 Like