Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
645f5f0
Check the bias length in the portable convolution kernel
shoumikhin Oct 31, 2026
f52cf11
Reject groups below 1 in the portable convolution kernel
shoumikhin Oct 31, 2026
439059c
Support 3-D convolution in the portable convolution kernel
shoumikhin Oct 31, 2026
f238842
Validate groups before the convolution bias length check
shoumikhin Oct 31, 2026
e1cf5c6
Keep get_unsqueezed_sizes and get_unsqueezed_dim_order
shoumikhin Oct 31, 2026
8fc1a13
Test 3-D convolution with channels-last tensors and single values
shoumikhin Oct 31, 2026
cdfd07f
Reject a convolution kernel that is larger than the padded input
shoumikhin Oct 31, 2026
38d9cc0
Keep the transposed convolution range helpers out of line
shoumikhin Oct 31, 2026
39c06b7
Make the 3-D convolution tests catch single-value and weight stride m…
shoumikhin Oct 31, 2026
d4abeaa
Bound stride, padding and dilation in the convolution checks
shoumikhin Oct 31, 2026
5a1a13b
Check the convolution bias dtype
shoumikhin Oct 31, 2026
6922c95
Say which build catches the groups overflow case
shoumikhin Oct 31, 2026
f9af79c
Make the Cortex-M conv3d test exercise the 3-D indexing
shoumikhin Oct 31, 2026
028cb71
Use a contiguous input in the Cortex-M conv3d test
shoumikhin Oct 31, 2026
854eac4
Reject empty spatial dims and output sizes above 32 bits in convolutions
shoumikhin Nov 1, 2026
fa1892f
Reject negative convolution output sizes before narrowing them
shoumikhin Nov 1, 2026
2dec077
Make the dilation case show that the 32-bit bound matters
shoumikhin Nov 1, 2026
2901e8c
Let the convolution input and output have different dim orders
shoumikhin Nov 1, 2026
126dd1a
Reject a convolution weight with an empty kernel dim
shoumikhin Nov 1, 2026
1eb86ee
Allow an empty spatial dim when the batch or channel dim is empty
shoumikhin Nov 1, 2026
c359b2b
Use a contiguous input in the Cortex-M conv3d test again
shoumikhin Nov 1, 2026
16c90c1
Test the kernel size check with a 1-D convolution too
shoumikhin Nov 1, 2026
07cee7e
Clarify comments in the portable convolution kernel
shoumikhin Nov 1, 2026
445faa1
Test more convolution argument and layout cases
shoumikhin Nov 1, 2026
33241ab
Run 3-D convolutions in the backend test suite
shoumikhin Nov 1, 2026
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