Allow CUDA and IPU tests without the CI environment var (#13676)
This commit is contained in:
parent
35ec79ad1f
commit
0e5a51f55c
|
@ -127,8 +127,7 @@ class RunIf:
|
|||
reasons = []
|
||||
|
||||
if min_cuda_gpus:
|
||||
env_flag = os.getenv("PL_RUN_CUDA_TESTS", "0")
|
||||
conditions.append(env_flag != "1" or torch.cuda.device_count() < min_cuda_gpus)
|
||||
conditions.append(torch.cuda.device_count() < min_cuda_gpus)
|
||||
reasons.append(f"GPUs>={min_cuda_gpus}")
|
||||
# used in conftest.py::pytest_collection_modifyitems
|
||||
kwargs["min_cuda_gpus"] = True
|
||||
|
@ -180,8 +179,7 @@ class RunIf:
|
|||
reasons.append("TPU")
|
||||
|
||||
if ipu:
|
||||
env_flag = os.getenv("PL_RUN_IPU_TESTS", "0")
|
||||
conditions.append(env_flag != "1" or not _IPU_AVAILABLE)
|
||||
conditions.append(not _IPU_AVAILABLE)
|
||||
reasons.append("IPU")
|
||||
# used in conftest.py::pytest_collection_modifyitems
|
||||
kwargs["ipu"] = True
|
||||
|
|
|
@ -101,7 +101,7 @@ report+="Ran\tplugins/environments/torch_elastic_deadlock.py\n"
|
|||
|
||||
# test that a user can manually launch individual processes
|
||||
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
|
||||
args="--trainer.gpus 2 --trainer.strategy ddp --trainer.max_epochs=1 --trainer.limit_train_batches=1 --trainer.limit_val_batches=1 --trainer.limit_test_batches=1"
|
||||
args="--trainer.accelerator gpu --trainer.devices 2 --trainer.strategy ddp --trainer.max_epochs=1 --trainer.limit_train_batches=1 --trainer.limit_val_batches=1 --trainer.limit_test_batches=1"
|
||||
MASTER_ADDR="localhost" MASTER_PORT=1234 LOCAL_RANK=1 python ../../examples/convert_from_pt_to_pl/image_classifier_5_lightning_datamodule.py ${args} &
|
||||
MASTER_ADDR="localhost" MASTER_PORT=1234 LOCAL_RANK=0 python ../../examples/convert_from_pt_to_pl/image_classifier_5_lightning_datamodule.py ${args}
|
||||
report+="Ran\tmanual ddp launch test\n"
|
||||
|
|
Loading…
Reference in New Issue