Skip to content

Commit e1aabb6

Browse files
authored
Arm: Fix various small issues (#8566)
- Softmax incorrectly set to can_delegate=False in aot_arm_compiler - Incorrect % with rank instead of dim length. Fix test for this. - Remove .dump_artifact():s Signed-off-by: Erik Lundell <[email protected]>
1 parent 4f90ce4 commit e1aabb6

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

backends/arm/_passes/decompose_select.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ def call(self, graph_module: torch.fx.GraphModule):
3535
input_node, dim, index = node.args
3636

3737
rank = len(input_node.meta["val"].size())
38+
shape = input_node.meta["val"].shape
3839
dim = dim % rank if dim < 0 else dim
39-
index = index % rank if index < 0 else index
40+
index = index % shape[dim] if index < 0 else index
4041

4142
with graph_module.graph.inserting_before(node):
4243
slice_node = create_node(

backends/arm/test/ops/test_cat.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def _test_cat_ethosu_BI_pipeline(
111111
.check(["torch.ops.quantized_decomposed"])
112112
.to_edge()
113113
.partition()
114-
.dump_artifact()
115114
.check_not(["executorch_exir_dialects_edge__ops_aten_cat_default"])
116115
.check_count({"torch.ops.higher_order.executorch_call_delegate": 1})
117116
.to_executorch()

backends/arm/test/ops/test_select.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
test_data_suite: list[tuple[test_data_t]] = [
2020
# (test_data, dim, index)
2121
((torch.zeros(5, 3, 20), -1, 0),),
22-
((torch.zeros(5, 3, 20), 0, -1),),
22+
((torch.rand(5, 3, 20), 0, -1),),
2323
((torch.zeros(5, 3, 20), 0, 4),),
2424
((torch.ones(10, 10, 10), 0, 2),),
2525
((torch.rand(5, 3, 20, 2), 0, 2),),
@@ -61,9 +61,7 @@ def _test_select_tosa_MI_pipeline(
6161
.check([export_target])
6262
.check_not(["torch.ops.quantized_decomposed"])
6363
.to_edge()
64-
.dump_artifact()
6564
.partition()
66-
.dump_artifact()
6765
.check_count({"torch.ops.higher_order.executorch_call_delegate": 1})
6866
.to_executorch()
6967
.run_method_and_compare_outputs(inputs=test_data)

backends/arm/test/ops/test_to_copy.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Arm Limited and/or its affiliates.
1+
# Copyright 2024-2025 Arm Limited and/or its affiliates.
22
# All rights reserved.
33
#
44
# This source code is licensed under the BSD-style license found in the
@@ -55,9 +55,7 @@ def _test_to_copy_tosa_MI_pipeline(
5555
compile_spec=common.get_tosa_compile_spec("TOSA-0.80+MI"),
5656
)
5757
.export()
58-
.dump_artifact()
5958
.to_edge()
60-
.dump_artifact()
6159
.partition()
6260
.check_count({"torch.ops.higher_order.executorch_call_delegate": 1})
6361
.to_executorch()

examples/arm/aot_arm_compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def forward(self, x):
185185
return z
186186

187187
example_input = (torch.ones(2, 2),)
188-
can_delegate = False
188+
can_delegate = True
189189

190190

191191
class MultipleOutputsModule(torch.nn.Module):

0 commit comments

Comments
 (0)