I have the same error with DistributedDataParallel. I am sending the model to DDP as follows
models = DDP(models.cuda(), device_ids=[rank],
                            broadcast_buffers=False, find_unused_parameters=True)

and I am sending the inputs to the same rank as well. This error doesn’t occur while using DataParallel though