Skip to content

Commit 5ba59c2

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. Signed-off-by: Oscar Andersson <[email protected]> Change-Id: I8c1aff31fb173fa6fdebc1d5b757623f9c2e1321
1 parent 66314e4 commit 5ba59c2

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

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="425541302c7e4b6fbeca7c0061286b131ee507c3"
63+
vela_rev="677651add50745478367da009936e4505d627399"
6464

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

0 commit comments

Comments
 (0)