From 122d546057aef88c9939c8f6b5cfb348723a6c60 Mon Sep 17 00:00:00 2001 From: DuYicong515 Date: Sun, 6 Mar 2022 12:36:37 -0800 Subject: [PATCH] add pl_multi_process_test decorator to TPU num_devices test --- tests/accelerators/test_tpu.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/accelerators/test_tpu.py b/tests/accelerators/test_tpu.py index 7d78724469eb43..dcafaee3940e4f 100644 --- a/tests/accelerators/test_tpu.py +++ b/tests/accelerators/test_tpu.py @@ -94,6 +94,7 @@ def test_accelerator_cpu_with_tpu_cores_flag(): @RunIf(tpu=True) +@pl_multi_process_test @pytest.mark.parametrize(["accelerator", "devices"], [("auto", 8), ("auto", "auto"), ("tpu", None)]) def test_accelerator_tpu(accelerator, devices): assert TPUAccelerator.is_available() @@ -117,8 +118,8 @@ def test_accelerator_tpu_with_tpu_cores_priority(): @RunIf(tpu=True) +@pl_multi_process_test def test_set_devices_if_none_tpu(): - trainer = Trainer(accelerator="tpu", tpu_cores=8) assert trainer.num_devices == 8 @@ -313,6 +314,7 @@ def test_warning_if_tpus_not_used(): @RunIf(tpu=True) +@pl_multi_process_test @pytest.mark.parametrize( ["devices", "expected_device_ids"], [