Skip to content

Commit

Permalink
See if we can enable deepspeed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanNaren committed Mar 17, 2021
1 parent bd2a53a commit b5450de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
14 changes: 7 additions & 7 deletions tests/plugins/test_deepspeed_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ def test_deepspeed_defaults(tmpdir):
assert isinstance(plugin.config["zero_optimization"], dict)


@RunIf(min_gpus=1, deepspeed=True, special=True)
def test_invalid_deepspeed_defaults_no_precision(dist_initialized_mock, tmpdir):
@RunIf(min_gpus=1, deepspeed=True)
def test_invalid_deepspeed_defaults_no_precision(tmpdir):
"""Test to ensure that using defaults, if precision is not set to 16, we throw an exception."""
model = BoringModel()
trainer = Trainer(
Expand All @@ -196,7 +196,7 @@ def test_invalid_deepspeed_defaults_no_precision(dist_initialized_mock, tmpdir):
trainer.fit(model)


@RunIf(min_gpus=1, deepspeed=True, special=True)
@RunIf(min_gpus=1, deepspeed=True)
def test_warn_deepspeed_override_backward(tmpdir):
"""Test to ensure that if the backward hook in the LightningModule is overridden, we throw a warning."""

Expand All @@ -217,7 +217,7 @@ def backward(self, loss: Tensor, optimizer: Optimizer, optimizer_idx: int, *args
trainer.fit(model)


@RunIf(min_gpus=1, deepspeed=True, special=True)
@RunIf(min_gpus=1, deepspeed=True)
def test_deepspeed_run_configure_optimizers(tmpdir):
"""Test end to end that deepspeed works with defaults (without ZeRO as that requires compilation),
whilst using configure_optimizers for optimizers and schedulers."""
Expand Down Expand Up @@ -247,7 +247,7 @@ def on_train_start(self) -> None:
_assert_save_model_is_equal(model, tmpdir, trainer)


@RunIf(min_gpus=1, deepspeed=True, special=True)
@RunIf(min_gpus=1, deepspeed=True)
def test_deepspeed_config(tmpdir, deepspeed_zero_config):
"""
Test to ensure deepspeed works correctly when passed a DeepSpeed config object including optimizers/schedulers
Expand Down Expand Up @@ -281,7 +281,7 @@ def on_train_start(self) -> None:
_assert_save_model_is_equal(model, tmpdir, trainer)


@RunIf(min_gpus=1, deepspeed=True, special=True)
@RunIf(min_gpus=1, deepspeed=True)
def test_deepspeed_custom_precision_params(tmpdir):
"""Ensure if we modify the FP16 parameters via the DeepSpeedPlugin, the deepspeed config contains these changes."""

Expand All @@ -302,7 +302,7 @@ def on_train_start(self) -> None:
trainer.fit(model)


@RunIf(min_gpus=1, deepspeed=True, special=True)
@RunIf(min_gpus=1, deepspeed=True)
def test_deepspeed_assert_config_zero_offload_disabled(tmpdir, deepspeed_zero_config):
"""Ensure if we use a config and turn off cpu_offload, that this is set to False within the config."""

Expand Down
5 changes: 0 additions & 5 deletions tests/special_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ export PL_RUNNING_SPECIAL_TESTS=1
DEFAULTS="-m coverage run --source pytorch_lightning -a -m pytest --verbose --capture=no"
python ${DEFAULTS} tests/trainer/optimization/test_manual_optimization.py::test_step_with_optimizer_closure_with_different_frequencies_ddp
python ${DEFAULTS} tests/models/test_sync_batchnorm.py::test_sync_batchnorm_ddp
python ${DEFAULTS} tests/plugins/test_deepspeed_plugin.py::test_warn_deepspeed_override_backward
python ${DEFAULTS} tests/plugins/test_deepspeed_plugin.py::test_deepspeed_run_configure_optimizers
python ${DEFAULTS} tests/plugins/test_deepspeed_plugin.py::test_deepspeed_config
python ${DEFAULTS} tests/plugins/test_deepspeed_plugin.py::test_deepspeed_custom_precision_params
python ${DEFAULTS} tests/plugins/test_deepspeed_plugin.py::test_deepspeed_assert_config_zero_offload_disabled
python ${DEFAULTS} tests/plugins/test_deepspeed_plugin.py::test_deepspeed_multigpu
python ${DEFAULTS} tests/plugins/test_rpc_plugin.py::test_rpc_function_calls_ddp
python ${DEFAULTS} tests/plugins/test_rpc_sequential_plugin.py::test_rpc_sequential_plugin_manual
Expand Down

0 comments on commit b5450de

Please sign in to comment.