Skip to content

Commit 0d0769a

Browse files
authored
Arm backend: Skip int operation tests as for FP profile (#13866)
### Summary Switching to TOSA 1.0 the FP profile doesn't support int (as the 0.80 MI profile did). The test was not updated to reflect that, so skip them for op argument validation patches to land. ### Test plan Tested through unit tests. cc @digantdesai @freddan80 @zingo @oscarandersson8218 Signed-off-by: Per Åstrand <[email protected]>
1 parent 150c4c6 commit 0d0769a

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

backends/arm/test/ops/test_embedding.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from typing import Tuple
88

9+
import pytest
910
import torch
1011
from executorch.backends.arm._passes import InsertCastForOpsWithInt64InputPass
1112

@@ -57,6 +58,7 @@ def forward(self, weights: torch.Tensor, indices: torch.Tensor):
5758
}
5859

5960

61+
@pytest.mark.skip(reason="MLETORCH-1274 Improve data type checks during partitioning")
6062
@common.parametrize("test_input", test_input)
6163
def test_embedding_tosa_FP(test_input: input_params):
6264
op = Embedding()
@@ -87,6 +89,7 @@ def test_embedding_tosa_INT(test_input: input_params):
8789
pipeline.run()
8890

8991

92+
@pytest.mark.skip("reason=MLETORCH-1274 Improve data type checks during partitioning")
9093
@common.parametrize("test_input", test_input)
9194
@common.SkipIfNoModelConverter
9295
def test_embedding_vgf_FP(test_input: input_params):

backends/arm/test/ops/test_eye.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# This source code is licensed under the BSD-style license found in the
44
# LICENSE file in the root directory of this source tree.
55

6+
import pytest
67
import torch
78
from executorch.backends.arm.test import common
89
from executorch.backends.arm.test.tester.test_pipeline import (
@@ -48,6 +49,9 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
4849
}
4950

5051

52+
# skip test since int32 isn't support on FP profile
53+
# "int32_int32": "view/RESHAPE of integer tensor is not supported for +FP profile"
54+
@pytest.mark.skip(reason="MLETORCH-1274 Improve data type checks during partitioning")
5155
@common.parametrize("test_data", EyeAdd.test_data)
5256
def test_eye_tosa_FP(test_data: test_data_t):
5357
input_data, init_data = test_data
@@ -99,6 +103,9 @@ def test_eye_u85_INT(test_data: test_data_t):
99103
pipeline.run()
100104

101105

106+
# skip since int32 isn't support on FP profile
107+
# "int32_int32": "view/RESHAPE of integer tensor is not supported for +FP profile"
108+
@pytest.mark.skip(reason="MLETORCH-1274 Improve data type checks during partitioning")
102109
@common.parametrize(
103110
"test_data",
104111
EyeAdd.test_data,

backends/arm/test/ops/test_mul.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,17 @@ def test_mul_tensor_tosa_FP_diff_input_ranks(test_data: torch.Tensor):
129129
pipeline.run()
130130

131131

132-
@common.parametrize("test_data", test_data_suite_int32)
132+
# MLETORCH-1274 Improve data type checks during partitioning
133+
# view/RESHAPE of integer tensor is not supported for +FP profile which causes issues
134+
# with view_copy (RESHAPE) which isn't supported in FP so removing the int32 tests
135+
# to allow for the dtype validation patches to land.
136+
# filter out the 'op_mul_rank4_randn_int32' only
137+
test_data_int32_without_broadcasting = {
138+
k: v for k, v in test_data_suite_int32.items() if k != "op_mul_rank4_randn_int32"
139+
}
140+
141+
142+
@common.parametrize("test_data", test_data_int32_without_broadcasting)
133143
def test_mul_tensor_tosa_FP_int32(test_data: torch.Tensor):
134144
pipeline = TosaPipelineFP[input_t1](
135145
Mul(),
@@ -228,8 +238,14 @@ def test_mul_tensor_u85_INT_int32(test_data: torch.Tensor):
228238
pipeline.run()
229239

230240

241+
# view/RESHAPE of integer tensor is not supported for +FP profile which causes issues
242+
# with view_copy (RESHAPE) which isn't supported in FP so removing the int32 tests
243+
# to allow for the dtype validation patches to land.
244+
245+
231246
@common.parametrize(
232-
"test_data", test_data_suite | test_data_suite_2 | test_data_suite_int32
247+
"test_data",
248+
test_data_suite | test_data_suite_2 | test_data_int32_without_broadcasting,
233249
)
234250
@common.SkipIfNoModelConverter
235251
def test_mul_tensor_vgf_FP(test_data: torch.Tensor):

backends/arm/test/ops/test_scalars.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ def test_div_scalar_u85_INT():
417417

418418

419419
# SHIFT ETHOS-U ------------------------------------------------------
420+
@pytest.mark.skip(
421+
reason="integer operations (shift and sub) are not supported on FP profile"
422+
)
420423
def test_bitwise_right_shift_tensor_tosa_FP_inplace():
421424
pipeline = TosaPipelineFP[input_t1](
422425
ShiftInplaceSub(),

0 commit comments

Comments
 (0)