From ee9fb0017c687ad96c0f2d9c3c0257b361eb2ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Mon, 31 Jan 2022 22:36:54 +0100 Subject: [PATCH 1/2] remove legacy dead code in ddp script launch --- pytorch_lightning/strategies/ddp.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pytorch_lightning/strategies/ddp.py b/pytorch_lightning/strategies/ddp.py index 4aa67baaed422..35123725d61c9 100644 --- a/pytorch_lightning/strategies/ddp.py +++ b/pytorch_lightning/strategies/ddp.py @@ -208,13 +208,6 @@ def _call_children_scripts(self): else: # Script called as `python -m a.b.c` command = [sys.executable, "-m", __main__.__spec__.name] + sys.argv[1:] - # the visible devices tell us how many GPUs we want to use. - # when the trainer script was called the device has already been scoped by the time - # code reaches this point. so, to call the scripts, we need to leave cuda visible devices alone - # but forward the GPUs selected via environment variables - if self.parallel_devices is None: - raise MisconfigurationException("you selected (distribute_backend = ddp) but did not set Trainer(gpus=?)") - os.environ["WORLD_SIZE"] = f"{self.num_processes * self.num_nodes}" self.interactive_ddp_procs = [] From 155c3f274a46737b1f6cdf88df52d4c0145cff36 Mon Sep 17 00:00:00 2001 From: Carlos Mocholi Date: Thu, 3 Feb 2022 03:16:11 +0100 Subject: [PATCH 2/2] Unused import --- pytorch_lightning/strategies/ddp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_lightning/strategies/ddp.py b/pytorch_lightning/strategies/ddp.py index 35123725d61c9..e7f9b2505bc78 100644 --- a/pytorch_lightning/strategies/ddp.py +++ b/pytorch_lightning/strategies/ddp.py @@ -57,7 +57,7 @@ sync_ddp_if_available, ) from pytorch_lightning.utilities.enums import _StrategyType -from pytorch_lightning.utilities.exceptions import DeadlockDetectedException, MisconfigurationException +from pytorch_lightning.utilities.exceptions import DeadlockDetectedException from pytorch_lightning.utilities.seed import reset_seed from pytorch_lightning.utilities.types import STEP_OUTPUT