From 39ac33ab5d624d7506b7784c4a6beb1efa44401d Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Wed, 3 Apr 2024 10:34:37 -0500 Subject: [PATCH 1/3] [CI] Disable flaky unit test The `test_auto_scheduler_tuning.py::test_tuning_cuda` unit test has sporadic failures on unrelated changes. Seems to be triggered when tuning does not find any valid candidates, and so the "best" candidate of a no-op triggers a "did you forget to bind" error message. --- .../relay/test_auto_scheduler_tuning.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/python/relay/test_auto_scheduler_tuning.py b/tests/python/relay/test_auto_scheduler_tuning.py index 735486ef27c6..3e0f9243ac8b 100644 --- a/tests/python/relay/test_auto_scheduler_tuning.py +++ b/tests/python/relay/test_auto_scheduler_tuning.py @@ -26,7 +26,16 @@ from test_auto_scheduler_task_extraction import get_network -def tune_network(network, target): +network = tvm.testing.parameter( + "mlp", + pytest.param("winograd-test", mark=pytest.mark.xfail(reason="Flaky unit test")), +) + + +@tvm.testing.requires_cuda +def test_tuning_cuda(network): + target = "cuda" + # Extract tasks mod, params = get_network(network) target = tvm.target.Target(target) @@ -104,11 +113,5 @@ def get_output(data, lib): tvm.testing.assert_allclose(actual_output2, expected_output, rtol=1e-4, atol=1e-4) -@tvm.testing.requires_cuda -def test_tuning_cuda(): - tune_network("mlp", "cuda") - tune_network("winograd-test", "cuda") - - if __name__ == "__main__": - test_tuning_cuda() + tvm.testing.main() From bf9a029dacd83fb8c2e5d2b5510b1fd3d64c325d Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Thu, 4 Apr 2024 16:48:44 -0500 Subject: [PATCH 2/3] Import pytest before use --- tests/python/relay/test_auto_scheduler_tuning.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/python/relay/test_auto_scheduler_tuning.py b/tests/python/relay/test_auto_scheduler_tuning.py index 3e0f9243ac8b..8ec7db003095 100644 --- a/tests/python/relay/test_auto_scheduler_tuning.py +++ b/tests/python/relay/test_auto_scheduler_tuning.py @@ -18,6 +18,7 @@ import tempfile import numpy as np +import pytest from tvm import auto_scheduler, relay from tvm.contrib import graph_executor From 8011c541f053c1f62450f9d1a165092ee0af44ce Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Thu, 4 Apr 2024 20:00:55 -0500 Subject: [PATCH 3/3] typo fix --- tests/python/relay/test_auto_scheduler_tuning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python/relay/test_auto_scheduler_tuning.py b/tests/python/relay/test_auto_scheduler_tuning.py index 8ec7db003095..e2f754aaf4e0 100644 --- a/tests/python/relay/test_auto_scheduler_tuning.py +++ b/tests/python/relay/test_auto_scheduler_tuning.py @@ -29,7 +29,7 @@ network = tvm.testing.parameter( "mlp", - pytest.param("winograd-test", mark=pytest.mark.xfail(reason="Flaky unit test")), + pytest.param("winograd-test", marks=pytest.mark.xfail(reason="Flaky unit test")), )