1212from executorch .backends .arm .test import common
1313
1414from executorch .backends .arm .test .tester .arm_tester import ArmTester
15+ from executorch .exir .backend .backend_details import CompileSpec
1516from parameterized import parameterized
1617
1718
@@ -148,8 +149,8 @@ def forward(self, x):
148149 batches = 1 ,
149150)
150151
151- conv1d_2_1x1x14_st2 = Conv1d (
152- in_channels = 1 ,
152+ conv1d_2_1x2x14_st2 = Conv1d (
153+ in_channels = 2 ,
153154 out_channels = 1 ,
154155 kernel_size = 2 ,
155156 stride = 2 ,
@@ -209,20 +210,13 @@ def forward(self, x):
209210 ("3_1x3x256_st1" , conv1d_3_1x3x256_st1 ),
210211 ("3_1x3x12_st2_pd1" , conv1d_3_1x3x12_st2_pd1 ),
211212 ("1_1x2x128_st1" , conv1d_1_1x2x128_st1 ),
212- ("2_1x1x14_st2 " , conv1d_2_1x1x14_st2 ),
213+ ("2_1x2x14_st2 " , conv1d_2_1x2x14_st2 ),
213214 ("5_3x2x128_st1" , conv1d_5_3x2x128_st1 ),
214215 ("3_1x3x224_st2_pd1" , conv1d_3_1x3x224_st2_pd1 ),
215216 ("two_conv1d_nobias" , two_conv1d_nobias ),
216217 ("two_conv1d" , two_conv1d ),
217218]
218219
219- # Expected fails on Ethos-U55/U65. This is a known limitation.
220- # Check: https://review.mlplatform.org/plugins/gitiles/ml/ethos-u/ethos-u-vela/+/refs/heads/main/SUPPORTED_OPS.md
221- # IFM Tensor batch size must be 1 - [FULLY_CONNECTED, RESHAPE, SHAPE, SLICE, SOFTMAX, SPLIT, SPLIT_V, SQUEEZE, STRIDED_SLICE, UNPACK]
222- testsuite_u55 = testsuite .copy ()
223- testsuite_u55 .remove (("2_3x2x40_nobias" , conv1d_2_3x2x40_nobias ))
224- testsuite_u55 .remove (("5_3x2x128_st1" , conv1d_5_3x2x128_st1 ))
225-
226220
227221class TestConv1D (unittest .TestCase ):
228222 def _test_conv1d_tosa_MI_pipeline (
@@ -264,15 +258,14 @@ def _test_conv1d_tosa_BI_pipeline(
264258 .run_method_and_compare_outputs (inputs = test_data , qtol = 1 )
265259 )
266260
267- def _test_conv1d_u55_BI_pipeline (
268- self , module : torch .nn .Module , test_data : Tuple [torch .Tensor ]
261+ def _test_conv1d_ethosu_BI_pipeline (
262+ self ,
263+ module : torch .nn .Module ,
264+ compile_spec : CompileSpec ,
265+ test_data : Tuple [torch .Tensor ],
269266 ):
270267 (
271- ArmTester (
272- module ,
273- example_inputs = test_data ,
274- compile_spec = common .get_u55_compile_spec (permute_memory_to_nhwc = True ),
275- )
268+ ArmTester (module , example_inputs = test_data , compile_spec = compile_spec )
276269 .quantize ()
277270 .export ()
278271 .to_edge ()
@@ -291,7 +284,15 @@ def test_conv1d_tosa_BI(self, test_name, model):
291284 self ._test_conv1d_tosa_BI_pipeline (model , model .get_inputs ())
292285
293286 # Expeted to fail as Conv1D requires transpoes which isn't supported on u55
294- @parameterized .expand (testsuite_u55 )
287+ @parameterized .expand (testsuite )
295288 @unittest .expectedFailure
296289 def test_conv1d_u55_BI (self , test_name , model ):
297- self ._test_conv1d_u55_BI_pipeline (model , model .get_inputs ())
290+ self ._test_conv1d_ethosu_BI_pipeline (
291+ model , common .get_u55_compile_spec (), model .get_inputs ()
292+ )
293+
294+ @parameterized .expand (testsuite )
295+ def test_conv1d_u85_BI (self , test_name , model ):
296+ self ._test_conv1d_ethosu_BI_pipeline (
297+ model , common .get_u85_compile_spec (), model .get_inputs ()
298+ )
0 commit comments