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
13 changes: 5 additions & 8 deletions backends/cortex_m/test/ops/test_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class CortexMConv3D(torch.nn.Module):
def __init__(self, *args, **kwargs):
super().__init__()
self.conv = torch.nn.Conv3d(*args, **kwargs, bias=False)
self.conv.weight.data.fill_(2.0)

def forward(self, x):
return self.conv(x)
Expand Down Expand Up @@ -223,13 +222,12 @@ def forward(self, x):
model=CortexMConv1D(1, 1, 1),
example_inputs=(ramp_tensor(0, 10, (1, 3, 2)),),
),
# Contiguous on purpose: the Arm test runner only reorders NHWC inputs and its
# own 5-D order, so a channels_last_3d input would reach the simulator in the
# wrong byte order.
"conv3d": McuTestCase(
model=CortexMConv3D(1, 1, 1),
example_inputs=(
ramp_tensor(-1000, 1000, (2, 1, 3, 3, 3)).to(
memory_format=torch.channels_last_3d
),
),
model=CortexMConv3D(2, 4, (2, 3, 3), stride=(1, 2, 2), padding=1),
example_inputs=(ramp_tensor(-10, 10, (2, 2, 4, 6, 6)),),
),
"conv2d_x3": McuTestCase(
model=CortexMConv2Dx3(),
Expand Down Expand Up @@ -349,7 +347,6 @@ def test_dialect_conv2d(test_case, cortex_m_target):

xfails_implementation: dict[str, xfail_type] = {
"conv1d": "Currently not supported.",
"conv3d": "Currently not supported.",
}


Expand Down
21 changes: 1 addition & 20 deletions backends/test/suite/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
TestResult,
)
from executorch.exir import EdgeProgramManager
from executorch.exir.dialects._ops import ops as exir_ops


# A list of all runnable test suites and the corresponding python package.
Expand All @@ -47,24 +46,6 @@
}


def _graph_has_unsupported_patterns(program: torch.export.ExportedProgram) -> bool:
# Returns true if the model contains patterns that will fail when running on the ET
# portable kernel library.

# Check for 3d convolutions. All convs (1d, 2d, 3d) use the same op, so we need to look at
# the input meta to determine the rank.
for node in program.graph.nodes:
if (
node.op == "call_function"
and node.target == exir_ops.edge.aten.convolution.default
):
in_rank = node.args[0].meta["val"].dim()
if in_rank > 4:
return True

return False


def _get_test_seed(test_base_name: str) -> int:
# Set the seed based on the test base name to give consistent inputs between backends. Add the
# run seed to allow for reproducible results, but still allow for run-to-run variation.
Expand Down Expand Up @@ -185,7 +166,7 @@ def build_result(
# Check if any undelegated ops are in the unsupported ops set.
has_unsupported_ops = any(
op in UNSUPPORTED_PORTABLE_OPS for op in undelegated_op_counts.keys()
) or _graph_has_unsupported_patterns(edge_manager._etrecord.edge_dialect_program)
)

# Skip the test if there are unsupported portable ops remaining.
if has_unsupported_ops:
Expand Down
Loading
Loading