Skip to content

Commit 9ccbc4a

Browse files
Arm backend: Remove redundant pass insertions (#19448)
Decompositions of GRU, LSTM and RNN were inserted in the Arm backend pass pipeline even though these operators would have been decomposed in the core-ATen legalization. Also moves tests from test/passes/ to test/modules/ as the tests are end-to-end tests rather than isolated pass tests. cc @digantdesai @freddan80 @per @zingo @mansnils @Sebastian-Larsson @robell Signed-off-by: Oscar Andersson <oscar.andersson@arm.com>
1 parent a279b72 commit 9ccbc4a

7 files changed

Lines changed: 6 additions & 9 deletions

File tree

backends/arm/_passes/arm_pass_manager.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,6 @@ def _tosa_pipeline(
399399
ConvertToClampPass(),
400400
DecomposeTOSAUnsupportedClampPass(),
401401
DecomposeGroupNormPass(),
402-
DecomposeGruPass(),
403-
DecomposeLstmPass(),
404-
DecomposeRnnPass(),
405402
DecomposeLayerNormPass(),
406403
DecomposeVarPass(),
407404
DecomposeMeanDimPass(exported_program.graph_module, self.tosa_spec),

backends/arm/_passes/decompose_gru_pass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) Meta Platforms, Inc. and affiliates.
22
# All rights reserved.
3+
# Copyright 2026 Arm Limited and/or its affiliates.
34
#
45
# This source code is licensed under the BSD-style license found in the
56
# LICENSE file in the root directory of this source tree.
@@ -13,7 +14,6 @@
1314
create_node,
1415
get_getitem_users,
1516
)
16-
from executorch.backends.arm._passes.insert_table_ops import InsertTableOpsPass
1717
from executorch.exir.pass_base import ExportPass, PassResult
1818

1919

@@ -34,7 +34,7 @@ class DecomposeGruPass(ArmPass):
3434
3535
"""
3636

37-
_passes_required_after: Set[Type[ExportPass]] = {InsertTableOpsPass}
37+
_passes_required_after: Set[Type[ExportPass]] = set()
3838

3939
_TARGET = torch.ops.aten.gru.input
4040

backends/arm/_passes/decompose_lstm_pass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) Meta Platforms, Inc. and affiliates.
22
# All rights reserved.
3+
# Copyright 2026 Arm Limited and/or its affiliates.
34
#
45
# This source code is licensed under the BSD-style license found in the
56
# LICENSE file in the root directory of this source tree.
@@ -13,7 +14,6 @@
1314
create_node,
1415
get_getitem_users,
1516
)
16-
from executorch.backends.arm._passes.insert_table_ops import InsertTableOpsPass
1717
from executorch.exir.pass_base import ExportPass, PassResult
1818

1919

@@ -36,7 +36,7 @@ class DecomposeLstmPass(ArmPass):
3636
3737
"""
3838

39-
_passes_required_after: Set[Type[ExportPass]] = {InsertTableOpsPass}
39+
_passes_required_after: Set[Type[ExportPass]] = set()
4040

4141
_TARGET = torch.ops.aten.lstm.input
4242

backends/arm/_passes/decompose_rnn_pass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) Meta Platforms, Inc. and affiliates.
22
# All rights reserved.
3+
# Copyright 2026 Arm Limited and/or its affiliates.
34
#
45
# This source code is licensed under the BSD-style license found in the
56
# LICENSE file in the root directory of this source tree.
@@ -13,7 +14,6 @@
1314
create_node,
1415
get_getitem_users,
1516
)
16-
from executorch.backends.arm._passes.insert_table_ops import InsertTableOpsPass
1717
from executorch.exir.pass_base import ExportPass, PassResult
1818

1919

@@ -30,7 +30,7 @@ class DecomposeRnnPass(ArmPass):
3030
3131
"""
3232

33-
_passes_required_after: Set[Type[ExportPass]] = {InsertTableOpsPass}
33+
_passes_required_after: Set[Type[ExportPass]] = set()
3434

3535
_TARGETS = {
3636
torch.ops.aten.rnn_tanh.input,
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)