Skip to content

Commit 605f986

Browse files
committed
Fix failing tests.
1 parent 590de19 commit 605f986

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

backends/nxp/tests/generic_tests/test_integration.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import executorch.extension.pybindings.portable_lib
77
import executorch.kernels.quantized # noqa F401
8+
from executorch.backends.nxp.tests.executors import graph_contains_any_of_ops
9+
from executorch.backends.nxp.tests.ops_aliases import AddMM, Convolution
810
from executorch.backends.nxp.tests.use_qat import * # noqa F401
911

1012
from executorch.backends.nxp.tests.executorch_pipeline import (
@@ -29,12 +31,10 @@ def test_conv_fc_softmax__to_executorch_program(use_qat):
2931
delegation_info = get_delegation_info(program.graph_module)
3032
assert delegation_info.num_delegated_subgraphs == 1
3133
assert delegation_info.num_non_delegated_nodes == 11
32-
assert delegation_info.num_delegated_nodes == 13
34+
assert delegation_info.num_delegated_nodes == 15
3335

34-
for node in program.graph.nodes:
35-
# Make sure Convolution and AddMM are delegated
36-
assert "convolution" not in node.name
37-
assert "addmm" not in node.name
36+
# Make sure Convolution and AddMM are delegated.
37+
assert not graph_contains_any_of_ops(program.graph, [Convolution, AddMM])
3838

3939

4040
def test_cifarnet(use_qat):
@@ -47,7 +47,8 @@ def test_cifarnet(use_qat):
4747
delegation_info = get_delegation_info(exec_prog.exported_program().graph_module)
4848
assert delegation_info.num_delegated_subgraphs == 1
4949
assert delegation_info.num_non_delegated_nodes == 11
50-
assert delegation_info.num_delegated_nodes == 45
50+
assert delegation_info.num_delegated_nodes == 47
5151

5252
nodes = list(exec_prog.exported_program().graph.nodes)
53+
# `nodes[2].target` is an OpOverload (not and EdgeOpOverload that we usually test against), so just check the name.
5354
assert nodes[2].name == "quantized_decomposed_quantize_per_tensor_default"

backends/nxp/tests/ir/edge_passes/test_edge_passes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,17 @@ def test_moving_fusable_activations_into_separate_qdq_clusters__linear(
255255

256256
# Check linear and activation are in separate QDQ clusters
257257
nodes = list(exported_program.graph.nodes)
258-
assert len(nodes) == 13
258+
assert len(nodes) == 15
259259
assert _is_dequantize(nodes[5])
260260
assert (
261261
neutron_target_spec.neutron_target_info.is_fusable_conv_or_linear__edge(
262-
nodes[7]
262+
nodes[9]
263263
)
264264
)
265-
assert _is_quantize(nodes[8])
266-
assert _is_dequantize(nodes[9])
265+
assert _is_quantize(nodes[10])
266+
assert _is_dequantize(nodes[11])
267267
assert neutron_target_spec.neutron_target_info.is_supported_fused_activation__edge(
268-
nodes[10]
268+
nodes[12]
269269
)
270270
assert _is_quantize(nodes[11])
271271

0 commit comments

Comments
 (0)