mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-10 12:21:57 +08:00
Replace GPU device idx with current process index (#1541)
This commit is contained in:
@@ -327,7 +327,7 @@ class TrainerDDPMixin(ABC):
|
||||
# MODEL
|
||||
# copy model to each gpu
|
||||
if self.on_gpu:
|
||||
self.root_gpu = self.data_parallel_device_ids[process_idx]
|
||||
self.root_gpu = process_idx
|
||||
torch.cuda.set_device(self.root_gpu)
|
||||
model.cuda(self.root_gpu)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user