Thank you very much @pritamdamania87
I tested it changing the backend in torch.distributed.init_process_group(backend='nccl', init_method='env://')
from nccl to gloo and it worked
As far as I could see here 4 there are several communication operations in gloo which are not available on GPUs.
On gloo we have just broadcast and all_reduce available on GPU. I do not know if this will affect the performance of the code in some way regarding DDP.
From DDP documentation I interpret that a Reducer uses allreduce operation and then all gradients are averaged in each replicated model in each process.
Yet, I am not sure how using gloo instead of nccl may affect performance
Thanks!