From b551921a9f50e94885fab8ddd6eb54348368a418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mochol=C3=AD?= Date: Wed, 15 Jun 2022 22:51:14 +0200 Subject: [PATCH] Remove unused test argument (#13296) --- tests/helpers/pipelines.py | 1 - tests/models/test_cpu.py | 8 ++++---- tests/models/test_tpu.py | 22 +++++++++++----------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/tests/helpers/pipelines.py b/tests/helpers/pipelines.py index 1bd2140cbb..8c2aa3d527 100644 --- a/tests/helpers/pipelines.py +++ b/tests/helpers/pipelines.py @@ -47,7 +47,6 @@ def run_model_test( trainer_options, model: LightningModule, data: LightningDataModule = None, - on_gpu: bool = True, version=None, with_hpc: bool = True, min_acc: float = 0.25, diff --git a/tests/models/test_cpu.py b/tests/models/test_cpu.py index 9f1002cbbc..187b32b434 100644 --- a/tests/models/test_cpu.py +++ b/tests/models/test_cpu.py @@ -118,7 +118,7 @@ def test_early_stopping_cpu_model(tmpdir): ) model = ModelTrainVal() - tpipes.run_model_test(trainer_options, model, on_gpu=False) + tpipes.run_model_test(trainer_options, model) # test freeze on cpu model.freeze() @@ -143,7 +143,7 @@ def test_multi_cpu_model_ddp(tmpdir): dm = ClassifDataModule() model = ClassificationModel() - tpipes.run_model_test(trainer_options, model, data=dm, on_gpu=False) + tpipes.run_model_test(trainer_options, model, data=dm) def test_lbfgs_cpu_model(tmpdir): @@ -297,7 +297,7 @@ def test_cpu_model(tmpdir): ) model = BoringModel() - tpipes.run_model_test(trainer_options, model, on_gpu=False) + tpipes.run_model_test(trainer_options, model) def test_all_features_cpu_model(tmpdir): @@ -316,4 +316,4 @@ def test_all_features_cpu_model(tmpdir): model = BoringModel() - tpipes.run_model_test(trainer_options, model, on_gpu=False, min_acc=0.01) + tpipes.run_model_test(trainer_options, model, min_acc=0.01) diff --git a/tests/models/test_tpu.py b/tests/models/test_tpu.py index 97d77b198a..b42aa4a3f3 100644 --- a/tests/models/test_tpu.py +++ b/tests/models/test_tpu.py @@ -64,7 +64,7 @@ def test_model_tpu_devices_1(tmpdir): ) model = BoringModel() - tpipes.run_model_test(trainer_options, model, on_gpu=False, with_hpc=False) + tpipes.run_model_test(trainer_options, model, with_hpc=False) @pytest.mark.parametrize("tpu_core", [1, 5]) @@ -84,7 +84,7 @@ def test_model_tpu_index(tmpdir, tpu_core): ) model = BoringModel() - tpipes.run_model_test(trainer_options, model, on_gpu=False, with_hpc=False) + tpipes.run_model_test(trainer_options, model, with_hpc=False) assert torch_xla._XLAC._xla_get_default_device() == f"xla:{tpu_core}" @@ -105,7 +105,7 @@ def test_model_tpu_devices_8(tmpdir): # 8 cores needs a big dataset model = SerialLoaderBoringModel() - tpipes.run_model_test(trainer_options, model, on_gpu=False, with_hpc=False, min_acc=0.05) + tpipes.run_model_test(trainer_options, model, with_hpc=False, min_acc=0.05) @RunIf(tpu=True) @@ -125,7 +125,7 @@ def test_model_16bit_tpu_devices_1(tmpdir): ) model = BoringModel() - tpipes.run_model_test(trainer_options, model, on_gpu=False) + tpipes.run_model_test(trainer_options, model) @pytest.mark.parametrize("tpu_core", [1, 5]) @@ -146,7 +146,7 @@ def test_model_16bit_tpu_index(tmpdir, tpu_core): ) model = BoringModel() - tpipes.run_model_test(trainer_options, model, on_gpu=False) + tpipes.run_model_test(trainer_options, model) assert torch_xla._XLAC._xla_get_default_device() == f"xla:{tpu_core}" @@ -168,7 +168,7 @@ def test_model_16bit_tpu_devices_8(tmpdir): # 8 cores needs a big dataset model = SerialLoaderBoringModel() - tpipes.run_model_test(trainer_options, model, on_gpu=False, with_hpc=False, min_acc=0.05) + tpipes.run_model_test(trainer_options, model, with_hpc=False, min_acc=0.05) @RunIf(tpu=True) @@ -215,7 +215,7 @@ def test_tpu_grad_norm(tmpdir): ) model = BoringModel() - tpipes.run_model_test(trainer_options, model, on_gpu=False, with_hpc=False) + tpipes.run_model_test(trainer_options, model, with_hpc=False) @RunIf(tpu=True) @@ -236,7 +236,7 @@ def test_tpu_clip_grad_by_value(tmpdir): ) model = BoringModel() - tpipes.run_model_test(trainer_options, model, on_gpu=False, with_hpc=False) + tpipes.run_model_test(trainer_options, model, with_hpc=False) @RunIf(tpu=True) @@ -354,7 +354,7 @@ def test_tpu_precision_16_clip_gradients(mock_clip_grad_norm, clip_val, tmpdir): gradient_clip_val=clip_val, ) model = BoringModel() - tpipes.run_model_test(trainer_options, model, on_gpu=False, with_hpc=False) + tpipes.run_model_test(trainer_options, model, with_hpc=False) if clip_val > 0: mock_clip_grad_norm.assert_called() @@ -420,7 +420,7 @@ def test_tpu_debug_mode(tmpdir): ) model = DebugModel() - tpipes.run_model_test(trainer_options, model, on_gpu=False, with_hpc=False) + tpipes.run_model_test(trainer_options, model, with_hpc=False) @RunIf(tpu=True) @@ -447,7 +447,7 @@ def test_tpu_host_world_size(tmpdir): ) model = DebugModel() - tpipes.run_model_test(trainer_options, model, on_gpu=False, with_hpc=False) + tpipes.run_model_test(trainer_options, model, with_hpc=False) @RunIf(tpu=True)