-
Notifications
You must be signed in to change notification settings - Fork 871
Expand file tree
/
Copy pathneutron_edge_pass_manager.py
More file actions
29 lines (24 loc) · 1.12 KB
/
neutron_edge_pass_manager.py
File metadata and controls
29 lines (24 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copyright 2025-2026 NXP
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from executorch.backends.nxp.edge_passes.move_auxiliary_operator_into_separate_qdq_cluster_pass import (
MoveLeadingAuxiliaryOperatorIntoSeparateQDQClusterPass,
MoveTrailingAuxiliaryOperatorIntoSeparateQDQClusterPass,
)
from executorch.backends.nxp.edge_passes.neutron_edge_pass import NeutronEdgePass
from executorch.backends.nxp.edge_passes.remove_as_strided_copy_nodes import (
RemoveUselessAsStridedCopyNodes,
)
from torch.fx.passes.infra.pass_manager import PassManager
class NeutronEdgePassManager(PassManager):
def __init__(self, passes: list[NeutronEdgePass] = None):
passes: list[NeutronEdgePass] = passes or [
MoveLeadingAuxiliaryOperatorIntoSeparateQDQClusterPass(),
MoveTrailingAuxiliaryOperatorIntoSeparateQDQClusterPass(),
RemoveUselessAsStridedCopyNodes(),
]
super().__init__(
passes,
steps=10, # Empirical value. At most 10 cycles of passes will be run.
)