diff --git a/backends/nxp/tests/ir/edge_passes/test_remove_io_quant_ops_pass.py b/backends/nxp/tests/ir/edge_passes/test_remove_io_quant_ops_pass.py index 35bdc11d29a..7f480d40631 100644 --- a/backends/nxp/tests/ir/edge_passes/test_remove_io_quant_ops_pass.py +++ b/backends/nxp/tests/ir/edge_passes/test_remove_io_quant_ops_pass.py @@ -58,12 +58,12 @@ def test_remove_io_quant_ops_pass__cifarnet(): ) nodes = list(exec_prog.exported_program().graph.nodes) - assert len(nodes) == 17 + assert len(nodes) == 11 assert ( nodes[0].meta["val"].dtype == torch.int8 ), "Input tensor doesn't have type INT8." assert ( - nodes[16].meta["val"][0].dtype == torch.int8 + nodes[10].meta["val"][0].dtype == torch.int8 ), "Output tensor doesn't have type INT8." assert ( diff --git a/backends/nxp/tests/test_integration.py b/backends/nxp/tests/test_integration.py index 6c143df79b3..d31b22c9ce9 100644 --- a/backends/nxp/tests/test_integration.py +++ b/backends/nxp/tests/test_integration.py @@ -1,4 +1,4 @@ -# Copyright 2024 NXP +# Copyright 2024-2025 NXP # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. @@ -43,8 +43,8 @@ def test_cifarnet(): delegation_info = get_delegation_info(exec_prog.exported_program().graph_module) assert delegation_info.num_delegated_subgraphs == 1 - assert delegation_info.num_non_delegated_nodes == 17 - assert delegation_info.num_delegated_nodes == 42 + assert delegation_info.num_non_delegated_nodes == 11 + assert delegation_info.num_delegated_nodes == 45 nodes = list(exec_prog.exported_program().graph.nodes) assert nodes[2].name == "quantized_decomposed_quantize_per_tensor_default" diff --git a/examples/nxp/experimental/cifar_net/cifar_net.pth b/examples/nxp/experimental/cifar_net/cifar_net.pth index 6dc4efde21d..63c49bf494b 100644 Binary files a/examples/nxp/experimental/cifar_net/cifar_net.pth and b/examples/nxp/experimental/cifar_net/cifar_net.pth differ diff --git a/examples/nxp/experimental/cifar_net/cifar_net.py b/examples/nxp/experimental/cifar_net/cifar_net.py index 1378d00cf12..8d057c1ca34 100644 --- a/examples/nxp/experimental/cifar_net/cifar_net.py +++ b/examples/nxp/experimental/cifar_net/cifar_net.py @@ -1,4 +1,4 @@ -# Copyright 2024 NXP +# Copyright 2024-2025 NXP # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. @@ -57,7 +57,7 @@ class CifarNetModel(nn.Module): def __init__(self): super().__init__() - self.conv1 = nn.Conv2d(8, 32, 5) + self.conv1 = nn.Conv2d(3, 32, 5) self.conv2 = nn.Conv2d(32, 32, 5) self.conv3 = nn.Conv2d(32, 64, 5) self.pool1 = nn.MaxPool2d(2, 2) @@ -66,10 +66,7 @@ def __init__(self): self.softmax = nn.Softmax(1) def forward(self, x): - - # Neutron Backend does not yet have passses for automated padding if number of channels does not - # fit to Neutron constrains (#channels == #MAC units). So define the model explicitly tailored for Neutron-C-64. - x = F.pad(x, (2, 2, 2, 2, 0, 5)) + x = F.pad(x, (2, 2, 2, 2)) x = self.conv1(x) x = self.pool1(x)