@@ -3107,16 +3107,6 @@ def test_qnn_backend_draw_graph(self):
31073107
31083108
31093109class 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-
31203110 def test_llama3_2_1b (self ):
31213111 if not self .required_envs ():
31223112 self .skipTest ("missing required envs" )
@@ -3274,16 +3264,6 @@ def test_llama_stories_110m(self):
32743264
32753265
32763266class 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-
32873267 def test_conv_former (self ):
32883268 if not self .required_envs ([self .image_dataset ]):
32893269 self .skipTest ("missing required envs" )
@@ -3655,16 +3635,6 @@ def test_ssd300_vgg16(self):
36553635
36563636
36573637class 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-
36683638 def test_utils_export (self ):
36693639 with tempfile .TemporaryDirectory () as tmp_dir :
36703640 module = ContextBinaryExample () # noqa: F405
@@ -3893,16 +3863,6 @@ def test_stable_diffusion(self):
38933863
38943864
38953865class 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-
39063866 def test_mobilenet_v2 (self ):
39073867 if not self .required_envs ([self .image_dataset ]):
39083868 self .skipTest ("missing required envs" )
@@ -4168,38 +4128,6 @@ def test_deeplab_v3(self):
41684128 self .assertGreaterEqual (msg ["MPA" ], 0.70 )
41694129 self .assertGreaterEqual (msg ["MIoU" ], 0.55 )
41704130
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-
42034131 @unittest .skip ("dynamic shape inputs appear in recent torch.export.export" )
42044132 def test_mobilebert (self ):
42054133 if not self .required_envs ([self .pretrained_weight ]):
@@ -4346,6 +4274,40 @@ def test_export_example(self):
43464274 )
43474275
43484276
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+
43494311def setup_environment ():
43504312 parser = setup_common_args_and_variables ()
43514313
0 commit comments