Skip to content
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
6 changes: 6 additions & 0 deletions backends/arm/test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ def parametrize(
arg_name: str,
test_data: dict[str, Any],
xfails: dict[str, xfail_type] | None = None,
skips: dict[str, str] | None = None,
strict: bool = True,
flakies: dict[str, int] | None = None,
) -> Decorator:
Expand All @@ -249,6 +250,8 @@ def parametrize(
"""
if xfails is None:
xfails = {}
if skips is None:
skips = {}
if flakies is None:
flakies = {}

Expand All @@ -259,6 +262,9 @@ def decorator_func(func: Callable[_P, _R]) -> Callable[_P, _R]:
if id in flakies:
# Mark this parameter as flaky with given reruns
marker = (pytest.mark.flaky(reruns=flakies[id]),)
elif id in skips:
# fail markers do not work with 'buck' based ci, so use skip instead
marker = (pytest.mark.skip(reason=skips[id]),)
elif id in xfails:
xfail_info = xfails[id]
reason = ""
Expand Down
10 changes: 8 additions & 2 deletions backends/arm/test/ops/test_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,18 +308,24 @@ def test_linear_16a8w_tosa_INT(test_data: torch.Tensor):


x_fails = {}
x_skips = {}

for test_name in [
"model_linear_rank4_zeros",
"model_linear_rank4_negative_ones",
"model_linear_rank4_negative_large_rand",
]:
for set_per_chan in ["True", "False"]:
x_fails[test_name + ",per_channel_quant={}".format(set_per_chan)] = (
key = test_name + ",per_channel_quant={}".format(set_per_chan)
reason = (
"MLETORCH-1452: AssertionError: Output 0 does not match reference output."
)
x_fails[key] = reason
# TODO: Check why xfail doesn't work for this buck target. In the interim rely on skip
x_skips[key] = reason


@common.parametrize("test_data", test_data_all_16a8w, x_fails)
@common.parametrize("test_data", test_data_all_16a8w, xfails=x_fails, skips=x_skips)
@common.XfailIfNoCorstone300
def test_linear_16a8w_u55_INT16(test_data: torch.Tensor):
"""Test linear operation with 16A8W quantization on U55 (16-bit activations, 8-bit weights)"""
Expand Down
Loading