Skip to content

Commit 5cde43d

Browse files
Eashan Gargfacebook-github-bot
authored andcommitted
Conv Combos with Simulator
Summary: Conv Combos that fail in simulator Differential Revision: D66217464
1 parent 709e739 commit 5cde43d

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

backends/arm/test/ops/test_conv_combos.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,32 @@ def _test_conv_combo_ethos_BI_pipeline(
253253
.to_executorch()
254254
)
255255

256+
def _test_conv_combo_ethos_MI_pipeline(
257+
self,
258+
module: torch.nn.Module,
259+
compile_spec: CompileSpec,
260+
test_data: Tuple[torch.Tensor],
261+
atol: float = 1e-3,
262+
rtol: float = 1e-3,
263+
):
264+
(
265+
ArmTester(
266+
module,
267+
example_inputs=test_data,
268+
compile_spec=compile_spec,
269+
)
270+
.quantize()
271+
.export()
272+
.to_edge()
273+
.partition()
274+
.check_count({"torch.ops.higher_order.executorch_call_delegate": 1})
275+
.check_not(list(module.edge_op_list))
276+
.to_executorch()
277+
.run_method_and_compare_outputs(
278+
inputs=test_data, atol=atol, rtol=rtol, qtol=1
279+
)
280+
)
281+
256282
####################
257283
## Conv + meandim ##
258284
####################
@@ -272,6 +298,14 @@ def test_conv_meandim_u55_BI(self):
272298
model.get_inputs(),
273299
)
274300

301+
def test_conv_meandim_u55_MI(self):
302+
model = ComboConv2dMeandim()
303+
self._test_conv_combo_ethos_MI_pipeline(
304+
model,
305+
common.get_u55_compile_spec(permute_memory_to_nhwc=True),
306+
model.get_inputs(),
307+
)
308+
275309
def test_conv_meandim_u85_BI(self):
276310
model = ComboConv2dMeandim()
277311
self._test_conv_combo_ethos_BI_pipeline(
@@ -297,6 +331,12 @@ def test_conv_batchnorm_relu6_u55_BI(self):
297331
model, common.get_u55_compile_spec(), model.get_inputs()
298332
)
299333

334+
def test_conv_batchnorm_relu6_u55_MI(self):
335+
model = ComboConvBatchnormRelu6()
336+
self._test_conv_combo_ethos_MI_pipeline(
337+
model, common.get_u55_compile_spec(), model.get_inputs()
338+
)
339+
300340
def test_conv_batchnorm_relu_u85_BI(self):
301341
model = ComboConvBatchnormRelu6()
302342
self._test_conv_combo_ethos_BI_pipeline(
@@ -328,6 +368,14 @@ def test_conv_relu6_u55_BI(self, test_data: torch.Tensor):
328368
model, common.get_u55_compile_spec(permute_memory_to_nhwc=True), test_data
329369
)
330370

371+
@parameterized.expand(ComboConvRelu6.test_data)
372+
def test_conv_relu6_u55_MI(self, test_data: torch.Tensor):
373+
model = ComboConvRelu6()
374+
test_data = (test_data,)
375+
self._test_conv_combo_ethos_MI_pipeline(
376+
model, common.get_u55_compile_spec(permute_memory_to_nhwc=True), test_data
377+
)
378+
331379
@parameterized.expand(ComboConvRelu6.test_data)
332380
def test_conv_relu6_u85_BI(self, test_data: torch.Tensor):
333381
model = ComboConvRelu6()
@@ -357,6 +405,14 @@ def test_block_bottleneck_residual_u55_BI(self):
357405
model.get_inputs(),
358406
)
359407

408+
def test_block_bottleneck_residual_u55_MI(self):
409+
model = ComboBlockBottleneckResidual()
410+
self._test_conv_combo_ethos_MI_pipeline(
411+
model,
412+
common.get_u55_compile_spec(permute_memory_to_nhwc=True),
413+
model.get_inputs(),
414+
)
415+
360416
def test_block_bottleneck_residual_u85_BI(self):
361417
model = ComboBlockBottleneckResidual()
362418
self._test_conv_combo_ethos_BI_pipeline(
@@ -390,6 +446,16 @@ def test_conv_avgpool2d_u55_BI(self, test_data: torch.Tensor):
390446
test_data,
391447
)
392448

449+
@parameterized.expand(ComboConvAvgPool2d.test_data)
450+
def test_conv_avgpool2d_u55_MI(self, test_data: torch.Tensor):
451+
model = ComboConvAvgPool2d()
452+
test_data = (test_data,)
453+
self._test_conv_combo_ethos_MI_pipeline(
454+
model,
455+
common.get_u55_compile_spec(),
456+
test_data,
457+
)
458+
393459
@parameterized.expand(ComboConvAvgPool2d.test_data)
394460
def test_conv_avgpool2d_u85_BI(self, test_data: torch.Tensor):
395461
model = ComboConvAvgPool2d()

0 commit comments

Comments
 (0)