@@ -3107,16 +3107,6 @@ def test_qnn_backend_draw_graph(self):
3107
3107
3108
3108
3109
3109
class TestExampleLLMScript (TestQNN ):
3110
- def required_envs (self , conditions = None ) -> bool :
3111
- conditions = [] if conditions is None else conditions
3112
- return all (
3113
- [
3114
- self .executorch_root ,
3115
- self .artifact_dir ,
3116
- * conditions ,
3117
- ]
3118
- )
3119
-
3120
3110
def test_llama3_2_1b (self ):
3121
3111
if not self .required_envs ():
3122
3112
self .skipTest ("missing required envs" )
@@ -3274,16 +3264,6 @@ def test_llama_stories_110m(self):
3274
3264
3275
3265
3276
3266
class TestExampleOssScript (TestQNN ):
3277
- def required_envs (self , conditions = None ) -> bool :
3278
- conditions = [] if conditions is None else conditions
3279
- return all (
3280
- [
3281
- self .executorch_root ,
3282
- self .artifact_dir ,
3283
- * conditions ,
3284
- ]
3285
- )
3286
-
3287
3267
def test_conv_former (self ):
3288
3268
if not self .required_envs ([self .image_dataset ]):
3289
3269
self .skipTest ("missing required envs" )
@@ -3655,16 +3635,6 @@ def test_ssd300_vgg16(self):
3655
3635
3656
3636
3657
3637
class TestExampleQaihubScript (TestQNN ):
3658
- def required_envs (self , conditions = None ) -> bool :
3659
- conditions = [] if conditions is None else conditions
3660
- return all (
3661
- [
3662
- self .executorch_root ,
3663
- self .artifact_dir ,
3664
- * conditions ,
3665
- ]
3666
- )
3667
-
3668
3638
def test_utils_export (self ):
3669
3639
with tempfile .TemporaryDirectory () as tmp_dir :
3670
3640
module = ContextBinaryExample () # noqa: F405
@@ -3893,16 +3863,6 @@ def test_stable_diffusion(self):
3893
3863
3894
3864
3895
3865
class TestExampleScript (TestQNN ):
3896
- def required_envs (self , conditions = None ) -> bool :
3897
- conditions = [] if conditions is None else conditions
3898
- return all (
3899
- [
3900
- self .executorch_root ,
3901
- self .artifact_dir ,
3902
- * conditions ,
3903
- ]
3904
- )
3905
-
3906
3866
def test_mobilenet_v2 (self ):
3907
3867
if not self .required_envs ([self .image_dataset ]):
3908
3868
self .skipTest ("missing required envs" )
@@ -4168,38 +4128,6 @@ def test_deeplab_v3(self):
4168
4128
self .assertGreaterEqual (msg ["MPA" ], 0.70 )
4169
4129
self .assertGreaterEqual (msg ["MIoU" ], 0.55 )
4170
4130
4171
- def test_custom_op (self ):
4172
- if not self .required_envs ([self .op_package_dir ]):
4173
- self .skipTest ("missing required envs" )
4174
- cmds = [
4175
- "python" ,
4176
- f"{ self .executorch_root } /examples/qualcomm/custom_op/custom_ops_1.py" ,
4177
- "--artifact" ,
4178
- self .artifact_dir ,
4179
- "--build_folder" ,
4180
- self .build_folder ,
4181
- "--device" ,
4182
- self .device ,
4183
- "--model" ,
4184
- self .model ,
4185
- "--ip" ,
4186
- self .ip ,
4187
- "--port" ,
4188
- str (self .port ),
4189
- "--op_package_dir" ,
4190
- self .op_package_dir ,
4191
- "--build_op_package" ,
4192
- ]
4193
- if self .host :
4194
- cmds .extend (["--host" , self .host ])
4195
-
4196
- p = subprocess .Popen (cmds , stdout = subprocess .DEVNULL )
4197
- with Listener ((self .ip , self .port )) as listener :
4198
- conn = listener .accept ()
4199
- p .communicate ()
4200
- msg = json .loads (conn .recv ())
4201
- self .assertTrue (msg ["is_close" ])
4202
-
4203
4131
@unittest .skip ("dynamic shape inputs appear in recent torch.export.export" )
4204
4132
def test_mobilebert (self ):
4205
4133
if not self .required_envs ([self .pretrained_weight ]):
@@ -4346,6 +4274,40 @@ def test_export_example(self):
4346
4274
)
4347
4275
4348
4276
4277
+ class TestUtilScript (TestQNN ):
4278
+ def test_custom_op (self ):
4279
+ if not self .required_envs ([self .op_package_dir ]):
4280
+ self .skipTest ("missing required envs" )
4281
+ cmds = [
4282
+ "python" ,
4283
+ f"{ self .executorch_root } /examples/qualcomm/custom_op/custom_ops_1.py" ,
4284
+ "--artifact" ,
4285
+ self .artifact_dir ,
4286
+ "--build_folder" ,
4287
+ self .build_folder ,
4288
+ "--device" ,
4289
+ self .device ,
4290
+ "--model" ,
4291
+ self .model ,
4292
+ "--ip" ,
4293
+ self .ip ,
4294
+ "--port" ,
4295
+ str (self .port ),
4296
+ "--op_package_dir" ,
4297
+ self .op_package_dir ,
4298
+ "--build_op_package" ,
4299
+ ]
4300
+ if self .host :
4301
+ cmds .extend (["--host" , self .host ])
4302
+
4303
+ p = subprocess .Popen (cmds , stdout = subprocess .DEVNULL )
4304
+ with Listener ((self .ip , self .port )) as listener :
4305
+ conn = listener .accept ()
4306
+ p .communicate ()
4307
+ msg = json .loads (conn .recv ())
4308
+ self .assertTrue (msg ["is_close" ])
4309
+
4310
+
4349
4311
def setup_environment ():
4350
4312
parser = setup_common_args_and_variables ()
4351
4313
0 commit comments