Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
faadc3f
Check the bias length in the portable convolution kernel
shoumikhin Oct 31, 2026
4cf747b
Reject groups below 1 in the portable convolution kernel
shoumikhin Oct 31, 2026
6d516e8
Support 3-D convolution in the portable convolution kernel
shoumikhin Oct 31, 2026
2d2c7d8
Validate groups before the convolution bias length check
shoumikhin Oct 31, 2026
faae797
Keep get_unsqueezed_sizes and get_unsqueezed_dim_order
shoumikhin Oct 31, 2026
a920600
Test 3-D convolution with channels-last tensors and single values
shoumikhin Oct 31, 2026
48fc127
Reject a convolution kernel that is larger than the padded input
shoumikhin Oct 31, 2026
cdb77d8
Keep the transposed convolution range helpers out of line
shoumikhin Oct 31, 2026
a021641
Make the 3-D convolution tests catch single-value and weight stride m…
shoumikhin Oct 31, 2026
0e88e60
Bound stride, padding and dilation in the convolution checks
shoumikhin Oct 31, 2026
469c032
Check the convolution bias dtype
shoumikhin Oct 31, 2026
d5dd7d9
Say which build catches the groups overflow case
shoumikhin Oct 31, 2026
007e041
Make the Cortex-M conv3d test exercise the 3-D indexing
shoumikhin Oct 31, 2026
d15cffd
Use a contiguous input in the Cortex-M conv3d test
shoumikhin Oct 31, 2026
e050865
Reject empty spatial dims and output sizes above 32 bits in convolutions
shoumikhin Nov 1, 2026
bbb6ba9
Reject negative convolution output sizes before narrowing them
shoumikhin Nov 1, 2026
6db35c7
Make the dilation case show that the 32-bit bound matters
shoumikhin Nov 1, 2026
16850d3
Let the convolution input and output have different dim orders
shoumikhin Nov 1, 2026
067fc8e
Reject a convolution weight with an empty kernel dim
shoumikhin Nov 1, 2026
a63054a
Allow an empty spatial dim when the batch or channel dim is empty
shoumikhin Nov 1, 2026
d814303
Use a contiguous input in the Cortex-M conv3d test again
shoumikhin Nov 1, 2026
4631d0d
Test the kernel size check with a 1-D convolution too
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
Loading
Loading