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

[ci] xfail failing ethosu codegen tests #12508

Merged
merged 1 commit into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions python/tvm/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1705,6 +1705,30 @@ def fetch_model_from_url(
return tvmc_model.mod, tvmc_model.params


def xfail_parameterizations(*xfail_params, 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
combination of parameters.
"""
xfail_params = set(xfail_params)

def decorator(func):
@functools.wraps(func)
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)

return func(request, *args, **kwargs)

return wrapper

return decorator


def main():
test_file = inspect.getsourcefile(sys._getframe(1))
sys.exit(pytest.main([test_file] + sys.argv[1:]))
Expand Down
20 changes: 18 additions & 2 deletions tests/python/contrib/test_ethosu/test_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,11 @@ def binary_elementwise(lhs, rhs):
([1, 4, 4], [4, 1]),
],
)
@tvm.testing.xfail_parameterizations(
"ifm_shape0-ifm2_shape0-ethos-u55-64", reason="See https://github.com/apache/tvm/issues/12511"
)
def test_binary_add_with_non_4d_shapes(
request,
accel_type,
ifm_shape,
ifm2_shape,
Expand Down Expand Up @@ -604,7 +608,12 @@ def rounding_right_shift(lhs, rhs):
@pytest.mark.parametrize("accel_type", ACCEL_TYPES)
@pytest.mark.parametrize("ifm_shape", [(3, 2), (1, 15, 11, 7), (3, 1, 12), (400,)])
@pytest.mark.parametrize("ifm_scale, ifm_zp, ofm_scale, ofm_zp", [(1, 0, 1, 0), (0.015, 3, 0.2, 5)])
def test_ethosu_identity_codegen(ifm_shape, ifm_scale, ifm_zp, ofm_scale, ofm_zp, accel_type):
@tvm.testing.xfail_parameterizations(
"1-0-1-0-ifm_shape3-ethos-u55-128", reason="See https://github.com/apache/tvm/issues/12511"
)
def test_ethosu_identity_codegen(
request, ifm_shape, ifm_scale, ifm_zp, ofm_scale, ofm_zp, accel_type
):
np.random.seed(0)

def create_model():
Expand Down Expand Up @@ -682,7 +691,10 @@ def create_model():
([5000], [123], [2151]),
],
)
def test_tflite_slice(accel_type, ifm_shape, begin, size):
@tvm.testing.xfail_parameterizations(
"ifm_shape3-begin3-size3-ethos-u55-32", reason="See https://github.com/apache/tvm/issues/12511"
)
def test_tflite_slice(request, accel_type, ifm_shape, begin, size):
np.random.seed(0)

@tf.function
Expand Down Expand Up @@ -717,7 +729,11 @@ def strided_slice_func(x):
"ifm_shape",
[[1, 5, 12, 4], [1, 1, 2], [4, 3, 2], [10, 20], [345]],
)
@tvm.testing.xfail_parameterizations(
"ifm_shape4-ABS-ethos-u55-64", reason="See https://github.com/apache/tvm/issues/12511"
)
def test_ethosu_unary_elementwise(
request,
accel_type,
operator_type,
ifm_shape,
Expand Down