Skip to content

Commit

Permalink
is-instance check to determine the type of a plugin for teardown deci…
Browse files Browse the repository at this point in the history
  • Loading branch information
awaelchli authored and four4fish committed Aug 16, 2021
1 parent a5dfc46 commit 78bcadc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from pytorch_lightning.loops.dataloader.evaluation_loop import EvaluationLoop
from pytorch_lightning.loops.dataloader.prediction_loop import PredictionLoop
from pytorch_lightning.loops.fit_loop import FitLoop
from pytorch_lightning.plugins import Plugin
from pytorch_lightning.plugins import DDPSpawnPlugin, Plugin
from pytorch_lightning.plugins.environments import ClusterEnvironment
from pytorch_lightning.profiler import (
AdvancedProfiler,
Expand Down Expand Up @@ -76,7 +76,6 @@
)
from pytorch_lightning.utilities.debugging import InternalDebugger
from pytorch_lightning.utilities.distributed import distributed_available
from pytorch_lightning.utilities.enums import DistributedType
from pytorch_lightning.utilities.exceptions import MisconfigurationException
from pytorch_lightning.utilities.imports import _fault_tolerant_enabled
from pytorch_lightning.utilities.model_helpers import is_overridden
Expand Down Expand Up @@ -947,7 +946,7 @@ def _run(self, model: "pl.LightningModule") -> Optional[Union[_EVALUATE_OUTPUT,

# teardown if necessary (similar calls for spawn plugins are excluded as they have
# been included at the end of `new_process` functions)
if self._distrib_type not in DistributedType.interactive_compatible_types():
if not isinstance(self.training_type_plugin, DDPSpawnPlugin):
self._call_teardown_hook()

if self.state.status != TrainerStatus.INTERRUPTED:
Expand Down

0 comments on commit 78bcadc

Please sign in to comment.