From 55a0ea74fbe01df9070f9c5baa0fa4d89d019a2c Mon Sep 17 00:00:00 2001 From: lucylq Date: Wed, 3 Sep 2025 10:55:05 -0700 Subject: [PATCH 1/2] Revert "NXP backend: Fix Neutron unit test (conflicting changes merged) (#13900)" This reverts commit f8a422c164cd1a537a6df4576e5c62452a43512c. --- backends/nxp/tests/test_split_group_convolution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/nxp/tests/test_split_group_convolution.py b/backends/nxp/tests/test_split_group_convolution.py index 1da53af794d..ec2a228e414 100644 --- a/backends/nxp/tests/test_split_group_convolution.py +++ b/backends/nxp/tests/test_split_group_convolution.py @@ -49,7 +49,7 @@ def _quantize_and_lower_module( edge_compile_config=edge_compile_config, ) - compile_spec = generate_neutron_compile_spec(target, "SDK_25_06") + compile_spec = generate_neutron_compile_spec(target, "SDK_25_03") partitioner = NeutronPartitioner(compile_spec) return edge_program_manager.to_backend(partitioner) From af12dafeda00f6a39380ce137664bb1cfe376ccf Mon Sep 17 00:00:00 2001 From: lucylq Date: Wed, 3 Sep 2025 10:56:08 -0700 Subject: [PATCH 2/2] Revert "NXP backend: Fix group convolution merge conflict (#13894)" This reverts commit 19a54bc7ed86f8b05c146e641d0316c28ae64b57. --- .../nxp/tests/test_split_group_convolution.py | 36 +++---------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/backends/nxp/tests/test_split_group_convolution.py b/backends/nxp/tests/test_split_group_convolution.py index ec2a228e414..5786f00de07 100644 --- a/backends/nxp/tests/test_split_group_convolution.py +++ b/backends/nxp/tests/test_split_group_convolution.py @@ -15,43 +15,15 @@ from executorch.backends.nxp.aten_passes.split_group_convolution import ( SplitGroupConvolution, ) -from executorch.backends.nxp.neutron_partitioner import NeutronPartitioner -from executorch.backends.nxp.nxp_backend import generate_neutron_compile_spec -from executorch.backends.nxp.tests.executorch_pipeline import ( - _quantize_model, - get_random_calibration_inputs, - to_model_input_spec, -) +from executorch.backends.nxp.tests.executorch_pipeline import to_quantized_edge_program from executorch.backends.nxp.tests.executors import graph_contains_any_of_ops from executorch.backends.nxp.tests.models import ( Conv1dModule, Conv2dModule, Conv3dModule, ) -from executorch.exir import EdgeCompileConfig, EdgeProgramManager from executorch.exir.dialects._ops import ops as exir_ops -from executorch.extension.export_util import export_to_edge from parameterized import parameterized -from torch.fx import GraphModule - - -def _quantize_and_lower_module( - module: GraphModule, input_shape: tuple[int, ...], target="imxrt700" -) -> EdgeProgramManager: - calibration_inputs = get_random_calibration_inputs(to_model_input_spec(input_shape)) - - exir_program_aten__module_quant = _quantize_model(module, calibration_inputs) - - edge_compile_config = EdgeCompileConfig(_check_ir_validity=False) - edge_program_manager = export_to_edge( - exir_program_aten__module_quant, - calibration_inputs[0], - edge_compile_config=edge_compile_config, - ) - - compile_spec = generate_neutron_compile_spec(target, "SDK_25_03") - partitioner = NeutronPartitioner(compile_spec) - return edge_program_manager.to_backend(partitioner) class TestSplitGroupConvolution(unittest.TestCase): @@ -109,7 +81,7 @@ def test_split_group_convolution__2d(self, _, input_shape: list[int], group: int assert np.allclose(out1, out2, atol=2.0e-7) # Make sure the graph can be correctly quantized and lowered to edge. - ep = _quantize_and_lower_module( + ep = to_quantized_edge_program( modified_module, tuple(input_shape) ).exported_program() nodes = list(ep.graph.nodes) @@ -166,7 +138,7 @@ def test_split_group_convolution__1d(self, _, input_shape: list[int], group: int assert np.allclose(out1, out2, atol=2.0e-7) # Make sure the graph can be correctly quantized and lowered to edge. - ep = _quantize_and_lower_module( + ep = to_quantized_edge_program( modified_module, tuple(input_shape) ).exported_program() nodes = list(ep.graph.nodes) @@ -254,7 +226,7 @@ def test_split_group_convolution__applied_by_default(self): assert np.allclose(out1, out2, atol=5.0e-7) # Make sure the graph can be correctly quantized and lowered to edge. - ep = _quantize_and_lower_module( + ep = to_quantized_edge_program( modified_module, tuple(input_shape) ).exported_program() nodes = list(ep.graph.nodes)