@@ -3458,16 +3458,6 @@ def test_qnn_backend_draw_graph(self):
34583458
34593459
34603460class TestExampleLLMScript (TestQNN ):
3461- def required_envs (self , conditions = None ) -> bool :
3462- conditions = [] if conditions is None else conditions
3463- return all (
3464- [
3465- self .executorch_root ,
3466- self .artifact_dir ,
3467- * conditions ,
3468- ]
3469- )
3470-
34713461 def test_llama3_2_1b (self ):
34723462 if not self .required_envs ():
34733463 self .skipTest ("missing required envs" )
@@ -3625,16 +3615,6 @@ def test_llama_stories_110m(self):
36253615
36263616
36273617class TestExampleOssScript (TestQNN ):
3628- def required_envs (self , conditions = None ) -> bool :
3629- conditions = [] if conditions is None else conditions
3630- return all (
3631- [
3632- self .executorch_root ,
3633- self .artifact_dir ,
3634- * conditions ,
3635- ]
3636- )
3637-
36383618 def test_conv_former (self ):
36393619 if not self .required_envs ([self .image_dataset ]):
36403620 self .skipTest ("missing required envs" )
@@ -4046,16 +4026,6 @@ def test_ssd300_vgg16(self):
40464026
40474027
40484028class TestExampleQaihubScript (TestQNN ):
4049- def required_envs (self , conditions = None ) -> bool :
4050- conditions = [] if conditions is None else conditions
4051- return all (
4052- [
4053- self .executorch_root ,
4054- self .artifact_dir ,
4055- * conditions ,
4056- ]
4057- )
4058-
40594029 def test_utils_export (self ):
40604030 with tempfile .TemporaryDirectory () as tmp_dir :
40614031 module = ContextBinaryExample () # noqa: F405
@@ -4284,16 +4254,6 @@ def test_stable_diffusion(self):
42844254
42854255
42864256class TestExampleScript (TestQNN ):
4287- def required_envs (self , conditions = None ) -> bool :
4288- conditions = [] if conditions is None else conditions
4289- return all (
4290- [
4291- self .executorch_root ,
4292- self .artifact_dir ,
4293- * conditions ,
4294- ]
4295- )
4296-
42974257 def test_mobilenet_v2 (self ):
42984258 if not self .required_envs ([self .image_dataset ]):
42994259 self .skipTest ("missing required envs" )
@@ -4559,38 +4519,6 @@ def test_deeplab_v3(self):
45594519 self .assertGreaterEqual (msg ["MPA" ], 0.70 )
45604520 self .assertGreaterEqual (msg ["MIoU" ], 0.55 )
45614521
4562- def test_custom_op (self ):
4563- if not self .required_envs ([self .op_package_dir ]):
4564- self .skipTest ("missing required envs" )
4565- cmds = [
4566- "python" ,
4567- f"{ self .executorch_root } /examples/qualcomm/custom_op/custom_ops_1.py" ,
4568- "--artifact" ,
4569- self .artifact_dir ,
4570- "--build_folder" ,
4571- self .build_folder ,
4572- "--device" ,
4573- self .device ,
4574- "--model" ,
4575- self .model ,
4576- "--ip" ,
4577- self .ip ,
4578- "--port" ,
4579- str (self .port ),
4580- "--op_package_dir" ,
4581- self .op_package_dir ,
4582- "--build_op_package" ,
4583- ]
4584- if self .host :
4585- cmds .extend (["--host" , self .host ])
4586-
4587- p = subprocess .Popen (cmds , stdout = subprocess .DEVNULL )
4588- with Listener ((self .ip , self .port )) as listener :
4589- conn = listener .accept ()
4590- p .communicate ()
4591- msg = json .loads (conn .recv ())
4592- self .assertTrue (msg ["is_close" ])
4593-
45944522 @unittest .skip ("dynamic shape inputs appear in recent torch.export.export" )
45954523 def test_mobilebert (self ):
45964524 if not self .required_envs ([self .pretrained_weight ]):
@@ -4737,6 +4665,40 @@ def test_export_example(self):
47374665 )
47384666
47394667
4668+ class TestUtilScript (TestQNN ):
4669+ def test_custom_op (self ):
4670+ if not self .required_envs ([self .op_package_dir ]):
4671+ self .skipTest ("missing required envs" )
4672+ cmds = [
4673+ "python" ,
4674+ f"{ self .executorch_root } /examples/qualcomm/custom_op/custom_ops_1.py" ,
4675+ "--artifact" ,
4676+ self .artifact_dir ,
4677+ "--build_folder" ,
4678+ self .build_folder ,
4679+ "--device" ,
4680+ self .device ,
4681+ "--model" ,
4682+ self .model ,
4683+ "--ip" ,
4684+ self .ip ,
4685+ "--port" ,
4686+ str (self .port ),
4687+ "--op_package_dir" ,
4688+ self .op_package_dir ,
4689+ "--build_op_package" ,
4690+ ]
4691+ if self .host :
4692+ cmds .extend (["--host" , self .host ])
4693+
4694+ p = subprocess .Popen (cmds , stdout = subprocess .DEVNULL )
4695+ with Listener ((self .ip , self .port )) as listener :
4696+ conn = listener .accept ()
4697+ p .communicate ()
4698+ msg = json .loads (conn .recv ())
4699+ self .assertTrue (msg ["is_close" ])
4700+
4701+
47404702def setup_environment ():
47414703 parser = setup_common_args_and_variables ()
47424704
0 commit comments