Hello!
There are at least 2 things off in this example:


mp.spawn calls the specified function with the local rank as first argument. This means that the arguments you pass are off by 1 (this is likely what causes the first error).
You’re calling setup(1, 2) even if you run with a single process. This will cause a hang followed by a timeout after 30 minutes.

Good luck!