Dev (#135)
* remove logging best so far metric values from mnist model * update tests * update README.md * comment out wandb tests
This commit is contained in:
1 parent
4bdf4e62c6
commit
d5da445e8d
7 files changed
+64
-111
No files matched your search
@@ -2,6 +2,12 @@ from tests.helpers.run_command import run_command
|
||||
from tests.helpers.runif import RunIf
|
||||
|
||||
|
||||
def test_fast_dev_run():
|
||||
"""Run 1 train, val, test batch."""
|
||||
command = ["run.py", "trainer=default", "trainer.fast_dev_run=true"]
|
||||
run_command(command)
|
||||
|
||||
|
||||
def test_default_cpu():
|
||||
"""Test default configuration on CPU."""
|
||||
command = ["run.py", "trainer.max_epochs=1", "trainer.gpus=0"]
|
||||
@@ -20,12 +26,6 @@ def test_default_gpu():
|
||||
run_command(command)
|
||||
|
||||
|
||||
def test_fast_dev_run():
|
||||
"""Run 1 train, val, test batch."""
|
||||
command = ["run.py", "trainer=default", "trainer.fast_dev_run=true"]
|
||||
run_command(command)
|
||||
|
||||
|
||||
def test_experiments():
|
||||
"""Train 1 epoch with all experiment configs."""
|
||||
command = ["run.py", "-m", "experiment=glob(*)", "trainer.max_epochs=1"]
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
import pytest
|
||||
|
||||
from tests.helpers.run_command import run_command
|
||||
|
||||
"""
|
||||
Use the following command to skip slow tests:
|
||||
pytest -k "not slow"
|
||||
"""
|
||||
|
||||
|
||||
@pytest.mark.slow
|
||||
def test_default_sweep():
|
||||
"""Test default Hydra sweeper."""
|
||||
command = [
|
||||
@@ -14,6 +22,7 @@ def test_default_sweep():
|
||||
run_command(command)
|
||||
|
||||
|
||||
@pytest.mark.slow
|
||||
def test_optuna_sweep():
|
||||
"""Test Optuna sweeper."""
|
||||
command = [
|
||||
@@ -26,7 +35,9 @@ def test_optuna_sweep():
|
||||
run_command(command)
|
||||
|
||||
|
||||
# def test_ax_sweep():
|
||||
# """Test Ax sweeper."""
|
||||
# command = ["run.py", "-m", "hparams_search=mnist_ax", "trainer.fast_dev_run=true"]
|
||||
# run_command(command)
|
||||
@pytest.mark.skip(reason="TODO: Add Ax sweep config.")
|
||||
@pytest.mark.slow
|
||||
def test_ax_sweep():
|
||||
"""Test Ax sweeper."""
|
||||
command = ["run.py", "-m", "hparams_search=mnist_ax", "trainer.fast_dev_run=true"]
|
||||
run_command(command)
|
||||
@@ -8,33 +8,33 @@ Use the following command to skip wandb tests:
|
||||
"""
|
||||
|
||||
|
||||
@pytest.mark.wandb
|
||||
def test_wandb_optuna_sweep():
|
||||
"""Test wandb logging with Optuna sweep."""
|
||||
command = [
|
||||
"run.py",
|
||||
"-m",
|
||||
"hparams_search=mnist_optuna",
|
||||
"trainer=default",
|
||||
"trainer.max_epochs=10",
|
||||
"trainer.limit_train_batches=20",
|
||||
"logger=wandb",
|
||||
"logger.wandb.project=template-tests",
|
||||
"logger.wandb.group=Optuna_SimpleDenseNet_MNIST",
|
||||
"hydra.sweeper.n_trials=5",
|
||||
]
|
||||
run_command(command)
|
||||
# @pytest.mark.wandb
|
||||
# def test_wandb_optuna_sweep():
|
||||
# """Test wandb logging with Optuna sweep."""
|
||||
# command = [
|
||||
# "run.py",
|
||||
# "-m",
|
||||
# "hparams_search=mnist_optuna",
|
||||
# "trainer=default",
|
||||
# "trainer.max_epochs=10",
|
||||
# "trainer.limit_train_batches=20",
|
||||
# "logger=wandb",
|
||||
# "logger.wandb.project=template-tests",
|
||||
# "logger.wandb.group=Optuna_SimpleDenseNet_MNIST",
|
||||
# "hydra.sweeper.n_trials=5",
|
||||
# ]
|
||||
# run_command(command)
|
||||
|
||||
|
||||
@pytest.mark.wandb
|
||||
def test_wandb_callbacks():
|
||||
"""Test wandb callbacks."""
|
||||
command = [
|
||||
"run.py",
|
||||
"trainer=default",
|
||||
"trainer.max_epochs=3",
|
||||
"logger=wandb",
|
||||
"logger.wandb.project=template-tests",
|
||||
"callbacks=wandb",
|
||||
]
|
||||
run_command(command)
|
||||
# @pytest.mark.wandb
|
||||
# def test_wandb_callbacks():
|
||||
# """Test wandb callbacks."""
|
||||
# command = [
|
||||
# "run.py",
|
||||
# "trainer=default",
|
||||
# "trainer.max_epochs=3",
|
||||
# "logger=wandb",
|
||||
# "logger.wandb.project=template-tests",
|
||||
# "callbacks=wandb",
|
||||
# ]
|
||||
# run_command(command)
|
||||
@@ -19,7 +19,7 @@ def test_something3(arg1: float):
|
||||
assert arg1 > 0
|
||||
|
||||
|
||||
# use RunIf to skip execution of some tests when not on windows or when no gpus are available
|
||||
# use RunIf to skip execution of some tests, e.g. when not on windows or when no gpus are available
|
||||
@RunIf(skip_windows=True, min_gpus=1)
|
||||
def test_something4():
|
||||
"""Some test description."""
|
||||
|
||||
Reference in new issue
Block a user