File tree Expand file tree Collapse file tree 3 files changed +37
-17
lines changed
Expand file tree Collapse file tree 3 files changed +37
-17
lines changed Original file line number Diff line number Diff line change 1+ # Copyright 2025 Arm Limited and/or its affiliates.
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+ from .quantized_linear_fusion_pass import QuantizedLinearFusionPass # noqa
7+ from .quantized_op_fusion_pass import QuantizedOpFusionPass # noqa
8+ from .replace_quant_nodes_pass import ReplaceQuantNodesPass # noqa
9+ from .cortex_m_pass_manager import CortexMPassManager # noqa # usort: skip
Original file line number Diff line number Diff line change 1+ # Copyright 2025 Arm Limited and/or its affiliates.
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+
7+ from executorch .backends .cortex_m .passes import (
8+ QuantizedLinearFusionPass ,
9+ QuantizedOpFusionPass ,
10+ ReplaceQuantNodesPass ,
11+ )
12+ from executorch .backends .xnnpack ._passes import XNNPACKPassManager
13+ from executorch .exir .pass_base import ExportPass
14+
15+
16+ class CortexMPassManager (XNNPACKPassManager ):
17+
18+ pass_list : list [ExportPass ] = [
19+ ReplaceQuantNodesPass ,
20+ QuantizedOpFusionPass ,
21+ QuantizedLinearFusionPass ,
22+ ]
23+
24+ def __init__ (self , exported_program , passes = None ):
25+ super ().__init__ (exported_program , passes or self .pass_list )
Original file line number Diff line number Diff line change 1010import torch
1111from executorch .backends .arm .test .common import get_u55_compile_spec
1212from executorch .backends .arm .test .tester .arm_tester import Serialize
13- from executorch .backends .cortex_m .passes .quantized_linear_fusion_pass import (
14- QuantizedLinearFusionPass ,
15- )
16- from executorch .backends .cortex_m .passes .quantized_op_fusion_pass import (
17- QuantizedOpFusionPass ,
18- )
19-
20- from executorch .backends .cortex_m .passes .replace_quant_nodes_pass import (
21- ReplaceQuantNodesPass ,
22- )
13+ from executorch .backends .cortex_m .passes .cortex_m_pass_manager import CortexMPassManager
2314from executorch .backends .test .harness import Tester as TesterBase
2415from executorch .backends .test .harness .stages import (
2516 Export ,
2920 ToEdgeTransformAndLower ,
3021 ToExecutorch ,
3122)
32- from executorch .backends .xnnpack ._passes import XNNPACKPassManager
3323
3424from executorch .backends .xnnpack .quantizer .xnnpack_quantizer import (
3525 get_symmetric_quantization_config ,
@@ -47,12 +37,8 @@ def __init__(self):
4737class CortexMRunPasses (RunPasses ):
4838 def __init__ (self ):
4939 super ().__init__ (
50- XNNPACKPassManager ,
51- pass_list = [
52- ReplaceQuantNodesPass ,
53- QuantizedLinearFusionPass ,
54- QuantizedOpFusionPass ,
55- ],
40+ CortexMPassManager ,
41+ CortexMPassManager .pass_list ,
5642 )
5743
5844
You can’t perform that action at this time.
0 commit comments