From b28d0a6a66bb3a384a6bf0c4710ceb2bc80f0cf2 Mon Sep 17 00:00:00 2001 From: Yufeng Shi Date: Wed, 10 Dec 2025 16:05:38 +0000 Subject: [PATCH] Arm backend: Match arg ranks for min/max ops - Int32 clamp is decomposed into min/max, but input_tensor and min_arg/max_arg can end up with different ranks (e.g. (1,) vs ()) after subsequent passes. This violates the TOSA requirements for TOSA.MINIMUM and TOSA.MAXIMUM in the node visitors. - Fix this by matching the input ranks in MatchArgRanksPass Change-Id: I47a3bb73832ddc35553cd3e5b65085155eb9ca48 Signed-off-by: Yufeng Shi Co-authored-by: Ryan O'Shea Co-authored-by: Rob Elliott --- backends/arm/_passes/match_arg_ranks_pass.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/arm/_passes/match_arg_ranks_pass.py b/backends/arm/_passes/match_arg_ranks_pass.py index 34ccdc82918..d9f38c951b8 100644 --- a/backends/arm/_passes/match_arg_ranks_pass.py +++ b/backends/arm/_passes/match_arg_ranks_pass.py @@ -63,6 +63,8 @@ def __init__(self, exported_program: ExportedProgram) -> None: exir_ops.edge.aten.bitwise_and.Tensor, exir_ops.edge.aten.bitwise_xor.Tensor, exir_ops.edge.aten.bitwise_or.Tensor, + exir_ops.edge.aten.maximum.default, + exir_ops.edge.aten.minimum.default, ] def _match_op_rank(self, graph_module, node, arg, max_rank):