if image_list is not None:
self.accelerator.backward(loss_ce+loss_diff)
loss = loss_ce.detach()+loss_diff.detach()
else:
self.accelerator.backward(loss_ce)
loss = loss_ce.detach()
I’m using multi-GPU training, and the code above causes the backward computation graphs on different GPUs to be different, leading to deadlocks. Is there any way to solve this issue?