diff --git a/python/tvm/testing/utils.py b/python/tvm/testing/utils.py index ad1e003d6e3f..2babe442ca3c 100644 --- a/python/tvm/testing/utils.py +++ b/python/tvm/testing/utils.py @@ -1752,13 +1752,13 @@ def fetch_model_from_url( return tvmc_model.mod, tvmc_model.params -def xfail_parameterizations(*xfail_params, reason): +def _mark_parameterizations(*params, marker_fn, reason): """ - Mark tests with a nodeid parameters that exactly matches one in params as - xfail. Useful for quickly marking tests as xfail when they have a large + Mark tests with a nodeid parameters that exactly matches one in params. + Useful for quickly marking tests as xfail when they have a large combination of parameters. """ - xfail_params = set(xfail_params) + params = set(params) def decorator(func): @functools.wraps(func) @@ -1766,8 +1766,10 @@ def wrapper(request, *args, **kwargs): if "[" in request.node.name and "]" in request.node.name: # Strip out the test name and the [ and ] brackets params_from_name = request.node.name[len(request.node.originalname) + 1 : -1] - if params_from_name in xfail_params: - pytest.xfail(reason=f"xfail on nodeid {request.node.nodeid}: " + reason) + if params_from_name in params: + marker_fn( + reason=f"{marker_fn.__name__} on nodeid {request.node.nodeid}: " + reason + ) return func(request, *args, **kwargs) @@ -1776,6 +1778,14 @@ def wrapper(request, *args, **kwargs): return decorator +def xfail_parameterizations(*xfail_params, reason): + return _mark_parameterizations(*xfail_params, marker_fn=pytest.xfail, reason=reason) + + +def skip_parameterizations(*skip_params, reason): + return _mark_parameterizations(*skip_params, marker_fn=pytest.skip, reason=reason) + + def main(): test_file = inspect.getsourcefile(sys._getframe(1)) sys.exit(pytest.main([test_file] + sys.argv[1:])) diff --git a/tests/python/contrib/test_ethosu/test_codegen.py b/tests/python/contrib/test_ethosu/test_codegen.py index 28ea48f00932..89c87325baaf 100644 --- a/tests/python/contrib/test_ethosu/test_codegen.py +++ b/tests/python/contrib/test_ethosu/test_codegen.py @@ -368,7 +368,7 @@ def binary_elementwise(lhs, rhs): ) -@pytest.mark.xfail(strict=False, reason="See https://github.com/apache/tvm/issues/10487") +@pytest.mark.skip(reason="See https://github.com/apache/tvm/issues/12634") @pytest.mark.parametrize( "accel_type", ACCEL_TYPES, diff --git a/tests/python/contrib/test_ethosu/test_replace_depthwise_conv2d.py b/tests/python/contrib/test_ethosu/test_replace_depthwise_conv2d.py index 80aa74b8434d..32f75621fde0 100644 --- a/tests/python/contrib/test_ethosu/test_replace_depthwise_conv2d.py +++ b/tests/python/contrib/test_ethosu/test_replace_depthwise_conv2d.py @@ -75,7 +75,10 @@ ], ], ) -def test_depthwise_conv2d_single(trial): +@tvm.testing.skip_parameterizations( + "trial3", reason="See https://github.com/apache/tvm/issues/12841" +) +def test_depthwise_conv2d_single(request, trial): def _get_func( ifm_shape, channels, diff --git a/tests/python/unittest/test_roofline.py b/tests/python/unittest/test_roofline.py index e37f6e085bf6..61e6e06aa8f3 100644 --- a/tests/python/unittest/test_roofline.py +++ b/tests/python/unittest/test_roofline.py @@ -35,6 +35,7 @@ @tvm.testing.parametrize_targets("llvm", "cuda") +@pytest.mark.skip(reason="See https://github.com/apache/tvm/issues/12955") def test_estimate_peak_flops(target, dev): server = rpc.Server(key="roofline_flops") remote = rpc.connect("127.0.0.1", server.port, key="roofline_flops")