File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,3 +22,7 @@ class CustomDelegationOptions:
2222 # not create any NeutronGraph that can be called. This is done by the partitioner itself, and is not handled by
2323 # the individual node converters.
2424 allow_no_op_partitions : bool = False
25+
26+ # The new neutron converter flow has different constraints for supported operators. These need to be addressed when
27+ # deciding is operator is delegated or not in _is_supported_on_target().
28+ use_new_flow_neutron_c : bool = False
Original file line number Diff line number Diff line change 1515import numpy as np
1616import torch
1717
18+ from executorch .backends .nxp .backend .custom_delegation_options import (
19+ CustomDelegationOptions ,
20+ )
1821from executorch .backends .nxp .backend .data_format import DataFormat
1922from executorch .backends .nxp .backend .edge_program_converter import (
2023 EdgeProgramToIRConverter ,
@@ -229,6 +232,9 @@ def preprocess( # noqa C901
229232 edge_program ,
230233 neutron_target_spec = NeutronTargetSpec (target ),
231234 conversion_config = conversion_config ,
235+ custom_delegation_options = CustomDelegationOptions (
236+ use_new_flow_neutron_c = use_new_flow_neutron_c
237+ ),
232238 )
233239
234240 neutron_model = NeutronConverterManager (dump_kernel_selection_code ).convert (
Original file line number Diff line number Diff line change @@ -194,6 +194,7 @@ def to_quantized_edge_program(
194194 delegate_to_npu = True ,
195195) -> EdgeProgramManager :
196196 _neutron_target_spec = NeutronTargetSpec (target )
197+ custom_delegation_options .use_new_flow_neutron_c = use_new_flow_neutron_c
197198 if get_quantizer_fn is None :
198199 get_quantizer_fn = partial (
199200 _get_default_quantizer , _neutron_target_spec , use_qat
Original file line number Diff line number Diff line change 1+ # Copyright 2026 NXP
2+ #
3+ # This source code is licensed under the BSD-style license found in the
4+ # LICENSE file in the root directory of this source tree.
5+
6+ # This file defines ops aliases for shorter and more readable test description. List is sorted alphabetically.
7+ # When finding a missing alias, add it at the correct place.
8+
9+ import torch
10+ from executorch .exir .dialects ._ops import ops as exir_ops
11+
12+ AvgPool2D = exir_ops .edge .aten .avg_pool2d .default
13+ Bmm = exir_ops .edge .aten .bmm .default
14+ ExecutorchDelegateCall = torch .ops .higher_order .executorch_call_delegate
15+ HardTanh = exir_ops .edge .aten .hardtanh .default
16+ HardTanh_ = exir_ops .edge .aten .hardtanh_ .default
17+ Slice = exir_ops .edge .aten .slice .Tensor
18+ SliceCopy = exir_ops .edge .aten .slice_copy .Tensor
19+ Softmax = exir_ops .edge .aten ._softmax .default
20+ Squeeze = exir_ops .edge .aten .squeeze .default
21+ SqueezeDim = exir_ops .edge .aten .squeeze .dim
22+ SqueezeDims = exir_ops .edge .aten .squeeze .dims
23+ Unsqueeze = exir_ops .edge .aten .unsqueeze .default
24+ UpsampleBilinear2D = exir_ops .edge .aten .upsample_bilinear2d .vec
25+ UpsampleNearest2D = exir_ops .edge .aten .upsample_nearest2d .vec
26+ ViewCopy = exir_ops .edge .aten .view_copy .default
You can’t perform that action at this time.
0 commit comments