Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GPU marker to the regression test #2754

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,8 @@ max-returns = 10

[tool.ruff.pydocstyle]
convention = "google"

[tool.pytest.ini_options]
markers = [
"gpu: mark tests which require NVIDIA GPU device"
]
8 changes: 6 additions & 2 deletions tests/regression/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ def pytest_addoption(parser: pytest.Parser) -> None:
"--user-name",
type=str,
required=True,
help="Sign-off the user name who launched the regression tests this time, "
'e.g., `--user-name "John Doe"`.',
help="Sign-off the user name who launched the regression tests this time, " 'e.g., `--user-name "John Doe"`.',
)
parser.addoption(
"--dataset-root-dir",
Expand Down Expand Up @@ -154,3 +153,8 @@ def fxt_recipe_dir() -> Path:
import otx.recipe as otx_recipe

return Path(otx_recipe.__file__).parent


@pytest.fixture(params=[pytest.param("gpu", marks=pytest.mark.gpu)])
def fxt_accelerator(request: pytest.FixtureRequest) -> str:
return request.param
6 changes: 6 additions & 0 deletions tests/regression/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def _test_regression(
fxt_dataset_root_dir: Path,
fxt_tags: dict,
fxt_num_repeat: int,
fxt_accelerator: str,
tmpdir: pytest.TempdirFactory,
) -> None:
for seed in range(fxt_num_repeat):
Expand Down Expand Up @@ -73,6 +74,7 @@ def _test_regression(
f"data.data_format={test_case.dataset.data_format}",
f"base.output_dir={test_case.output_dir}",
f"seed={seed}",
f"trainer={fxt_accelerator}",
"test=true",
] + [
f"{key}={value}"
Expand Down Expand Up @@ -122,6 +124,7 @@ def test_regression(
fxt_dataset_root_dir: Path,
fxt_tags: dict,
fxt_num_repeat: int,
fxt_accelerator: str,
tmpdir: pytest.TempdirFactory,
) -> None:
self._test_regression(
Expand All @@ -130,6 +133,7 @@ def test_regression(
fxt_dataset_root_dir=fxt_dataset_root_dir,
fxt_tags=fxt_tags,
fxt_num_repeat=fxt_num_repeat,
fxt_accelerator=fxt_accelerator,
tmpdir=tmpdir,
)

Expand Down Expand Up @@ -170,6 +174,7 @@ def test_regression(
fxt_dataset_root_dir: Path,
fxt_tags: dict,
fxt_num_repeat: int,
fxt_accelerator: str,
tmpdir: pytest.TempdirFactory,
) -> None:
self._test_regression(
Expand All @@ -178,5 +183,6 @@ def test_regression(
fxt_dataset_root_dir=fxt_dataset_root_dir,
fxt_tags=fxt_tags,
fxt_num_repeat=fxt_num_repeat,
fxt_accelerator=fxt_accelerator,
tmpdir=tmpdir,
)