Skip to content

Commit 8e5f1c7

Browse files
zingofreddan80
authored andcommitted
Arm backend: Add marks for test
Signed-off-by: Zingo Andersen <[email protected]> Change-Id: I045b04a89b95791be29f34370cff67d99aad0c0e
1 parent 2ed5ce3 commit 8e5f1c7

24 files changed

+123
-1
lines changed

backends/arm/test/models/test_mobilenet_v2_arm.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import logging
99
import unittest
1010

11+
import pytest
12+
1113
import torch
1214
from executorch.backends.arm.test import common, conftest
1315

@@ -83,6 +85,8 @@ def test_mv2_tosa_BI(self):
8385
.run_method_and_compare_outputs(atol=1.0, qtol=1, inputs=self.model_inputs)
8486
)
8587

88+
@pytest.mark.slow
89+
@pytest.mark.corstone_fvp
8690
def test_mv2_u55_BI(self):
8791
tester = (
8892
ArmTester(
@@ -101,6 +105,8 @@ def test_mv2_u55_BI(self):
101105
atol=1.0, qtol=1, inputs=self.model_inputs, target_board="corstone-300"
102106
)
103107

108+
@pytest.mark.slow
109+
@pytest.mark.corstone_fvp
104110
def test_mv2_u85_BI(self):
105111
tester = (
106112
ArmTester(

backends/arm/test/ops/test_add.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from typing import Tuple
1111

12+
import pytest
1213
import torch
1314
from executorch.backends.arm.test import common, conftest
1415
from executorch.backends.arm.test.tester.arm_tester import ArmTester
@@ -131,6 +132,7 @@ def test_add_tosa_BI(self, test_data: torch.Tensor):
131132
self._test_add_tosa_BI_pipeline(self.Add(), test_data)
132133

133134
@parameterized.expand(Add.test_parameters)
135+
@pytest.mark.corstone_fvp
134136
def test_add_u55_BI(self, test_data: torch.Tensor):
135137
test_data = (test_data,)
136138
self._test_add_ethos_BI_pipeline(
@@ -140,6 +142,7 @@ def test_add_u55_BI(self, test_data: torch.Tensor):
140142
)
141143

142144
@parameterized.expand(Add.test_parameters)
145+
@pytest.mark.corstone_fvp
143146
def test_add_u85_BI(self, test_data: torch.Tensor):
144147
test_data = (test_data,)
145148
self._test_add_ethos_BI_pipeline(
@@ -159,13 +162,15 @@ def test_add2_tosa_BI(self, operand1: torch.Tensor, operand2: torch.Tensor):
159162
self._test_add_tosa_BI_pipeline(self.Add2(), test_data)
160163

161164
@parameterized.expand(Add2.test_parameters)
165+
@pytest.mark.corstone_fvp
162166
def test_add2_u55_BI(self, operand1: torch.Tensor, operand2: torch.Tensor):
163167
test_data = (operand1, operand2)
164168
self._test_add_ethos_BI_pipeline(
165169
self.Add2(), common.get_u55_compile_spec(), test_data
166170
)
167171

168172
@parameterized.expand(Add2.test_parameters)
173+
@pytest.mark.corstone_fvp
169174
def test_add2_u85_BI(self, operand1: torch.Tensor, operand2: torch.Tensor):
170175
test_data = (operand1, operand2)
171176
self._test_add_ethos_BI_pipeline(

backends/arm/test/ops/test_avg_pool.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
from typing import Tuple
1111

12+
import pytest
13+
1214
import torch
1315
from executorch.backends.arm.quantizer.arm_quantizer import (
1416
ArmQuantizer,
@@ -144,6 +146,7 @@ def test_avgpool2d_tosa_BI(
144146
)
145147

146148
@parameterized.expand(test_data_suite)
149+
@pytest.mark.corstone_fvp
147150
def test_avgpool2d_tosa_u55_BI(
148151
self,
149152
test_name: str,
@@ -157,6 +160,7 @@ def test_avgpool2d_tosa_u55_BI(
157160
)
158161

159162
@parameterized.expand(test_data_suite)
163+
@pytest.mark.corstone_fvp
160164
def test_avgpool2d_tosa_u85_BI(
161165
self,
162166
test_name: str,

backends/arm/test/ops/test_bmm.py

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

99
from typing import Tuple
1010

11+
import pytest
12+
1113
import torch
1214
from executorch.backends.arm.test import common, conftest
1315
from executorch.backends.arm.test.tester.arm_tester import ArmTester
@@ -146,6 +148,7 @@ def test_bmm_single_input_tosa_BI(self, operand1: torch.Tensor):
146148
self._test_bmm_tosa_BI_pipeline(self.BMMSingleInput(), test_data)
147149

148150
@parameterized.expand(BMM.test_parameters)
151+
@pytest.mark.corstone_fvp
149152
@unittest.expectedFailure
150153
def test_bmm_u55_BI_xfails(self, operand1: torch.Tensor, operand2: torch.Tensor):
151154
test_data = (operand1, operand2)
@@ -154,13 +157,15 @@ def test_bmm_u55_BI_xfails(self, operand1: torch.Tensor, operand2: torch.Tensor)
154157
)
155158

156159
@parameterized.expand(BMM.test_parameters[:1])
160+
@pytest.mark.corstone_fvp
157161
def test_bmm_u85_BI(self, operand1: torch.Tensor, operand2: torch.Tensor):
158162
test_data = (operand1, operand2)
159163
self._test_bmm_ethosu_BI_pipeline(
160164
self.BMM(), common.get_u85_compile_spec(), test_data
161165
)
162166

163167
@parameterized.expand(BMM.test_parameters[1:])
168+
@pytest.mark.corstone_fvp
164169
@conftest.expectedFailureOnFVP
165170
def test_bmm_u85_BI_xfails(self, operand1: torch.Tensor, operand2: torch.Tensor):
166171
test_data = (operand1, operand2)
@@ -170,6 +175,7 @@ def test_bmm_u85_BI_xfails(self, operand1: torch.Tensor, operand2: torch.Tensor)
170175

171176
# Expected to fail with error: Warning, unsupported fusing of TOSA Rescale previous operator is of type: Memcpy
172177
@parameterized.expand(BMMSingleInput.test_parameters)
178+
@pytest.mark.corstone_fvp
173179
@unittest.expectedFailure
174180
def test_bmm_single_input_u55_BI_xfails(self, operand1: torch.Tensor):
175181
test_data = (operand1,)
@@ -178,6 +184,7 @@ def test_bmm_single_input_u55_BI_xfails(self, operand1: torch.Tensor):
178184
)
179185

180186
@parameterized.expand(BMMSingleInput.test_parameters)
187+
@pytest.mark.corstone_fvp
181188
def test_bmm_single_input_u85_BI(self, operand1: torch.Tensor):
182189
test_data = (operand1,)
183190
self._test_bmm_ethosu_BI_pipeline(

backends/arm/test/ops/test_cat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
from typing import Tuple
1111

12+
import pytest
13+
1214
import torch
1315
from executorch.backends.arm.test import common, conftest
1416
from executorch.backends.arm.test.tester.arm_tester import ArmTester
@@ -134,6 +136,7 @@ def test_cat_tosa_BI(self, operands: tuple[torch.Tensor, ...], dim: int):
134136

135137
# Mismatch in provided number of inputs and model signature, MLETORCH 519
136138
@parameterized.expand(Cat.test_parameters)
139+
@pytest.mark.corstone_fvp
137140
@conftest.expectedFailureOnFVP
138141
def test_cat_u55_BI(self, operands: tuple[torch.Tensor, ...], dim: int):
139142
test_data = (operands, dim)
@@ -143,6 +146,7 @@ def test_cat_u55_BI(self, operands: tuple[torch.Tensor, ...], dim: int):
143146

144147
# Mismatch in provided number of inputs and model signature, MLETORCH 519
145148
@parameterized.expand(Cat.test_parameters)
149+
@pytest.mark.corstone_fvp
146150
@conftest.expectedFailureOnFVP
147151
def test_cat_u85_BI(self, operands: tuple[torch.Tensor, ...], dim: int):
148152
test_data = (operands, dim)

backends/arm/test/ops/test_clone.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import unittest
1212
from typing import Tuple
1313

14+
import pytest
15+
1416
import torch
1517

1618
from executorch.backends.arm.quantizer.arm_quantizer import (
@@ -122,9 +124,11 @@ def test_clone_tosa_BI(self, test_tensor: torch.Tensor):
122124
self._test_clone_tosa_BI_pipeline(self.Clone(), (test_tensor,))
123125

124126
@parameterized.expand(Clone.test_parameters)
127+
@pytest.mark.corstone_fvp
125128
def test_clone_u55_BI(self, test_tensor: torch.Tensor):
126129
self._test_clone_tosa_u55_pipeline(self.Clone(), (test_tensor,))
127130

128131
@parameterized.expand(Clone.test_parameters)
132+
@pytest.mark.corstone_fvp
129133
def test_clone_u85_BI(self, test_tensor: torch.Tensor):
130134
self._test_clone_tosa_u85_pipeline(self.Clone(), (test_tensor,))

backends/arm/test/ops/test_conv1d.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
from typing import List, Optional, Tuple, Union
1010

11+
import pytest
12+
1113
import torch
1214
from executorch.backends.arm.test import common, conftest
1315
from executorch.backends.arm.test.tester.arm_tester import ArmTester
@@ -291,6 +293,7 @@ def test_conv1d_tosa_BI(self, test_name, model):
291293

292294
# Expeted to fail as Conv1D requires transpoes which isn't supported on u55
293295
@parameterized.expand(testsuite)
296+
@pytest.mark.corstone_fvp
294297
@unittest.expectedFailure
295298
def test_conv1d_u55_BI(self, test_name, model):
296299
self._test_conv1d_ethosu_BI_pipeline(
@@ -301,6 +304,7 @@ def test_conv1d_u55_BI(self, test_name, model):
301304
testsuite.remove(("5_3x2x128_st1", conv1d_5_3x2x128_st1))
302305

303306
@parameterized.expand(testsuite)
307+
@pytest.mark.corstone_fvp
304308
def test_conv1d_u85_BI(self, test_name, model):
305309
self._test_conv1d_ethosu_BI_pipeline(
306310
model, common.get_u85_compile_spec(), model.get_inputs()

backends/arm/test/ops/test_conv2d.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
from typing import List, Optional, Tuple, Union
1010

11+
import pytest
12+
1113
import torch
1214
from executorch.backends.arm.test import common, conftest
1315
from executorch.backends.arm.test.tester.arm_tester import ArmTester
@@ -325,6 +327,7 @@ def test_conv2d_tosa_BI(self, test_name, model):
325327
testsuite.remove(("5x5_3x2x128x128_st1", conv2d_5x5_3x2x128x128_st1))
326328

327329
@parameterized.expand(testsuite)
330+
@pytest.mark.corstone_fvp
328331
def test_conv2d_u55_BI(self, test_name, model):
329332
self._test_conv2d_ethosu_BI_pipeline(
330333
common.get_u55_compile_spec(permute_memory_to_nhwc=True),
@@ -333,6 +336,7 @@ def test_conv2d_u55_BI(self, test_name, model):
333336
)
334337

335338
@parameterized.expand(testsuite)
339+
@pytest.mark.corstone_fvp
336340
def test_conv2d_u85_BI(self, test_name, model):
337341
self._test_conv2d_ethosu_BI_pipeline(
338342
common.get_u85_compile_spec(permute_memory_to_nhwc=True),

backends/arm/test/ops/test_conv_combos.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ def test_conv_meandim_tosa_BI(self):
267267
model = ComboConv2dMeandim()
268268
self._test_conv_combo_tosa_BI_pipeline(model, model.get_inputs())
269269

270+
@pytest.mark.corstone_fvp
270271
def test_conv_meandim_u55_BI(self):
271272
model = ComboConv2dMeandim()
272273
self._test_conv_combo_ethos_BI_pipeline(
@@ -275,6 +276,7 @@ def test_conv_meandim_u55_BI(self):
275276
model.get_inputs(),
276277
)
277278

279+
@pytest.mark.corstone_fvp
278280
def test_conv_meandim_u85_BI(self):
279281
model = ComboConv2dMeandim()
280282
self._test_conv_combo_ethos_BI_pipeline(
@@ -294,12 +296,14 @@ def test_conv_batchnorm_relu6_tosa_BI(self):
294296
model = ComboConvBatchnormRelu6()
295297
self._test_conv_combo_tosa_BI_pipeline(model, model.get_inputs())
296298

299+
@pytest.mark.corstone_fvp
297300
def test_conv_batchnorm_relu6_u55_BI(self):
298301
model = ComboConvBatchnormRelu6()
299302
self._test_conv_combo_ethos_BI_pipeline(
300303
model, common.get_u55_compile_spec(), model.get_inputs()
301304
)
302305

306+
@pytest.mark.corstone_fvp
303307
def test_conv_batchnorm_relu_u85_BI(self):
304308
model = ComboConvBatchnormRelu6()
305309
self._test_conv_combo_ethos_BI_pipeline(
@@ -324,6 +328,7 @@ def test_conv_relu6_tosa_BI(self, test_data: torch.Tensor):
324328
self._test_conv_combo_tosa_BI_pipeline(model, test_data)
325329

326330
@parameterized.expand(ComboConvRelu6.test_data)
331+
@pytest.mark.corstone_fvp
327332
def test_conv_relu6_u55_BI(self, test_data: torch.Tensor):
328333
model = ComboConvRelu6()
329334
test_data = (test_data,)
@@ -332,6 +337,7 @@ def test_conv_relu6_u55_BI(self, test_data: torch.Tensor):
332337
)
333338

334339
@parameterized.expand(ComboConvRelu6.test_data)
340+
@pytest.mark.corstone_fvp
335341
def test_conv_relu6_u85_BI(self, test_data: torch.Tensor):
336342
model = ComboConvRelu6()
337343
test_data = (test_data,)
@@ -347,11 +353,12 @@ def test_block_bottleneck_residual_tosa_MI(self):
347353
self._test_conv_combo_tosa_MI_pipeline(model, model.get_inputs())
348354

349355
# TODO: Investigate flakyness (MLTORCH-307)
350-
@pytest.mark.flaky(reruns=3)
356+
@unittest.skip(reason="Skiped due to flakyness (MLTORCH-307)")
351357
def test_block_bottleneck_residual_tosa_BI(self):
352358
model = ComboBlockBottleneckResidual()
353359
self._test_conv_combo_tosa_BI_pipeline(model, model.get_inputs())
354360

361+
@pytest.mark.corstone_fvp
355362
def test_block_bottleneck_residual_u55_BI(self):
356363
model = ComboBlockBottleneckResidual()
357364
self._test_conv_combo_ethos_BI_pipeline(
@@ -360,6 +367,7 @@ def test_block_bottleneck_residual_u55_BI(self):
360367
model.get_inputs(),
361368
)
362369

370+
@pytest.mark.corstone_fvp
363371
def test_block_bottleneck_residual_u85_BI(self):
364372
model = ComboBlockBottleneckResidual()
365373
self._test_conv_combo_ethos_BI_pipeline(
@@ -384,6 +392,7 @@ def test_conv_avgpool2d_tosa_BI(self, test_data: torch.Tensor):
384392
self._test_conv_combo_tosa_BI_pipeline(model, test_data)
385393

386394
@parameterized.expand(ComboConvAvgPool2d.test_data)
395+
@pytest.mark.corstone_fvp
387396
def test_conv_avgpool2d_u55_BI(self, test_data: torch.Tensor):
388397
model = ComboConvAvgPool2d()
389398
test_data = (test_data,)
@@ -394,6 +403,7 @@ def test_conv_avgpool2d_u55_BI(self, test_data: torch.Tensor):
394403
)
395404

396405
@parameterized.expand(ComboConvAvgPool2d.test_data)
406+
@pytest.mark.corstone_fvp
397407
def test_conv_avgpool2d_u85_BI(self, test_data: torch.Tensor):
398408
model = ComboConvAvgPool2d()
399409
test_data = (test_data,)

backends/arm/test/ops/test_depthwise_conv.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
from typing import Tuple
1010

11+
import pytest
12+
1113
import torch
1214
from executorch.backends.arm.test import common, conftest
1315
from executorch.backends.arm.test.ops.test_conv1d import Conv1d
@@ -260,6 +262,7 @@ def test_dw_conv_tosa_BI(self, test_name: str, model: torch.nn.Module):
260262
) # Works
261263

262264
@parameterized.expand(testsuite_conv2d, skip_on_empty=True)
265+
@pytest.mark.corstone_fvp
263266
@unittest.expectedFailure
264267
def test_dw_conv2d_u55_BI(
265268
self, test_name: str, model: torch.nn.Module, set_quantize_io: bool = False
@@ -275,6 +278,7 @@ def test_dw_conv2d_u55_BI(
275278
# Expected to fail as conv1d needs transpose which is not supported
276279
# on u55.
277280
@parameterized.expand(testsuite_conv1d, skip_on_empty=True)
281+
@pytest.mark.corstone_fvp
278282
@unittest.expectedFailure
279283
def test_dw_conv1d_u55_BI(
280284
self, test_name: str, model: torch.nn.Module, set_quantize_io: bool = False
@@ -288,6 +292,7 @@ def test_dw_conv1d_u55_BI(
288292
)
289293

290294
@parameterized.expand(testsuite_conv1d + testsuite_conv2d_u85)
295+
@pytest.mark.corstone_fvp
291296
def test_dw_conv_u85_BI(
292297
self, test_name: str, model: torch.nn.Module, set_quantize_io: bool = False
293298
):
@@ -301,6 +306,7 @@ def test_dw_conv_u85_BI(
301306

302307
# All test cases except 3x3_1x3x256x256_gp3_st1 have numerical issues on FVP. MLETORCH-520
303308
@parameterized.expand(testsuite_conv2d_u85_xfails)
309+
@pytest.mark.corstone_fvp
304310
@conftest.expectedFailureOnFVP
305311
def test_dw_conv_u85_BI_xfails(
306312
self, test_name: str, model: torch.nn.Module, set_quantize_io: bool = False

0 commit comments

Comments
 (0)