9
9
10
10
from typing import Tuple
11
11
12
+ import pytest
13
+
12
14
import torch
13
15
14
- from executorch .backends .arm .test import common
16
+ from executorch .backends .arm .test import common , conftest
15
17
16
18
from executorch .backends .arm .test .tester .test_pipeline import (
17
19
EthosU55PipelineBI ,
@@ -64,15 +66,24 @@ def forward(self, x):
64
66
65
67
66
68
@common .parametrize ("test_module" , test_modules )
69
+ @pytest .mark .tosa_ref_model
67
70
def test_avgpool2d_tosa_MI (test_module ):
68
71
model , input_tensor = test_module
69
72
70
- pipeline = TosaPipelineMI [input_t ](model , input_tensor , aten_op , exir_op )
71
- pipeline .change_args ("run_method_and_compare_outputs" , qtol = 1 , atol = 1 , rtol = 1 )
72
- pipeline .run ()
73
+ pipeline = TosaPipelineMI [input_t ](
74
+ model ,
75
+ input_tensor ,
76
+ aten_op ,
77
+ exir_op ,
78
+ run_on_tosa_ref_model = conftest .is_option_enabled ("tosa_ref_model" ),
79
+ )
80
+ if conftest .get_option ("tosa_version" ) == "1.0" :
81
+ pipeline .change_args ("run_method_and_compare_outputs" , qtol = 1 , atol = 1 , rtol = 1 )
82
+ pipeline .run ()
73
83
74
84
75
85
@common .parametrize ("test_module" , test_modules )
86
+ @pytest .mark .tosa_ref_model
76
87
def test_avgpool2d_tosa_BI (test_module ):
77
88
model , input_tensor = test_module
78
89
@@ -82,9 +93,11 @@ def test_avgpool2d_tosa_BI(test_module):
82
93
aten_op ,
83
94
exir_op ,
84
95
symmetric_io_quantization = True ,
96
+ run_on_tosa_ref_model = conftest .is_option_enabled ("tosa_ref_model" ),
85
97
)
86
- pipeline .change_args ("run_method_and_compare_outputs" , qtol = 1 , atol = 1 , rtol = 1 )
87
- pipeline .run ()
98
+ if conftest .get_option ("tosa_version" ) == "0.80" :
99
+ pipeline .change_args ("run_method_and_compare_outputs" , qtol = 1 , atol = 1 , rtol = 1 )
100
+ pipeline .run ()
88
101
89
102
90
103
@common .parametrize ("test_module" , test_modules )
0 commit comments