Skip to content

Commit

Permalink
ref: decoupled ddp spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
williamFalcon committed Sep 30, 2020
1 parent 082f550 commit 04af624
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pytorch_lightning/accelerators/ddp_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

from pytorch_lightning import _logger as log
from pytorch_lightning.utilities.distributed import find_free_network_port
from pytorch_lightning.accelerators.ddp_base_backend import DDPBase
from pytorch_lightning.accelerators.base_backend import Accelerator
from pytorch_lightning.utilities.distributed import rank_zero_only
from pytorch_lightning.utilities import AMPType

Expand All @@ -39,7 +39,7 @@
HYDRA_AVAILABLE = True


class DDPBackend(DDPBase):
class DDPBackend(Accelerator):

def __init__(self, trainer, mode: str = 'ddp'):
super().__init__(trainer)
Expand Down
4 changes: 2 additions & 2 deletions pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,6 @@ def test(
# Attach datamodule to get setup/prepare_data added to model before the call to it below
self.data_connector.attach_datamodule(model or self.get_model(), datamodule, 'test')

print('-' * 100, f'\n {self.accelerator_backend.task_idx} TEST-DM \n', '-' * 100)

if model is not None:
results = self.__test_given_model(model, test_dataloaders)
else:
Expand All @@ -726,6 +724,8 @@ def test(
def __test_using_best_weights(self, ckpt_path, test_dataloaders):
model = self.get_model()

print('-' * 100, f'\n {self.accelerator_backend.task_idx} TEST-DM \n', '-' * 100)

# if user requests the best checkpoint but we don't have it, error
if ckpt_path == 'best' and not self.checkpoint_callback.best_model_path:
raise MisconfigurationException(
Expand Down

0 comments on commit 04af624

Please sign in to comment.