From 2f73e5df7ec541a9e38e7cabfc9ecd5881cda1f8 Mon Sep 17 00:00:00 2001 From: Stefan Geyer Date: Fri, 18 Aug 2023 11:51:58 +0200 Subject: [PATCH 1/2] Update test_train.py Fix typo in test docstring. --- tests/test_train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_train.py b/tests/test_train.py index f0a8fdf76..fcd0935e5 100644 --- a/tests/test_train.py +++ b/tests/test_train.py @@ -37,7 +37,7 @@ def test_train_fast_dev_run_gpu(cfg_train: DictConfig) -> None: @RunIf(min_gpus=1) @pytest.mark.slow def test_train_epoch_gpu_amp(cfg_train: DictConfig) -> None: - """Train 1 epoch on GPU with mixed-precision. + """Train 1 epoch on CPU with mixed-precision. :param cfg_train: A DictConfig containing a valid training configuration. """ From 91c8722bacb33109013cdda44fe02d50c6557b63 Mon Sep 17 00:00:00 2001 From: Stefan Geyer Date: Tue, 22 Aug 2023 13:47:33 +0200 Subject: [PATCH 2/2] Update test_train_epoch_gpu_amp function: * use gpu instead of cpu * change docstring to represent usage of gpu * remove pytest.slow decorator --- tests/test_train.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_train.py b/tests/test_train.py index fcd0935e5..c13ae02c8 100644 --- a/tests/test_train.py +++ b/tests/test_train.py @@ -37,14 +37,14 @@ def test_train_fast_dev_run_gpu(cfg_train: DictConfig) -> None: @RunIf(min_gpus=1) @pytest.mark.slow def test_train_epoch_gpu_amp(cfg_train: DictConfig) -> None: - """Train 1 epoch on CPU with mixed-precision. + """Train 1 epoch on GPU with mixed-precision. :param cfg_train: A DictConfig containing a valid training configuration. """ HydraConfig().set_config(cfg_train) with open_dict(cfg_train): cfg_train.trainer.max_epochs = 1 - cfg_train.trainer.accelerator = "cpu" + cfg_train.trainer.accelerator = "gpu" cfg_train.trainer.precision = 16 train(cfg_train)