Skip to content

Commit 22284e5

Browse files
Arm backend: Add index_tensor/index_select to unsupported u55 operators (#13176)
index_tensor and index_select both become a GATHER Tosa operators, which is not support on U55. Add test cases for U55 for these operators. The test cases verify that the ops do not get delegated. Signed-off-by: Sebastian Larsson <[email protected]>
1 parent 4a7e2ac commit 22284e5

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

backends/arm/operator_support/ethos_u55_support.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ class EthosU55NotSupported(OperatorSupportBase):
149149
exir_ops.edge.aten.ne.Scalar,
150150
exir_ops.edge.aten.flip.default, # REVERSE
151151
exir_ops.edge.aten.grid_sampler_2d, # GATHER
152+
exir_ops.edge.aten.index.Tensor, # GATHER
153+
exir_ops.edge.aten.index_select.default, # GATHER
152154
exir_ops.edge.aten.scatter.src,
153155
exir_ops.edge.aten.scatter.value,
154156
exir_ops.edge.aten.select_scatter.default,

backends/arm/test/ops/test_index_select.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from executorch.backends.arm.test import common
1414
from executorch.backends.arm.test.tester.test_pipeline import (
15+
OpNotSupportedPipeline,
1516
TosaPipelineFP,
1617
TosaPipelineINT,
1718
VgfPipeline,
@@ -120,6 +121,20 @@ def test_index_select_tosa_INT_rand(test_data: input_params):
120121
pipeline.run()
121122

122123

124+
@pytest.mark.parametrize("test_data", list(test_data.values())[-1:])
125+
def test_index_select_u55_INT_not_delegated(test_data: input_params):
126+
op, test_input = test_data
127+
128+
pipeline = OpNotSupportedPipeline[input_params](
129+
op,
130+
test_input,
131+
{op.exir_op: 1},
132+
quantize=True,
133+
u55_subset=True,
134+
)
135+
pipeline.run()
136+
137+
123138
@pytest.mark.parametrize("test_data", list(test_data.values()))
124139
@common.SkipIfNoModelConverter
125140
def test_index_select_vgf_FP(test_data: input_params):

backends/arm/test/ops/test_index_tensor.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import torch
1111
from executorch.backends.arm.test import common
1212
from executorch.backends.arm.test.tester.test_pipeline import (
13+
OpNotSupportedPipeline,
1314
TosaPipelineFP,
1415
TosaPipelineINT,
1516
)
@@ -460,3 +461,18 @@ def test_index_tensor_tosa_INT_none(test_data: input_params):
460461
IndexTensorTestCommon.exir_op,
461462
).run()
462463
)
464+
465+
466+
@common.parametrize("test_data", IndexTensor.test_data)
467+
@common.XfailIfNoCorstone300
468+
def test_index_tensor_u55_INT_not_delegated(test_data: input_params):
469+
"""Ethos-U55 backend BI pipeline test for index.Tensor"""
470+
test_input = test_data
471+
with torch.no_grad():
472+
OpNotSupportedPipeline[input_params](
473+
IndexTensor(),
474+
test_input,
475+
{IndexTensorTestCommon.exir_op: 1},
476+
quantize=True,
477+
u55_subset=True,
478+
).run()

0 commit comments

Comments
 (0)