@@ -3118,16 +3118,6 @@ def test_qnn_backend_draw_graph(self):
31183118
31193119
31203120class 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-
31313121 def test_llama3_2_1b (self ):
31323122 if not self .required_envs ():
31333123 self .skipTest ("missing required envs" )
@@ -3285,16 +3275,6 @@ def test_llama_stories_110m(self):
32853275
32863276
32873277class 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-
32983278 def test_conv_former (self ):
32993279 if not self .required_envs ([self .image_dataset ]):
33003280 self .skipTest ("missing required envs" )
@@ -3666,16 +3646,6 @@ def test_ssd300_vgg16(self):
36663646
36673647
36683648class 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-
36793649 def test_utils_export (self ):
36803650 with tempfile .TemporaryDirectory () as tmp_dir :
36813651 module = ContextBinaryExample () # noqa: F405
@@ -3904,16 +3874,6 @@ def test_stable_diffusion(self):
39043874
39053875
39063876class 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-
39173877 def test_mobilenet_v2 (self ):
39183878 if not self .required_envs ([self .image_dataset ]):
39193879 self .skipTest ("missing required envs" )
@@ -4179,38 +4139,6 @@ def test_deeplab_v3(self):
41794139 self .assertGreaterEqual (msg ["MPA" ], 0.70 )
41804140 self .assertGreaterEqual (msg ["MIoU" ], 0.55 )
41814141
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-
42144142 @unittest .skip ("dynamic shape inputs appear in recent torch.export.export" )
42154143 def test_mobilebert (self ):
42164144 if not self .required_envs ([self .pretrained_weight ]):
@@ -4357,6 +4285,40 @@ def test_export_example(self):
43574285 )
43584286
43594287
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+
43604322def setup_environment ():
43614323 parser = setup_common_args_and_variables ()
43624324
0 commit comments