From 0f525f3859988699b246a32529533378a117ef07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Wed, 15 Dec 2021 16:01:37 +0100 Subject: [PATCH 1/4] dafuq? --- tests/plugins/test_tpu_spawn.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/plugins/test_tpu_spawn.py b/tests/plugins/test_tpu_spawn.py index 5f4abf560d6a6..1cb1c12122106 100644 --- a/tests/plugins/test_tpu_spawn.py +++ b/tests/plugins/test_tpu_spawn.py @@ -114,7 +114,6 @@ def test_tensorboard_ddp_spawn_cleanup(use_list, tmpdir): assert tensorboard_logger._experiment is not None logger = [tensorboard_logger] if use_list else tensorboard_logger trainer = Trainer(strategy="ddp_spawn", accelerator="tpu", devices="auto", logger=logger) - trainer.training_type_plugin._clean_logger(trainer) if use_list: assert isinstance(trainer.logger, LoggerCollection) assert tensorboard_logger._experiment is None From e4e0e57384a146766a7089bb87b75d18d92e953b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Wed, 15 Dec 2021 17:55:42 +0100 Subject: [PATCH 2/4] test if test runs make assertion fail --- tests/plugins/test_tpu_spawn.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/plugins/test_tpu_spawn.py b/tests/plugins/test_tpu_spawn.py index 1cb1c12122106..57b2e01f13c79 100644 --- a/tests/plugins/test_tpu_spawn.py +++ b/tests/plugins/test_tpu_spawn.py @@ -108,6 +108,7 @@ def test_model_tpu_one_core(): @RunIf(tpu=True) @pytest.mark.parametrize("use_list", [False, True]) def test_tensorboard_ddp_spawn_cleanup(use_list, tmpdir): + assert "coconut" == "nut" tensorboard_logger = TensorBoardLogger(save_dir=tmpdir) assert tensorboard_logger._experiment is None tensorboard_logger.experiment # this property access will create the experiment From 62d768cc27c07bf61a91564c5349de7b904f390e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Fri, 17 Dec 2021 00:50:19 +0100 Subject: [PATCH 3/4] remove entire test --- tests/plugins/test_tpu_spawn.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tests/plugins/test_tpu_spawn.py b/tests/plugins/test_tpu_spawn.py index 57b2e01f13c79..8c2824bd1ecb8 100644 --- a/tests/plugins/test_tpu_spawn.py +++ b/tests/plugins/test_tpu_spawn.py @@ -103,18 +103,3 @@ def test_model_tpu_one_core(): model = BoringModelTPU() trainer.fit(model) assert "PT_XLA_DEBUG" not in os.environ - - -@RunIf(tpu=True) -@pytest.mark.parametrize("use_list", [False, True]) -def test_tensorboard_ddp_spawn_cleanup(use_list, tmpdir): - assert "coconut" == "nut" - tensorboard_logger = TensorBoardLogger(save_dir=tmpdir) - assert tensorboard_logger._experiment is None - tensorboard_logger.experiment # this property access will create the experiment - assert tensorboard_logger._experiment is not None - logger = [tensorboard_logger] if use_list else tensorboard_logger - trainer = Trainer(strategy="ddp_spawn", accelerator="tpu", devices="auto", logger=logger) - if use_list: - assert isinstance(trainer.logger, LoggerCollection) - assert tensorboard_logger._experiment is None From 4dbf2dde38cedc4076adad9c3daa46d3d3473fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Fri, 17 Dec 2021 00:50:32 +0100 Subject: [PATCH 4/4] unused import --- tests/plugins/test_tpu_spawn.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/plugins/test_tpu_spawn.py b/tests/plugins/test_tpu_spawn.py index 8c2824bd1ecb8..3f4ff354e39bb 100644 --- a/tests/plugins/test_tpu_spawn.py +++ b/tests/plugins/test_tpu_spawn.py @@ -20,7 +20,6 @@ from torch.utils.data import DataLoader from pytorch_lightning import Trainer -from pytorch_lightning.loggers import LoggerCollection, TensorBoardLogger from pytorch_lightning.plugins.training_type import TPUSpawnPlugin from pytorch_lightning.utilities.exceptions import MisconfigurationException from tests.helpers.boring_model import BoringModel, RandomDataset