@@ -208,6 +208,11 @@ def test_qnn_backend_cos(self):
208
208
sample_input = (torch .randn (2 , 5 , 1 , 3 ),)
209
209
self .lower_module_and_test_output (module , sample_input )
210
210
211
+ def test_qnn_backend_cumsum (self ):
212
+ module = CumSum () # noqa: F405
213
+ sample_input = (torch .randn (4 ),)
214
+ self .lower_module_and_test_output (module , sample_input )
215
+
211
216
def test_qnn_backend_einsum_outer_product (self ):
212
217
module = EinsumOuterProduct () # noqa: F405
213
218
x = torch .randn (5 )
@@ -790,10 +795,12 @@ def test_qnn_backend_where(self):
790
795
modules = [
791
796
Where (), # noqa: F405
792
797
WhereConstant (torch .randn (3 , 2 ), torch .randn (3 , 2 )), # noqa: F405
798
+ WhereConstantOther (), # noqa: F405
793
799
]
794
800
sample_inputs = [
795
801
(torch .randn (3 , 2 ), torch .randn (3 , 2 ), torch .randn (3 , 2 )),
796
802
(torch .randn (3 , 2 ),),
803
+ (torch .randn (3 , 2 ),),
797
804
]
798
805
for i , module in enumerate (modules ):
799
806
self .lower_module_and_test_output (module , sample_inputs [i ])
@@ -1165,6 +1172,12 @@ def test_qnn_backend_cos(self):
1165
1172
module = self .get_qdq_module (module , sample_input )
1166
1173
self .lower_module_and_test_output (module , sample_input )
1167
1174
1175
+ def test_qnn_backend_cumsum (self ):
1176
+ module = CumSum () # noqa: F405
1177
+ sample_input = (torch .randn (4 ),)
1178
+ module = self .get_qdq_module (module , sample_input )
1179
+ self .lower_module_and_test_output (module , sample_input )
1180
+
1168
1181
def test_qnn_backend_einsum_outer_product (self ):
1169
1182
module = EinsumOuterProduct () # noqa: F405
1170
1183
x = torch .randn (5 )
@@ -1826,10 +1839,12 @@ def test_qnn_backend_where(self):
1826
1839
modules = [
1827
1840
Where (), # noqa: F405
1828
1841
WhereConstant (torch .randn (3 , 2 ), torch .randn (3 , 2 )), # noqa: F405
1842
+ WhereConstantOther (), # noqa: F405
1829
1843
]
1830
1844
sample_inputs = [
1831
1845
(torch .randn (3 , 2 ), torch .randn (3 , 2 ), torch .randn (3 , 2 )),
1832
1846
(torch .randn (3 , 2 ),),
1847
+ (torch .randn (3 , 2 ),),
1833
1848
]
1834
1849
for i , module in enumerate (modules ):
1835
1850
module = self .get_qdq_module (module , sample_inputs [i ])
@@ -3421,6 +3436,46 @@ def test_dino_v2(self):
3421
3436
self .assertGreaterEqual (msg ["top_1" ], 70 )
3422
3437
self .assertGreaterEqual (msg ["top_5" ], 85 )
3423
3438
3439
+ def test_efficientSAM (self ):
3440
+ if not self .required_envs (
3441
+ [self .image_dataset , self .pretrained_weight , self .oss_repo ]
3442
+ ):
3443
+ self .skipTest ("missing required envs" )
3444
+ cmds = [
3445
+ "python" ,
3446
+ f"{ self .executorch_root } /examples/qualcomm/oss_scripts/efficientSAM.py" ,
3447
+ "--dataset" ,
3448
+ self .image_dataset ,
3449
+ "--artifact" ,
3450
+ self .artifact_dir ,
3451
+ "--build_folder" ,
3452
+ self .build_folder ,
3453
+ "--device" ,
3454
+ self .device ,
3455
+ "--model" ,
3456
+ self .model ,
3457
+ "--oss_repo" ,
3458
+ self .oss_repo ,
3459
+ "--pretrained_weight" ,
3460
+ self .pretrained_weight ,
3461
+ "--ip" ,
3462
+ self .ip ,
3463
+ "--port" ,
3464
+ str (self .port ),
3465
+ ]
3466
+ if self .host :
3467
+ cmds .extend (["--host" , self .host ])
3468
+
3469
+ p = subprocess .Popen (cmds , stdout = subprocess .DEVNULL )
3470
+ with Listener ((self .ip , self .port )) as listener :
3471
+ conn = listener .accept ()
3472
+ p .communicate ()
3473
+ msg = json .loads (conn .recv ())
3474
+ if "Error" in msg :
3475
+ self .fail (msg ["Error" ])
3476
+ else :
3477
+ self .assertGreaterEqual (msg ["MIoU" ], 0.55 )
3478
+
3424
3479
def test_esrgan (self ):
3425
3480
if not self .required_envs ():
3426
3481
self .skipTest ("missing required envs" )
0 commit comments