It looks like pytorch was not compiled with MPI… did you recompile pytorch as well ?
Did you check the pytorch you’re using is the one you recompiled ?
Make sure pytorch can find MPI during installation by adding the bin folder to the path.
If you didn’t see:

Found openMP
Compiling with openMP support

during install, then probably pytorch didn’t find MPI.
Good luck !