Skip to content

Commit 52da25a

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 b1b46ee commit 52da25a

File tree

4 files changed

+19
-32
lines changed

4 files changed

+19
-32
lines changed

backends/arm/test/ops/test_depthwise_conv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ def test_convolution_2d_tosa_BI_depth_wise(test_module: torch.nn.Module):
202202

203203

204204
x_fails = {
205-
"3x3_2x8x198x198_gp8_st3": "MLETORCH-516: AssertionError: Output 0 does not match reference output.",
206-
"two_dw_conv2d": "MLETORCH-516: AssertionError: Output 0 does not match reference output.",
205+
"3x3_2x8x198x198_gp8_st3": "MLBEDSW-10752: Vela issues with batches > 1 for dw_conv",
206+
"two_dw_conv2d": "MLBEDSW-10752: Vela issues with batches > 1 for dw_conv",
207207
}
208208

209209

backends/arm/test/ops/test_sigmoid_16bit.py

Lines changed: 11 additions & 12 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,
@@ -91,10 +90,13 @@ def forward(self, x):
9190

9291

9392
@common.parametrize("test_data", test_data_suite)
94-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
9593
def test_sigmoid_tosa_BI(test_data):
9694
pipeline = TosaPipelineBI(
97-
Sigmoid(), (test_data(),), Sigmoid.aten_op, Sigmoid.exir_op
95+
Sigmoid(),
96+
(test_data(),),
97+
Sigmoid.aten_op,
98+
Sigmoid.exir_op,
99+
qtol=1,
98100
)
99101
pipeline.change_args("quantize", get_16bit_sigmoid_quantizer())
100102
pipeline.run()
@@ -108,13 +110,13 @@ def test_sigmoid_tosa_BI(test_data):
108110
},
109111
strict=False,
110112
)
111-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
112-
def test_sigmoid_tosa_BI_add_sigmoid(test_data):
113+
def test_sigmoid_add_sigmoid_tosa_BI(test_data):
113114
pipeline = TosaPipelineBI(
114115
SigmoidAddSigmoid(),
115116
(test_data(),),
116117
Sigmoid.aten_op,
117118
Sigmoid.exir_op,
119+
qtol=1,
118120
)
119121
pipeline.run()
120122

@@ -131,8 +133,7 @@ def test_sigmoid_tosa_BI_add_sigmoid(test_data):
131133
"test_data",
132134
test_data_suite,
133135
)
134-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
135-
def test_sigmoid_u55_BI(test_data):
136+
def test_sigmoid_tosa_u55(test_data):
136137
pipeline = OpNotSupportedPipeline(
137138
Sigmoid(),
138139
(test_data(),),
@@ -148,8 +149,7 @@ def test_sigmoid_u55_BI(test_data):
148149
"test_data",
149150
test_data_suite,
150151
)
151-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
152-
def test_sigmoid_u55_BI_add_sigmoid(test_data):
152+
def test_sigmoid_add_sigmoid_tosa_u55(test_data):
153153
pipeline = OpNotSupportedPipeline(
154154
SigmoidAddSigmoid(),
155155
(test_data(),),
@@ -163,7 +163,6 @@ def test_sigmoid_u55_BI_add_sigmoid(test_data):
163163

164164

165165
@common.parametrize("test_data", test_data_suite)
166-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
167166
@common.XfailIfNoCorstone320
168167
def test_sigmoid_u85_BI(test_data):
169168
pipeline = EthosU85PipelineBI(
@@ -181,10 +180,10 @@ def test_sigmoid_u85_BI(test_data):
181180
"test_data",
182181
test_data_suite,
183182
xfails={
184-
"ramp": "AssertionError: Output 0 does not match reference output.",
183+
"ramp": "AssertionError: Output 0 does not match reference output. MLETORCH-787"
185184
},
186185
)
187-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
186+
@pytest.mark.flaky(reruns=5) # MLETORCH-787: Investigate int16-int8 rescaling precision
188187
@common.XfailIfNoCorstone320
189188
def test_sigmoid_u85_BI_add_sigmoid(test_data):
190189
pipeline = EthosU85PipelineBI(

backends/arm/test/ops/test_sigmoid_32bit.py

Lines changed: 5 additions & 17 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
@@ -107,34 +106,33 @@ def forward(self, x):
107106

108107

109108
@common.parametrize("test_data", test_data_suite)
110-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
111109
def test_sigmoid_tosa_BI(test_data):
112110
pipeline = TosaPipelineBI(
113111
Sigmoid(),
114112
(test_data(),),
115113
Sigmoid.aten_op,
116114
Sigmoid.exir_op,
115+
qtol=1,
117116
)
118117
pipeline.change_args("quantize", get_32bit_sigmoid_quantizer())
119118
pipeline.run()
120119

121120

122121
@common.parametrize("test_data", test_data_suite)
123-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
124-
def test_sigmoid_tosa_BI_add_sigmoid(test_data):
122+
def test_sigmoid_add_sigmoid_tosa_BI(test_data):
125123
pipeline = TosaPipelineBI(
126124
SigmoidAddSigmoid(),
127125
(test_data(),),
128126
Sigmoid.aten_op,
129127
Sigmoid.exir_op,
128+
qtol=1,
130129
)
131130
pipeline.change_args("quantize", get_32bit_sigmoid_quantizer())
132131
pipeline.run()
133132

134133

135134
@common.parametrize("test_data", test_data_suite)
136-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
137-
def test_sigmoid_u55_BI(test_data):
135+
def test_sigmoid_tosa_u55(test_data):
138136
pipeline = OpNotSupportedPipeline(
139137
Sigmoid(),
140138
(test_data(),),
@@ -147,8 +145,7 @@ def test_sigmoid_u55_BI(test_data):
147145

148146

149147
@common.parametrize("test_data", test_data_suite)
150-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
151-
def test_sigmoid_u55_BI_add_sigmoid(test_data):
148+
def test_sigmoid_add_sigmoid_tosa_u55(test_data):
152149
pipeline = OpNotSupportedPipeline(
153150
SigmoidAddSigmoid(),
154151
(test_data(),),
@@ -162,9 +159,7 @@ def test_sigmoid_u55_BI_add_sigmoid(test_data):
162159

163160

164161
@common.parametrize("test_data", test_data_suite)
165-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
166162
@common.XfailIfNoCorstone320
167-
@pytest.mark.flaky(reruns=5)
168163
def test_sigmoid_u85_BI(test_data):
169164
pipeline = EthosU85PipelineBI(
170165
Sigmoid(),
@@ -180,15 +175,8 @@ def test_sigmoid_u85_BI(test_data):
180175
@common.parametrize(
181176
"test_data",
182177
test_data_suite,
183-
xfails={
184-
"ramp": "AssertionError: Output 0 does not match reference output.",
185-
"rand": "AssertionError: Output 0 does not match reference output.",
186-
"rand_4d": "AssertionError: Output 0 does not match reference output.",
187-
},
188178
)
189-
@pytest.mark.flaky(reruns=32) # Flaky due to Vela bug: MLBEDSW-10642
190179
@common.XfailIfNoCorstone320
191-
@pytest.mark.flaky(reruns=5)
192180
def test_sigmoid_u85_BI_add_sigmoid(test_data):
193181
pipeline = EthosU85PipelineBI(
194182
SigmoidAddSigmoid(),

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)