Skip to content
Open
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
8 changes: 7 additions & 1 deletion backends/test/suite/flow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import Callable

from executorch.backends.test.harness import Tester
Expand Down Expand Up @@ -35,6 +35,12 @@ class TestFlow:
is_delegated: bool = True
""" Indicates whether the flow is expected to generate CALL_DELEGATE nodes. """

skip_patterns: list[str] = field(default_factory=lambda: [])
""" Tests with names containing any substrings in this list are skipped. """

def should_skip_test(self, test_name: str) -> bool:
return any(pattern in test_name for pattern in self.skip_patterns)


def all_flows() -> dict[str, TestFlow]:
flows = []
Expand Down
1 change: 1 addition & 0 deletions backends/test/suite/flows/coreml.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def _create_coreml_flow(
CoreMLTester, minimum_deployment_target=minimum_deployment_target
),
quantize=quantize,
skip_patterns=["test_argmin", "test_argmax"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this play when doing a cross delegate % - pass like comparison?

)


Expand Down
1 change: 1 addition & 0 deletions backends/test/suite/flows/vulkan.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def _create_vulkan_flow_base(
tester_factory=VulkanTester,
quantize=quantize_stage_factory is not None,
quantize_stage_factory=quantize_stage_factory,
skip_patterns=["float16", "float64"], # Not supported in swiftshader
)


Expand Down
5 changes: 5 additions & 0 deletions backends/test/suite/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ def wrapped_test(self):
"use_dynamic_shapes": use_dynamic_shapes,
}
with TestContext(test_name, test_func.__name__, flow.name, params):
if flow.should_skip_test(test_name):
raise unittest.SkipTest(
f"Skipping test due to matching flow {flow.name} skip patterns"
)

test_func(self, flow, dtype, use_dynamic_shapes)

wrapped_test._name = test_func.__name__ # type: ignore
Expand Down
5 changes: 5 additions & 0 deletions backends/test/suite/operators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ def _make_wrapped_test(
):
def wrapped_test(self):
with TestContext(test_name, test_base_name, flow.name, params):
if flow.should_skip_test(test_name):
raise unittest.SkipTest(
f"Skipping test due to matching flow {flow.name} skip patterns"
)

test_kwargs = copy.copy(params) or {}
test_kwargs["flow"] = flow

Expand Down
Loading