Skip to content

Commit 4adbdce

Browse files
AdrianLundellfreddan80
authored andcommitted
Update arm unittests to match latest vela version
Change-Id: Iff4ec4ebd09d4c80611581eab52706bcea4d3fe3
1 parent b9db0a3 commit 4adbdce

File tree

3 files changed

+35
-15
lines changed

3 files changed

+35
-15
lines changed

backends/arm/test/ops/test_depthwise_conv.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,14 @@
156156
("two_dw_conv2d", two_dw_conv2d),
157157
]
158158

159-
testsuite_conv2d_u85_xfails = [
159+
testsuite_conv2d_u85 = [
160160
("2x2_1x6x4x4_gp6_st1", dw_conv2d_2x2_1x6x4x4_gp6_st1),
161161
("3x3_1x3x256x256_gp3_st1", dw_conv2d_3x3_1x3x256x256_gp3_st1),
162162
("3x3_1x4x256x256_gp4_st1", dw_conv2d_3x3_1x4x256x256_gp4_st1),
163163
("3x3_1x4x256x256_gp4_nobias", dw_conv2d_3x3_1x4x256x256_gp4_nobias),
164+
]
165+
166+
testsuite_conv2d_u85_xfails = [
164167
("3x3_2x8x198x198_gp8_st3", dw_conv2d_3x3_2x8x198x198_gp8_st3),
165168
("two_dw_conv2d", two_dw_conv2d),
166169
]
@@ -284,7 +287,7 @@ def test_dw_conv1d_u55_BI(
284287
model.get_inputs(),
285288
)
286289

287-
@parameterized.expand(testsuite_conv1d[2:])
290+
@parameterized.expand(testsuite_conv1d + testsuite_conv2d_u85)
288291
def test_dw_conv_u85_BI(
289292
self, test_name: str, model: torch.nn.Module, set_quantize_io: bool = False
290293
):
@@ -296,12 +299,8 @@ def test_dw_conv_u85_BI(
296299
model.get_inputs(),
297300
)
298301

299-
testsuite_conv2d_u85_xfails.remove(
300-
("3x3_1x3x256x256_gp3_st1", dw_conv2d_3x3_1x3x256x256_gp3_st1)
301-
) # Works
302-
303302
# All test cases except 3x3_1x3x256x256_gp3_st1 have numerical issues on FVP. MLETORCH-520
304-
@parameterized.expand(testsuite_conv2d_u85_xfails + testsuite_conv1d[:2])
303+
@parameterized.expand(testsuite_conv2d_u85_xfails)
305304
@conftest.expectedFailureOnFVP
306305
def test_dw_conv_u85_BI_xfails(
307306
self, test_name: str, model: torch.nn.Module, set_quantize_io: bool = False

backends/arm/test/ops/test_div.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,21 @@ def test_div_tosa_BI(
183183
test_data = (input_, other_)
184184
self._test_div_tosa_BI_pipeline(self.Div(), test_data)
185185

186+
@parameterized.expand(test_data_suite[:2])
187+
def test_div_u55_BI(
188+
self,
189+
test_name: str,
190+
input_: Union[torch.Tensor, torch.types.Number],
191+
other_: Union[torch.Tensor, torch.types.Number],
192+
rounding_mode: Optional[str] = None,
193+
):
194+
test_data = (input_, other_)
195+
self._test_div_ethos_BI_pipeline(
196+
self.Div(), common.get_u55_compile_spec(), test_data
197+
)
198+
186199
# Numerical issues on FVP likely due to mul op, MLETORCH-521
187-
@parameterized.expand(test_data_suite)
200+
@parameterized.expand(test_data_suite[2:])
188201
@conftest.expectedFailureOnFVP
189202
def test_div_u55_BI_xfails(
190203
self,
@@ -198,8 +211,21 @@ def test_div_u55_BI_xfails(
198211
self.Div(), common.get_u55_compile_spec(), test_data
199212
)
200213

214+
@parameterized.expand(test_data_suite[:2])
215+
def test_div_u85_BI(
216+
self,
217+
test_name: str,
218+
input_: Union[torch.Tensor, torch.types.Number],
219+
other_: Union[torch.Tensor, torch.types.Number],
220+
rounding_mode: Optional[str] = None,
221+
):
222+
test_data = (input_, other_)
223+
self._test_div_ethos_BI_pipeline(
224+
self.Div(), common.get_u85_compile_spec(), test_data
225+
)
226+
201227
# Numerical issues on FVP likely due to mul op, MLETORCH-521
202-
@parameterized.expand(test_data_suite)
228+
@parameterized.expand(test_data_suite[2:])
203229
@conftest.expectedFailureOnFVP
204230
def test_div_u85_BI_xfails(
205231
self,

backends/arm/test/ops/test_mul.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,7 @@ def test_mul_tosa_BI(
152152
test_data = (input_, other_)
153153
self._test_mul_tosa_BI_pipeline(self.Mul(), test_data)
154154

155-
# Numerical issues on FVP, MLETORCH-521
156155
@parameterized.expand(test_data_sute)
157-
@conftest.expectedFailureOnFVP
158156
def test_mul_u55_BI(
159157
self,
160158
test_name: str,
@@ -166,10 +164,7 @@ def test_mul_u55_BI(
166164
common.get_u55_compile_spec(), self.Mul(), test_data
167165
)
168166

169-
# Numerical issues on FVP, MLETORCH-521
170-
# test_data_sute[0] works on U85
171-
@parameterized.expand(test_data_sute[1:])
172-
@conftest.expectedFailureOnFVP
167+
@parameterized.expand(test_data_sute)
173168
def test_mul_u85_BI(
174169
self,
175170
test_name: str,

0 commit comments

Comments
 (0)