Skip to content

Remove duplicated inference unit tests - #3951

Merged
mrwyattii merged 2 commits into
masterfrom
mrwyattii/fix-duplicate-inf-tests
Jul 18, 2023
Merged

mrwyattii merged 2 commits into
masterfrom
mrwyattii/fix-duplicate-inf-tests

Conversation

@mrwyattii

@mrwyattii mrwyattii commented Jul 13, 2023 •

Copy link
Copy Markdown
Contributor

In our inference unit tests, we were seeing duplicated tests due to the use of invalid_test fixture. Because this fixture used model_w_task, dtype, enable_cuda_graph, enable_triton fixtures, any test that used this fixture but did not use all of those fixtures would have duplicated tests generated. A short example to show the problem:

@pytest.fixture
def invalid_test(model_w_task, dtype):
    pass

@pytest.fixture(params=[("gpt2", "text-generation")], ids=["gpt2"])
def model_w_task(request):
    return request.param

@pytest.fixture(params=["fp16", "fp32"])
def dtype(request):
    return request.param

class TestExample(DistributedTest):
    def test(self, model_w_task):
        pass

The generated tests would be:

test[gpt2-fp16]
test[gpt2-fp32]

So despite the test not using the dtype fixture directly, the tests were still generated.

Resolved that issue by making the invalid test check a function called inside the tests.

@mrwyattii
mrwyattii enabled auto-merge July 18, 2023 21:37
@mrwyattii
mrwyattii added this pull request to the merge queue Jul 18, 2023
Merged via the queue into master with commit 04b1f58 Jul 18, 2023
@mrwyattii
mrwyattii deleted the mrwyattii/fix-duplicate-inf-tests branch July 20, 2023 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants