In models/cycle_gan_model.py, line 83: input_A = input_A.cuda(self.gpu_ids[0], async=True).
Why do we only use a single GPU (gpu_ids[0]) and why do we set acync to True?
It's not about single GPU... A tensor lives on either CPU memory or a GPU's memory. There is no such thing of having a tensor on multiple GPUs. You can always copy a tensor from one GPU to another though. Here we just put the tensor onto one of the GPUs. MultiGPU training is done via DataParallel.
Since our dataloader uses pinned memory, we can load asynchronously. Setting async to true avoids cuda synchronization. So it's mainly for the slight speed gain.
Most helpful comment
It's not about single GPU... A tensor lives on either CPU memory or a GPU's memory. There is no such thing of having a tensor on multiple GPUs. You can always copy a tensor from one GPU to another though. Here we just put the tensor onto one of the GPUs. MultiGPU training is done via DataParallel.
Since our dataloader uses pinned memory, we can load asynchronously. Setting async to true avoids cuda synchronization. So it's mainly for the slight speed gain.