Skip to content

Commit 4741f3a

Browse files
Arm backend: Relocate not-equal decomposition after rank matching (#19769)
Move DecomposeNotEqualPass to the post scalar-removal node transformation block. This removes its special placement between ReplaceScalarWithTensorByProfilePass and MatchArgRanksPass. Also match ranks for ne.Tensor before decomposition so scalar not-equal does not produce mismatched TOSA EQUAL operands. Signed-off-by: Sebastian Larsson <sebastian.larsson@arm.com>
1 parent 85dfa44 commit 4741f3a

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

backends/arm/_passes/arm_pass_manager.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,16 +481,14 @@ def _tosa_pipeline(
481481
ConvertFullLikeToFullPass(),
482482
MatchArgDtypePass(),
483483
UnsqueezeScalarPlaceholdersPass(exported_program),
484-
# TODO: Move DecomposeNotEqualPass to before or after this block of
485-
# passes. Ticket: MLETORCH-1540
486-
DecomposeNotEqualPass(),
487484
MatchArgRanksPass(exported_program),
488485
]
489486
)
490487

491488
# Node transformation passes (post scalar-removal)
492489
self.add_passes(
493490
[
491+
DecomposeNotEqualPass(),
494492
NormalizeIndexPutNoneIndicesPass(),
495493
NormalizeIndexPutBoolIndexTensorPass(),
496494
RewriteIndexPutPass(),

backends/arm/_passes/match_arg_ranks_pass.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def __init__(self, exported_program: ExportedProgram, *args, **kwargs) -> None:
5757
exir_ops.edge.aten.ge.Tensor,
5858
exir_ops.edge.aten.lt.Tensor,
5959
exir_ops.edge.aten.le.Tensor,
60+
exir_ops.edge.aten.ne.Tensor,
6061
exir_ops.edge.aten.pow.Tensor_Tensor,
6162
exir_ops.edge.aten.remainder.Tensor,
6263
exir_ops.edge.aten.where.self,

0 commit comments

Comments
 (0)