This is an automated email from the ASF dual-hosted git repository.

driazati pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new a64368be0e [ci] Skip failing tests in wheel (#11705)
a64368be0e is described below

commit a64368be0e76cc9ed28dcbaa910739c4700feb00
Author: Florin Blanaru <[email protected]>
AuthorDate: Wed Jun 15 19:16:25 2022 +0100

    [ci] Skip failing tests in wheel (#11705)
    
    Some python tests are failing in the wheel. This PR skips them if the 
environment variable `WHEEL_TEST` is set.
    
    This PR is related to https://github.com/tlc-pack/tlcpack/pull/115.
---
 python/tvm/testing/utils.py                         |  4 ++++
 tests/python/ci/test_ci.py                          |  4 +++-
 tests/python/ci/test_mergebot.py                    |  3 +++
 tests/python/unittest/test_runtime_profiling.py     |  1 +
 tests/python/unittest/test_target_codegen_vulkan.py |  2 ++
 tests/python/unittest/test_te_hybrid_script.py      | 15 +++++++++++++++
 6 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/python/tvm/testing/utils.py b/python/tvm/testing/utils.py
index 569ea0cca7..5a6ded9bcb 100644
--- a/python/tvm/testing/utils.py
+++ b/python/tvm/testing/utils.py
@@ -94,6 +94,10 @@ from tvm.error import TVMError
 
 SKIP_SLOW_TESTS = os.getenv("SKIP_SLOW_TESTS", "").lower() in {"true", "1", 
"yes"}
 
+skip_if_wheel_test = pytest.mark.skipif(
+    os.getenv("WHEEL_TEST") is not None, reason="Test not supported in wheel."
+)
+
 
 def assert_allclose(actual, desired, rtol=1e-7, atol=1e-7):
     """Version of np.testing.assert_allclose with `atol` and `rtol` fields set
diff --git a/tests/python/ci/test_ci.py b/tests/python/ci/test_ci.py
index f92e98c49c..b712b6780c 100644
--- a/tests/python/ci/test_ci.py
+++ b/tests/python/ci/test_ci.py
@@ -14,7 +14,7 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
+import os
 import subprocess
 import sys
 import json
@@ -74,6 +74,7 @@ def test_docs_comment(
     assert f"Dry run, would have posted {expected_url} with data 
{expected_body}." in proc.stderr
 
 
[email protected]_if_wheel_test
 def test_cc_reviewers(tmpdir_factory):
     reviewers_script = REPO_ROOT / "tests" / "scripts" / 
"github_cc_reviewers.py"
 
@@ -525,6 +526,7 @@ def assert_in(needle: str, haystack: str):
         raise AssertionError(f"item not found:\n{needle}\nin:\n{haystack}")
 
 
[email protected]_if_wheel_test
 def test_github_tag_teams(tmpdir_factory):
     tag_script = REPO_ROOT / "tests" / "scripts" / "github_tag_teams.py"
 
diff --git a/tests/python/ci/test_mergebot.py b/tests/python/ci/test_mergebot.py
index a565cc76a5..75f56eee56 100644
--- a/tests/python/ci/test_mergebot.py
+++ b/tests/python/ci/test_mergebot.py
@@ -15,6 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
+import os
 import subprocess
 import json
 import sys
@@ -22,6 +23,7 @@ import pytest
 
 from pathlib import Path
 
+import tvm.testing
 from test_utils import REPO_ROOT
 
 
@@ -137,6 +139,7 @@ test_data = {
 }
 
 
[email protected]_if_wheel_test
 @pytest.mark.parametrize(
     ["number", "filename", "expected", "comment", "user", "detail"],
     [tuple(d.values()) for d in test_data.values()],
diff --git a/tests/python/unittest/test_runtime_profiling.py 
b/tests/python/unittest/test_runtime_profiling.py
index ab22bd2b9c..adb5dee174 100644
--- a/tests/python/unittest/test_runtime_profiling.py
+++ b/tests/python/unittest/test_runtime_profiling.py
@@ -53,6 +53,7 @@ def read_csv(report):
 
 
 @pytest.mark.skipif(not profiler_vm.enabled(), reason="VM Profiler not 
enabled")
[email protected]_if_wheel_test
 @tvm.testing.parametrize_targets
 def test_vm(target, dev):
     dtype = "float32"
diff --git a/tests/python/unittest/test_target_codegen_vulkan.py 
b/tests/python/unittest/test_target_codegen_vulkan.py
index 3b42dd61dc..73e8402085 100644
--- a/tests/python/unittest/test_target_codegen_vulkan.py
+++ b/tests/python/unittest/test_target_codegen_vulkan.py
@@ -15,6 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
+import os
 import random
 import re
 import threading
@@ -258,6 +259,7 @@ def test_cumsum(target, dev):
     check_mod(target, dev, mod, x_np, res_np)
 
 
[email protected]_if_wheel_test
 def test_unique(target, dev):
     dtype = "int32"
     x = relay.var("x", shape=(relay.Any(),), dtype=dtype)
diff --git a/tests/python/unittest/test_te_hybrid_script.py 
b/tests/python/unittest/test_te_hybrid_script.py
index e9626e7f31..d6b11785a4 100644
--- a/tests/python/unittest/test_te_hybrid_script.py
+++ b/tests/python/unittest/test_te_hybrid_script.py
@@ -101,6 +101,7 @@ def outer_product(n, m, a, b):
     return c
 
 
[email protected]_if_wheel_test
 # Test global function
 # Test bridge between frontend and backend
 def test_outer_product():
@@ -159,6 +160,7 @@ def test_outer_product():
         assert key not in outer_product.__globals__.keys()
 
 
[email protected]_if_wheel_test
 # Test local function
 # Test allocation of local variable
 def test_fanout():
@@ -273,6 +275,7 @@ def test_looptype():
     run_and_check(func, ins, outs=outs)
 
 
[email protected]_if_wheel_test
 def test_if():
     @script
     def if_then_else(a):
@@ -387,6 +390,7 @@ def test_bind():
         run_and_check(func, ins, outs=outs, target="cuda")
 
 
[email protected]_if_wheel_test
 def test_math_intrin():
     @script
     def intrin_real(a):
@@ -432,6 +436,7 @@ def test_math_intrin():
     assert tvm_b.numpy()[0] == b[0]
 
 
[email protected]_if_wheel_test
 # test non caconical loops
 def test_non_zero():
     @te.hybrid.script
@@ -506,6 +511,7 @@ def test_allocate():
     run_and_check(func, ins, outs=outs, target="cuda")
 
 
[email protected]_if_wheel_test
 def test_upstream():
     @te.hybrid.script
     def upstream(a):
@@ -537,6 +543,7 @@ def test_upstream():
     tvm.testing.assert_allclose(tvm_d.numpy(), ref, 1e-5, 1e-5)
 
 
[email protected]_if_wheel_test
 def test_downstream():
     @te.hybrid.script
     def downstream(a):
@@ -564,6 +571,7 @@ def test_downstream():
     tvm.testing.assert_allclose(tvm_c.numpy(), ref, 1e-5, 1e-5)
 
 
[email protected]_if_wheel_test
 def test_const_param():
     @te.hybrid.script
     def add_something(a, b):
@@ -591,6 +599,7 @@ def test_const_param():
     tvm.testing.assert_allclose(nd_c.numpy(), ref, 1e-5, 1e-5)
 
 
[email protected]_if_wheel_test
 def test_value_index():
     @te.hybrid.script
     def kernel_a(a):
@@ -625,6 +634,7 @@ def test_value_index():
     tvm.testing.assert_allclose(res.numpy(), ref)
 
 
[email protected]_if_wheel_test
 def test_func_call():
     @te.hybrid.script
     def foo(a, b):
@@ -645,6 +655,7 @@ def test_func_call():
     run_and_check(func, ins, outs=outs)
 
 
[email protected]_if_wheel_test
 def test_bool():
     @te.hybrid.script
     def foo(a):
@@ -662,6 +673,7 @@ def test_bool():
     run_and_check(func, ins, outs=outs)
 
 
[email protected]_if_wheel_test
 def test_const_range():
     @te.hybrid.script
     def foo(a, b):
@@ -718,6 +730,7 @@ def test_const_range():
     run_and_check(func, ins, outs=outs)
 
 
[email protected]_if_wheel_test
 def test_schedule():
     @script
     def outer_product(a, b):
@@ -781,6 +794,7 @@ def test_schedule():
     # Test loop binds
 
 
[email protected]_if_wheel_test
 def test_capture():
     n = 8
 
@@ -801,6 +815,7 @@ def test_capture():
     run_and_check(func, ins, outs=outs)
 
 
[email protected]_if_wheel_test
 def test_array_inputs():
     @script
     def sum_array(inputs):

Reply via email to