Skip to content

Commit af4393b

Browse files
Eashan Gargfacebook-github-bot
authored andcommitted
Conv Combos with Simulator (#6977)
Summary: Conv Combos that fail in simulator Differential Revision: D66217464
1 parent dcacde0 commit af4393b

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

backends/arm/test/ops/test_conv_combos.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,33 @@ 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+
.serialize()
278+
.run_method_and_compare_outputs(
279+
inputs=test_data, atol=atol, rtol=rtol, qtol=1
280+
)
281+
)
282+
256283
####################
257284
## Conv + meandim ##
258285
####################
@@ -272,6 +299,14 @@ def test_conv_meandim_u55_BI(self):
272299
model.get_inputs(),
273300
)
274301

302+
def test_conv_meandim_u55_MI(self):
303+
model = ComboConv2dMeandim()
304+
self._test_conv_combo_ethos_MI_pipeline(
305+
model,
306+
common.get_u55_compile_spec(permute_memory_to_nhwc=True),
307+
model.get_inputs(),
308+
)
309+
275310
def test_conv_meandim_u85_BI(self):
276311
model = ComboConv2dMeandim()
277312
self._test_conv_combo_ethos_BI_pipeline(
@@ -297,6 +332,12 @@ def test_conv_batchnorm_relu6_u55_BI(self):
297332
model, common.get_u55_compile_spec(), model.get_inputs()
298333
)
299334

335+
def test_conv_batchnorm_relu6_u55_MI(self):
336+
model = ComboConvBatchnormRelu6()
337+
self._test_conv_combo_ethos_MI_pipeline(
338+
model, common.get_u55_compile_spec(), model.get_inputs()
339+
)
340+
300341
def test_conv_batchnorm_relu_u85_BI(self):
301342
model = ComboConvBatchnormRelu6()
302343
self._test_conv_combo_ethos_BI_pipeline(
@@ -328,6 +369,14 @@ def test_conv_relu6_u55_BI(self, test_data: torch.Tensor):
328369
model, common.get_u55_compile_spec(permute_memory_to_nhwc=True), test_data
329370
)
330371

372+
@parameterized.expand(ComboConvRelu6.test_data)
373+
def test_conv_relu6_u55_MI(self, test_data: torch.Tensor):
374+
model = ComboConvRelu6()
375+
test_data = (test_data,)
376+
self._test_conv_combo_ethos_MI_pipeline(
377+
model, common.get_u55_compile_spec(permute_memory_to_nhwc=True), test_data
378+
)
379+
331380
@parameterized.expand(ComboConvRelu6.test_data)
332381
def test_conv_relu6_u85_BI(self, test_data: torch.Tensor):
333382
model = ComboConvRelu6()
@@ -357,6 +406,14 @@ def test_block_bottleneck_residual_u55_BI(self):
357406
model.get_inputs(),
358407
)
359408

409+
def test_block_bottleneck_residual_u55_MI(self):
410+
model = ComboBlockBottleneckResidual()
411+
self._test_conv_combo_ethos_MI_pipeline(
412+
model,
413+
common.get_u55_compile_spec(permute_memory_to_nhwc=True),
414+
model.get_inputs(),
415+
)
416+
360417
def test_block_bottleneck_residual_u85_BI(self):
361418
model = ComboBlockBottleneckResidual()
362419
self._test_conv_combo_ethos_BI_pipeline(
@@ -390,6 +447,16 @@ def test_conv_avgpool2d_u55_BI(self, test_data: torch.Tensor):
390447
test_data,
391448
)
392449

450+
@parameterized.expand(ComboConvAvgPool2d.test_data)
451+
def test_conv_avgpool2d_u55_MI(self, test_data: torch.Tensor):
452+
model = ComboConvAvgPool2d()
453+
test_data = (test_data,)
454+
self._test_conv_combo_ethos_MI_pipeline(
455+
model,
456+
common.get_u55_compile_spec(),
457+
test_data,
458+
)
459+
393460
@parameterized.expand(ComboConvAvgPool2d.test_data)
394461
def test_conv_avgpool2d_u85_BI(self, test_data: torch.Tensor):
395462
model = ComboConvAvgPool2d()

0 commit comments

Comments
 (0)