Skip to content

Commit

Permalink
stupid formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
awaelchli committed Feb 1, 2021
1 parent 3a44c73 commit ea88661
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pytorch_lightning/accelerators/accelerator_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(
self.replace_sampler_ddp = replace_sampler_ddp
self.deterministic = deterministic
self.precision = precision
self.amp_type = amp_type.lower() if isinstance(amp_type, str) else None
self.amp_type = amp_type.lower() if isinstance(amp_type, str) else None
self.amp_level = amp_level
self.cluster_environment = cluster_environment
self.is_slurm_managing_tasks = False
Expand Down
16 changes: 5 additions & 11 deletions pytorch_lightning/plugins/training_type/tpu_spawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,12 @@ def __load_weights_on_main_process(self) -> None:
def xmp_spawn_kwargs(self):
return {
"args": (self.lightning_module, trainer, self.mp_queue),
"nproc": len(self.parallel_devices),
"start_method": self.start_method
}
"nproc": len(self.parallel_devices),
"start_method": self.start_method
}

def start_training(self, trainer) -> None:
xmp.spawn(
self.new_process,
**self.xmp_spawn_kwargs
)
xmp.spawn(self.new_process, **self.xmp_spawn_kwargs)

def start_testing(self, trainer) -> None:
xmp.spawn(
self.new_process,
**self.xmp_spawn_kwargs
)
xmp.spawn(self.new_process, **self.xmp_spawn_kwargs)

0 comments on commit ea88661

Please sign in to comment.