@@ -3118,16 +3118,6 @@ def test_qnn_backend_draw_graph(self):
3118
3118
3119
3119
3120
3120
class TestExampleLLMScript (TestQNN ):
3121
- def required_envs (self , conditions = None ) -> bool :
3122
- conditions = [] if conditions is None else conditions
3123
- return all (
3124
- [
3125
- self .executorch_root ,
3126
- self .artifact_dir ,
3127
- * conditions ,
3128
- ]
3129
- )
3130
-
3131
3121
def test_llama3_2_1b (self ):
3132
3122
if not self .required_envs ():
3133
3123
self .skipTest ("missing required envs" )
@@ -3285,16 +3275,6 @@ def test_llama_stories_110m(self):
3285
3275
3286
3276
3287
3277
class TestExampleOssScript (TestQNN ):
3288
- def required_envs (self , conditions = None ) -> bool :
3289
- conditions = [] if conditions is None else conditions
3290
- return all (
3291
- [
3292
- self .executorch_root ,
3293
- self .artifact_dir ,
3294
- * conditions ,
3295
- ]
3296
- )
3297
-
3298
3278
def test_conv_former (self ):
3299
3279
if not self .required_envs ([self .image_dataset ]):
3300
3280
self .skipTest ("missing required envs" )
@@ -3666,16 +3646,6 @@ def test_ssd300_vgg16(self):
3666
3646
3667
3647
3668
3648
class TestExampleQaihubScript (TestQNN ):
3669
- def required_envs (self , conditions = None ) -> bool :
3670
- conditions = [] if conditions is None else conditions
3671
- return all (
3672
- [
3673
- self .executorch_root ,
3674
- self .artifact_dir ,
3675
- * conditions ,
3676
- ]
3677
- )
3678
-
3679
3649
def test_utils_export (self ):
3680
3650
with tempfile .TemporaryDirectory () as tmp_dir :
3681
3651
module = ContextBinaryExample () # noqa: F405
@@ -3904,16 +3874,6 @@ def test_stable_diffusion(self):
3904
3874
3905
3875
3906
3876
class TestExampleScript (TestQNN ):
3907
- def required_envs (self , conditions = None ) -> bool :
3908
- conditions = [] if conditions is None else conditions
3909
- return all (
3910
- [
3911
- self .executorch_root ,
3912
- self .artifact_dir ,
3913
- * conditions ,
3914
- ]
3915
- )
3916
-
3917
3877
def test_mobilenet_v2 (self ):
3918
3878
if not self .required_envs ([self .image_dataset ]):
3919
3879
self .skipTest ("missing required envs" )
@@ -4179,38 +4139,6 @@ def test_deeplab_v3(self):
4179
4139
self .assertGreaterEqual (msg ["MPA" ], 0.70 )
4180
4140
self .assertGreaterEqual (msg ["MIoU" ], 0.55 )
4181
4141
4182
- def test_custom_op (self ):
4183
- if not self .required_envs ([self .op_package_dir ]):
4184
- self .skipTest ("missing required envs" )
4185
- cmds = [
4186
- "python" ,
4187
- f"{ self .executorch_root } /examples/qualcomm/custom_op/custom_ops_1.py" ,
4188
- "--artifact" ,
4189
- self .artifact_dir ,
4190
- "--build_folder" ,
4191
- self .build_folder ,
4192
- "--device" ,
4193
- self .device ,
4194
- "--model" ,
4195
- self .model ,
4196
- "--ip" ,
4197
- self .ip ,
4198
- "--port" ,
4199
- str (self .port ),
4200
- "--op_package_dir" ,
4201
- self .op_package_dir ,
4202
- "--build_op_package" ,
4203
- ]
4204
- if self .host :
4205
- cmds .extend (["--host" , self .host ])
4206
-
4207
- p = subprocess .Popen (cmds , stdout = subprocess .DEVNULL )
4208
- with Listener ((self .ip , self .port )) as listener :
4209
- conn = listener .accept ()
4210
- p .communicate ()
4211
- msg = json .loads (conn .recv ())
4212
- self .assertTrue (msg ["is_close" ])
4213
-
4214
4142
@unittest .skip ("dynamic shape inputs appear in recent torch.export.export" )
4215
4143
def test_mobilebert (self ):
4216
4144
if not self .required_envs ([self .pretrained_weight ]):
@@ -4357,6 +4285,40 @@ def test_export_example(self):
4357
4285
)
4358
4286
4359
4287
4288
+ class TestUtilScript (TestQNN ):
4289
+ def test_custom_op (self ):
4290
+ if not self .required_envs ([self .op_package_dir ]):
4291
+ self .skipTest ("missing required envs" )
4292
+ cmds = [
4293
+ "python" ,
4294
+ f"{ self .executorch_root } /examples/qualcomm/custom_op/custom_ops_1.py" ,
4295
+ "--artifact" ,
4296
+ self .artifact_dir ,
4297
+ "--build_folder" ,
4298
+ self .build_folder ,
4299
+ "--device" ,
4300
+ self .device ,
4301
+ "--model" ,
4302
+ self .model ,
4303
+ "--ip" ,
4304
+ self .ip ,
4305
+ "--port" ,
4306
+ str (self .port ),
4307
+ "--op_package_dir" ,
4308
+ self .op_package_dir ,
4309
+ "--build_op_package" ,
4310
+ ]
4311
+ if self .host :
4312
+ cmds .extend (["--host" , self .host ])
4313
+
4314
+ p = subprocess .Popen (cmds , stdout = subprocess .DEVNULL )
4315
+ with Listener ((self .ip , self .port )) as listener :
4316
+ conn = listener .accept ()
4317
+ p .communicate ()
4318
+ msg = json .loads (conn .recv ())
4319
+ self .assertTrue (msg ["is_close" ])
4320
+
4321
+
4360
4322
def setup_environment ():
4361
4323
parser = setup_common_args_and_variables ()
4362
4324
0 commit comments