Skip to content

Commit 5971a4b

Browse files
authored
Skip dynamic shape flow tests for Arm backends. (#19368)
They are not supported. This is to remove noise of the flow output to make it easier to track. cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell Signed-off-by: Erik Lundell <erik.lundell@arm.com>
1 parent b04cc65 commit 5971a4b

3 files changed

Lines changed: 33 additions & 9 deletions

File tree

backends/test/suite/conftest.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ def pytest_collection_modifyitems(config, items):
2727
flow = callspec.params.get("test_runner")
2828
if isinstance(flow, TestFlow):
2929
test_name = item.originalname or item.name
30-
if flow.should_skip_test(test_name):
31-
item.add_marker(
32-
pytest.mark.skip(reason=f"Skipped by {flow.name} skip_patterns")
33-
)
30+
should_skip, reason = flow.should_skip_test(test_name, callspec.params)
31+
if should_skip:
32+
item.add_marker(pytest.mark.skip(reason))
3433

3534
item_path = str(getattr(item, "path", ""))
3635
for suite_prefix, timeout_s in FLOW_TEST_CASE_TIMEOUTS.items():

backends/test/suite/flow.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2025 Arm Limited and/or its affiliates.
1+
# Copyright 2025-2026 Arm Limited and/or its affiliates.
22
#
33
# This source code is licensed under the BSD-style license found in the
44
# LICENSE file in the root directory of this source tree.
@@ -7,7 +7,7 @@
77
import os
88

99
from dataclasses import dataclass, field
10-
from typing import Callable
10+
from typing import Any, Callable
1111

1212
from executorch.backends.test.harness import Tester
1313
from executorch.backends.test.harness.stages import Quantize
@@ -44,11 +44,30 @@ class TestFlow:
4444
skip_patterns: list[str] = field(default_factory=lambda: [])
4545
""" Tests with names containing any substrings in this list are skipped. """
4646

47+
param_skip_reasons: dict[str, dict[Any, str]] = field(default_factory=dict)
48+
""" Skip tests with a given reason when a pytest parameter matches a given value."""
49+
4750
supports_serialize: bool = True
4851
""" True if the test flow supports the Serialize stage. """
4952

50-
def should_skip_test(self, test_name: str) -> bool:
51-
return any(pattern in test_name for pattern in self.skip_patterns)
53+
def should_skip_test(
54+
self, test_name: str, params: dict[str, Any] | None = None
55+
) -> tuple[bool, str]:
56+
if any(pattern in test_name for pattern in self.skip_patterns):
57+
return True, f"Skipped by {self.name} skip_patterns"
58+
59+
if params is None:
60+
return False, ""
61+
62+
for param_name, values_to_skip in self.param_skip_reasons.items():
63+
if param_name not in params:
64+
continue
65+
66+
parameter = params[param_name]
67+
if parameter in values_to_skip:
68+
return True, values_to_skip[parameter]
69+
70+
return False, ""
5271

5372
def __str__(self):
5473
return self.name

backends/test/suite/flows/arm.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2025 Arm Limited and/or its affiliates.
1+
# Copyright 2025-2026 Arm Limited and/or its affiliates.
22
#
33
# This source code is licensed under the BSD-style license found in the
44
# LICENSE file in the root directory of this source tree.
@@ -53,6 +53,12 @@ def create_quantize_stage() -> Quantize:
5353
supports_serialize=support_serialize,
5454
quantize=quantize,
5555
quantize_stage_factory=(create_quantize_stage if quantize else False), # type: ignore
56+
param_skip_reasons={
57+
"use_dynamic_shapes": {
58+
True: "Dynamic-shape suite variants are not supported by the current ARM "
59+
"TOSA/Ethos-U/VGF flows."
60+
}
61+
},
5662
)
5763

5864

0 commit comments

Comments
 (0)