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 conftest
67import logging
78from typing import Tuple
89
@@ -50,7 +51,13 @@ def test_single_reject(caplog, test_data: input_t1):
5051 caplog .set_level (logging .INFO )
5152
5253 module = CustomPartitioning ()
53- pipeline = TosaPipelineFP [input_t1 ](module , test_data , [], exir_op = [])
54+ pipeline = TosaPipelineFP [input_t1 ](
55+ module ,
56+ test_data ,
57+ [],
58+ exir_op = [],
59+ run_on_tosa_ref_model = conftest .is_option_enabled ("tosa_ref_model" ),
60+ )
5461 check = DontPartition (exir_ops .edge .aten .sigmoid .default )
5562 pipeline .change_args ("to_edge_transform_and_lower" , additional_checks = [check ])
5663 pipeline .change_args (
@@ -68,7 +75,13 @@ def test_single_reject(caplog, test_data: input_t1):
6875@common .parametrize ("test_data" , CustomPartitioning .inputs )
6976def test_multiple_reject (test_data : input_t1 ):
7077 module = CustomPartitioning ()
71- pipeline = TosaPipelineFP [input_t1 ](module , test_data , [], exir_op = [])
78+ pipeline = TosaPipelineFP [input_t1 ](
79+ module ,
80+ test_data ,
81+ [],
82+ exir_op = [],
83+ run_on_tosa_ref_model = conftest .is_option_enabled ("tosa_ref_model" ),
84+ )
7285 check = DontPartition (
7386 exir_ops .edge .aten .sigmoid .default , exir_ops .edge .aten .mul .Tensor
7487 )
@@ -90,7 +103,13 @@ def test_torch_op_reject(caplog, test_data: input_t1):
90103
91104 module = CustomPartitioning ()
92105 check = DontPartition (torch .ops .aten .sigmoid .default )
93- pipeline = TosaPipelineFP [input_t1 ](module , test_data , [], exir_op = [])
106+ pipeline = TosaPipelineFP [input_t1 ](
107+ module ,
108+ test_data ,
109+ [],
110+ exir_op = [],
111+ run_on_tosa_ref_model = conftest .is_option_enabled ("tosa_ref_model" ),
112+ )
94113 pipeline .change_args ("to_edge_transform_and_lower" , additional_checks = [check ])
95114 pipeline .change_args (
96115 "check_count.exir" , {"torch.ops.higher_order.executorch_call_delegate" : 2 }
@@ -108,7 +127,13 @@ def test_torch_op_reject(caplog, test_data: input_t1):
108127def test_string_op_reject (test_data : input_t1 ):
109128 module = CustomPartitioning ()
110129 check = DontPartition ("aten.sigmoid.default" )
111- pipeline = TosaPipelineFP [input_t1 ](module , test_data , [], exir_op = [])
130+ pipeline = TosaPipelineFP [input_t1 ](
131+ module ,
132+ test_data ,
133+ [],
134+ exir_op = [],
135+ run_on_tosa_ref_model = conftest .is_option_enabled ("tosa_ref_model" ),
136+ )
112137 pipeline .change_args ("to_edge_transform_and_lower" , additional_checks = [check ])
113138 pipeline .change_args (
114139 "check_count.exir" , {"torch.ops.higher_order.executorch_call_delegate" : 2 }
@@ -127,7 +152,13 @@ def test_name_reject(caplog, test_data: input_t1):
127152
128153 module = CustomPartitioning ()
129154 check = DontPartitionName ("mul" , "sigmoid" , exact = False )
130- pipeline = TosaPipelineFP [input_t1 ](module , test_data , [], exir_op = [])
155+ pipeline = TosaPipelineFP [input_t1 ](
156+ module ,
157+ test_data ,
158+ [],
159+ exir_op = [],
160+ run_on_tosa_ref_model = conftest .is_option_enabled ("tosa_ref_model" ),
161+ )
131162 pipeline .change_args ("to_edge_transform_and_lower" , additional_checks = [check ])
132163 pipeline .change_args (
133164 "check_count.exir" ,
@@ -142,7 +173,13 @@ def test_name_reject(caplog, test_data: input_t1):
142173def test_module_reject (test_data : input_t1 ):
143174 module = NestedModule ()
144175 check = DontPartitionModule (module_name = "CustomPartitioning" )
145- pipeline = TosaPipelineFP [input_t1 ](module , test_data , [], exir_op = [])
176+ pipeline = TosaPipelineFP [input_t1 ](
177+ module ,
178+ test_data ,
179+ [],
180+ exir_op = [],
181+ run_on_tosa_ref_model = conftest .is_option_enabled ("tosa_ref_model" ),
182+ )
146183 pipeline .change_args ("to_edge_transform_and_lower" , additional_checks = [check ])
147184 pipeline .change_args (
148185 "check_count.exir" ,
@@ -158,7 +195,13 @@ def test_inexact_module_reject(caplog, test_data: input_t1):
158195
159196 module = NestedModule ()
160197 check = DontPartitionModule (module_name = "Custom" , exact = False )
161- pipeline = TosaPipelineFP [input_t1 ](module , test_data , [], exir_op = [])
198+ pipeline = TosaPipelineFP [input_t1 ](
199+ module ,
200+ test_data ,
201+ [],
202+ exir_op = [],
203+ run_on_tosa_ref_model = conftest .is_option_enabled ("tosa_ref_model" ),
204+ )
162205 pipeline .change_args ("to_edge_transform_and_lower" , additional_checks = [check ])
163206 pipeline .change_args (
164207 "check_count.exir" ,
@@ -173,7 +216,13 @@ def test_inexact_module_reject(caplog, test_data: input_t1):
173216def test_module_instance_reject (test_data : input_t1 ):
174217 module = NestedModule ()
175218 check = DontPartitionModule (instance_name = "nested" )
176- pipeline = TosaPipelineFP [input_t1 ](module , test_data , [], exir_op = [])
219+ pipeline = TosaPipelineFP [input_t1 ](
220+ module ,
221+ test_data ,
222+ [],
223+ exir_op = [],
224+ run_on_tosa_ref_model = conftest .is_option_enabled ("tosa_ref_model" ),
225+ )
177226 pipeline .change_args ("to_edge_transform_and_lower" , additional_checks = [check ])
178227 pipeline .change_args (
179228 "check_count.exir" ,
0 commit comments