mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-10-30 13:40:46 +08:00
added single node distdataparallel
This commit is contained in:
1 parent
b9f581ab87
commit
f06c650fc1
1 file changed
+4
-1
@@ -29,6 +29,8 @@ def reduce_distributed_output(output, nb_gpus):
|
||||
output[k] = reduced
|
||||
return output
|
||||
|
||||
def dummy(gpu, a):
|
||||
print(gpu)
|
||||
|
||||
class Trainer(TrainerIO):
|
||||
|
||||
@@ -283,7 +285,7 @@ class Trainer(TrainerIO):
|
||||
if self.on_gpu:
|
||||
rank = 0
|
||||
self.model = model
|
||||
mp.spawn(self.__dp_train, nprocs=len(self.data_parallel_device_ids), args=(rank))
|
||||
mp.spawn(dummy, nprocs=len(self.data_parallel_device_ids), args=(rank))
|
||||
else:
|
||||
self.__run_pretrain_routine(model)
|
||||
|
||||
@@ -314,6 +316,7 @@ class Trainer(TrainerIO):
|
||||
self.__run_pretrain_routine(model)
|
||||
|
||||
|
||||
|
||||
def __run_pretrain_routine(self, model):
|
||||
"""
|
||||
Sanity check a few things before starting actual training
|
||||
|
||||
Reference in new issue
Block a user