Skip to content

Commit 5137ab7

Browse files
Arm backend: Fix sigmoid int16 and int32 flakyness
MLBEDSW-10642 has now been resolved. Step vela pin and remove all related pytest.mark_flaky in sigmoid int16 and int32 tests. Also updates dw_conv2d tests as new constraints were introduced in vela compilation. Signed-off-by: Oscar Andersson <[email protected]> Change-Id: I8c1aff31fb173fa6fdebc1d5b757623f9c2e1321
1 parent d7030aa commit 5137ab7

File tree

4 files changed

+22
-31
lines changed

4 files changed

+22
-31
lines changed

backends/arm/test/ops/test_depthwise_conv.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Copyright 2024-2025 Arm Limited and/or its affiliates.
2-
# All rights reserved.
32
#
43
# This source code is licensed under the BSD-style license found in the
54
# LICENSE file in the root directory of this source tree.
@@ -165,11 +164,11 @@
165164
("3x3_1x4x256x256_gp4_nobias", dw_conv2d_3x3_1x4x256x256_gp4_nobias),
166165
]
167166

168-
testsuite_conv2d_u85_xfails = [
167+
testsuite_conv2d_u55_xfails = [
169168
("3x3_2x8x198x198_gp8_st3", dw_conv2d_3x3_2x8x198x198_gp8_st3),
170169
("two_dw_conv2d", two_dw_conv2d),
171170
]
172-
171+
testsuite_conv2d_u85_xfails = testsuite_conv2d_u55_xfails
173172

174173
testsuite_conv1d = [
175174
("2_1x6x4_gp6_st1", dw_conv1d_2_1x6x4_gp6_st1),
@@ -266,9 +265,8 @@ def test_dw_conv2d_u55_BI(self, test_name: str, model: torch.nn.Module):
266265
model.get_inputs(),
267266
)
268267

269-
@parameterized.expand(testsuite_conv2d[4:], skip_on_empty=True)
270-
@pytest.mark.corstone_fvp
271-
@conftest.expectedFailureOnFVP # TODO: MLETORCH-516
268+
@parameterized.expand(testsuite_conv2d_u55_xfails)
269+
@pytest.mark.xfail(reason="MLBEDSW-10752: Vela issues with batches > 1 for dw_conv")
272270
def test_dw_conv2d_u55_BI_xfails(self, test_name: str, model: torch.nn.Module):
273271
self._test_dw_conv_ethos_BI_pipeline(
274272
model,
@@ -294,11 +292,9 @@ def test_dw_conv_u85_BI(self, test_name: str, model: torch.nn.Module):
294292
model.get_inputs(),
295293
)
296294

297-
# All test cases except 3x3_1x3x256x256_gp3_st1 have numerical issues on FVP. MLETORCH-520
298295
@parameterized.expand(testsuite_conv2d_u85_xfails)
299-
@pytest.mark.corstone_fvp
300-
@conftest.expectedFailureOnFVP
301-
def test_dw_conv_u85_BI_xfails(self, test_name: str, model: torch.nn.Module):
296+
@pytest.mark.xfail(reason="MLBEDSW-10752: Vela issues with batches > 1 for dw_conv")
297+
def test_dw_conv2d_u85_BI_xfails(self, test_name: str, model: torch.nn.Module):
302298
self._test_dw_conv_ethos_BI_pipeline(
303299
model,
304300
common.get_u85_compile_spec(),

backends/arm/test/ops/test_sigmoid_16bit.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# LICENSE file in the root directory of this source tree.
55

66
import pytest
7-
87
import torch
98
from executorch.backends.arm.quantizer import (
109
get_symmetric_quantization_config,
@@ -81,10 +80,13 @@ def forward(self, x):
8180

8281

8382
@common.parametrize("test_data", test_data_suite)
84-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
8583
def test_sigmoid_tosa_BI(test_data):
8684
pipeline = TosaPipelineBI(
87-
Sigmoid(), (test_data(),), Sigmoid.aten_op, Sigmoid.exir_op
85+
Sigmoid(),
86+
(test_data(),),
87+
Sigmoid.aten_op,
88+
Sigmoid.exir_op,
89+
qtol=1,
8890
)
8991
pipeline.change_args("quantize", get_16bit_sigmoid_quantizer("TOSA-0.80+BI"))
9092
pipeline.run()
@@ -97,10 +99,14 @@ def test_sigmoid_tosa_BI(test_data):
9799
"ramp": "AssertionError: Output 0 does not match reference output. MLETORCH-787"
98100
},
99101
)
100-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
102+
@pytest.mark.flaky(reruns=5) # MLETORCH-787: Investigate int16-int8 rescaling precision
101103
def test_sigmoid_add_sigmoid_tosa_BI(test_data):
102104
pipeline = TosaPipelineBI(
103-
SigmoidAddSigmoid(), (test_data(),), Sigmoid.aten_op, Sigmoid.exir_op
105+
SigmoidAddSigmoid(),
106+
(test_data(),),
107+
Sigmoid.aten_op,
108+
Sigmoid.exir_op,
109+
qtol=1,
104110
)
105111
pipeline.change_args("quantize", get_16bit_sigmoid_quantizer("TOSA-0.80+BI"))
106112
pipeline.run()
@@ -110,7 +116,6 @@ def test_sigmoid_add_sigmoid_tosa_BI(test_data):
110116
"test_data",
111117
test_data_suite,
112118
)
113-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
114119
def test_sigmoid_tosa_u55(test_data):
115120
pipeline = OpNotSupportedPipeline(
116121
Sigmoid(), (test_data(),), "TOSA-0.80+BI+u55", {Sigmoid.exir_op: 1}
@@ -123,7 +128,6 @@ def test_sigmoid_tosa_u55(test_data):
123128
"test_data",
124129
test_data_suite,
125130
)
126-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
127131
def test_sigmoid_add_sigmoid_tosa_u55(test_data):
128132
pipeline = OpNotSupportedPipeline(
129133
SigmoidAddSigmoid(),
@@ -137,7 +141,6 @@ def test_sigmoid_add_sigmoid_tosa_u55(test_data):
137141

138142

139143
@common.parametrize("test_data", test_data_suite)
140-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
141144
@common.XfailIfNoCorstone320
142145
def test_sigmoid_tosa_u85(test_data):
143146
pipeline = EthosU85PipelineBI(
@@ -151,10 +154,10 @@ def test_sigmoid_tosa_u85(test_data):
151154
"test_data",
152155
test_data_suite,
153156
xfails={
154-
"ramp": "AssertionError: Output 0 does not match reference output.",
157+
"ramp": "AssertionError: Output 0 does not match reference output. MLETORCH-787"
155158
},
156159
)
157-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
160+
@pytest.mark.flaky(reruns=5) # MLETORCH-787: Investigate int16-int8 rescaling precision
158161
@common.XfailIfNoCorstone320
159162
def test_sigmoid_add_sigmoid_tosa_u85(test_data):
160163
pipeline = EthosU85PipelineBI(

backends/arm/test/ops/test_sigmoid_32bit.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
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
76
import torch
87
from executorch.backends.arm.quantizer import TOSAQuantizer
98
from executorch.backends.arm.quantizer.quantization_config import QuantizationConfig
@@ -97,33 +96,32 @@ def forward(self, x):
9796

9897

9998
@common.parametrize("test_data", test_data_suite)
100-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
10199
def test_sigmoid_tosa_BI(test_data):
102100
pipeline = TosaPipelineBI(
103101
Sigmoid(),
104102
(test_data(),),
105103
Sigmoid.aten_op,
106104
Sigmoid.exir_op,
105+
qtol=1,
107106
)
108107
pipeline.change_args("quantize", get_32bit_sigmoid_quantizer("TOSA-0.80+BI"))
109108
pipeline.run()
110109

111110

112111
@common.parametrize("test_data", test_data_suite)
113-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
114112
def test_sigmoid_add_sigmoid_tosa_BI(test_data):
115113
pipeline = TosaPipelineBI(
116114
SigmoidAddSigmoid(),
117115
(test_data(),),
118116
Sigmoid.aten_op,
119117
Sigmoid.exir_op,
118+
qtol=1,
120119
)
121120
pipeline.change_args("quantize", get_32bit_sigmoid_quantizer("TOSA-0.80+BI"))
122121
pipeline.run()
123122

124123

125124
@common.parametrize("test_data", test_data_suite)
126-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
127125
def test_sigmoid_tosa_u55(test_data):
128126
pipeline = OpNotSupportedPipeline(
129127
Sigmoid(), (test_data(),), "TOSA-0.80+BI+u55", {Sigmoid.exir_op: 1}
@@ -133,7 +131,6 @@ def test_sigmoid_tosa_u55(test_data):
133131

134132

135133
@common.parametrize("test_data", test_data_suite)
136-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
137134
def test_sigmoid_add_sigmoid_tosa_u55(test_data):
138135
pipeline = OpNotSupportedPipeline(
139136
SigmoidAddSigmoid(),
@@ -147,7 +144,6 @@ def test_sigmoid_add_sigmoid_tosa_u55(test_data):
147144

148145

149146
@common.parametrize("test_data", test_data_suite)
150-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
151147
@common.XfailIfNoCorstone320
152148
def test_sigmoid_tosa_u85(test_data):
153149
pipeline = EthosU85PipelineBI(
@@ -160,11 +156,7 @@ def test_sigmoid_tosa_u85(test_data):
160156
@common.parametrize(
161157
"test_data",
162158
test_data_suite,
163-
xfails={
164-
"ramp": "AssertionError: Output 0 does not match reference output.",
165-
},
166159
)
167-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
168160
@common.XfailIfNoCorstone320
169161
def test_sigmoid_add_sigmoid_tosa_u85(test_data):
170162
pipeline = EthosU85PipelineBI(

examples/arm/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fi
6060

6161
# vela
6262
vela_repo_url="https://gitlab.arm.com/artificial-intelligence/ethos-u/ethos-u-vela"
63-
vela_rev="859cc066178a87ff28230c1ce9bd370f1e98aa5a"
63+
vela_rev="677651add50745478367da009936e4505d627399"
6464

6565
########
6666
### Functions

0 commit comments

Comments
 (0)