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

[Task] Introduce 1-gpu vs 2-gpu pytest markers #992

Open
1 of 5 tasks
nv-alaiacano opened this issue May 23, 2023 · 0 comments
Open
1 of 5 tasks

[Task] Introduce 1-gpu vs 2-gpu pytest markers #992

nv-alaiacano opened this issue May 23, 2023 · 0 comments
Labels
Milestone

Comments

@nv-alaiacano
Copy link
Contributor

nv-alaiacano commented May 23, 2023

Description

We are getting resource constrained on how many multi-GPU tests we can run. To address this, we should split apart which tests require being run on 2 GPUs and which can run on a single.

The approach is:

  • Create pytest markers (registering them in pytest.ini to avoid warnings): multigpu and singlegpu
  • Create new github action workflows to execute on the 2GPU runners, and use the multigpu test fixture.
  • Run the rest of the tests on the 1GPU runners

This will allow us to run the single and multi-gpu tests in parallel, and only use the limited multi-gpu resources for tests that actually require it.

Annotating tests

To run tests only in multi-gpu settings:

@pytest.mark.multigpu
def test_multi():
    assert True

To run tests in both single- and multiple-gpu settings:

@pytest.mark.singlegpu
@pytest.mark.multigpu
def test_both():
    assert True

To run tests in single-gpu settings only, no annotation is needed:

def test_single():
    assert True

Running tests

To execute the tests, use the following pytest commands:

To run multi-gpu tests:

pytest -m "multigpu"

To run single-gpu tests, we need two commands. One will run the unannotated tests (most of them) the other will run the single-gpu setting of the ones marked as both singlegpu and multigpu

pytest -m "not multigpu"
pytest  -m "singlegpu"

Repositories

@nv-alaiacano nv-alaiacano changed the title [Task] Introduce 1-gpu vs 2-gpu test fixtures [Task] Introduce 1-gpu vs 2-gpu pytest markers Jun 1, 2023
@nv-alaiacano nv-alaiacano added this to the Merlin 23.07 milestone Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant