Skip to content

Commit

Permalink
add pl_multi_process_test decorator to TPU num_devices test
Browse files Browse the repository at this point in the history
  • Loading branch information
DuYicong515 committed Mar 14, 2022
1 parent ed83e26 commit 122d546
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/accelerators/test_tpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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

Expand Down Expand Up @@ -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"],
[
Expand Down

0 comments on commit 122d546

Please sign in to comment.