test/hotfix: DDPSpawnStrategy (#16889)

This commit is contained in:
Jirka Borovec 2023-02-28 00:16:44 +01:00 committed by GitHub
parent 52a39c03f8
commit 8884c8970c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ class _LightningTrainerRunExecutor(_PyTorchSpawnRunExecutor):
try: try:
pkg = importlib.import_module(pkg_name) pkg = importlib.import_module(pkg_name)
trainers.append(pkg.Trainer) trainers.append(pkg.Trainer)
strategies.append(pkg.strategies.DDPSpawnStrategy) strategies.append(pkg.strategies.DDPStrategy)
mps_accelerators.append(pkg.accelerators.MPSAccelerator) mps_accelerators.append(pkg.accelerators.MPSAccelerator)
except (ImportError, ModuleNotFoundError): except (ImportError, ModuleNotFoundError):
continue continue

View File

@ -93,4 +93,4 @@ def test_trainer_run_executor_arguments_choices(
@pytest.mark.skipif(not module_available("lightning"), reason="lightning not available") @pytest.mark.skipif(not module_available("lightning"), reason="lightning not available")
def test_trainer_run_executor_invalid_strategy_instances(): def test_trainer_run_executor_invalid_strategy_instances():
with pytest.raises(ValueError, match="DDP Spawned strategies aren't supported yet."): with pytest.raises(ValueError, match="DDP Spawned strategies aren't supported yet."):
_, _ = _get_args_after_tracer_injection(strategy=pl.strategies.DDPSpawnStrategy()) _, _ = _get_args_after_tracer_injection(strategy=pl.strategies.DDPStrategy(start_method="spawn"))