@@ -1982,6 +1982,15 @@ def test_qnn_backend_conv2d_slice_copy(self):
19821982 sample_input = (torch .randn ([2 , 1 , 3 , 3 ]),)
19831983 self .lower_module_and_test_output (module , sample_input )
19841984
1985+ def test_qnn_backend_conv2d_stack (self ):
1986+ module = Conv2dStack () # noqa: F405
1987+ sample_input = (
1988+ torch .randn (1 , 3 , 5 , 5 ),
1989+ torch .randn (1 , 3 , 3 , 3 ),
1990+ torch .randn (1 , 3 , 3 , 3 ),
1991+ )
1992+ self .lower_module_and_test_output (module , sample_input )
1993+
19851994 def test_qnn_backend_conv2d_sum_reduce_dim (self ):
19861995 module = Conv2dSumReduceDim () # noqa: F405
19871996 sample_input = (torch .randn ([1 , 1 , 3 , 3 ]),)
@@ -1992,6 +2001,14 @@ def test_qnn_backend_conv2d_topk(self):
19922001 sample_input = (torch .randn (1 , 3 , 32 , 32 ),)
19932002 self .lower_module_and_test_output (module , sample_input )
19942003
2004+ # This test is to ensure unbind should be pytorch layout.
2005+ # However, unbind will be forced decomposed by executorch framework.
2006+ # Keep it here in case unbind doesn't get forced decomposed in future.
2007+ def test_qnn_backend_conv2d_unbind (self ):
2008+ module = Conv2dUnbind () # noqa: F405
2009+ sample_input = (torch .randn (1 , 3 , 5 , 5 ),)
2010+ self .lower_module_and_test_output (module , sample_input )
2011+
19952012 def test_qnn_backend_copy (self ):
19962013 sample_inputs = [
19972014 (torch .randn (3 , 4 , 5 ),),
@@ -4365,6 +4382,16 @@ def test_qnn_backend_conv2d_slice_copy(self):
43654382 module = self .get_qdq_module (module , sample_input )
43664383 self .lower_module_and_test_output (module , sample_input )
43674384
4385+ def test_qnn_backend_conv2d_stack (self ):
4386+ module = Conv2dStack () # noqa: F405
4387+ sample_input = (
4388+ torch .randn (1 , 3 , 5 , 5 ),
4389+ torch .randn (1 , 3 , 3 , 3 ),
4390+ torch .randn (1 , 3 , 3 , 3 ),
4391+ )
4392+ module = self .get_qdq_module (module , sample_input )
4393+ self .lower_module_and_test_output (module , sample_input )
4394+
43684395 def test_qnn_backend_conv2d_sum_reduce_dim (self ):
43694396 module = Conv2dSumReduceDim () # noqa: F405
43704397 sample_input = (torch .randn ([1 , 1 , 3 , 3 ]),)
@@ -4377,6 +4404,15 @@ def test_qnn_backend_conv2d_topk(self):
43774404 module = self .get_qdq_module (module , sample_input )
43784405 self .lower_module_and_test_output (module , sample_input )
43794406
4407+ # This test is to ensure unbind should be pytorch layout.
4408+ # However, unbind will be forced decomposed by executorch framework.
4409+ # Keep it here in case unbind doesn't get forced decomposed in future.
4410+ def test_qnn_backend_conv2d_unbind (self ):
4411+ module = Conv2dUnbind () # noqa: F405
4412+ sample_input = (torch .randn (1 , 3 , 5 , 5 ),)
4413+ module = self .get_qdq_module (module , sample_input )
4414+ self .lower_module_and_test_output (module , sample_input )
4415+
43804416 def test_qnn_backend_copy (self ):
43814417 sample_inputs = [
43824418 (torch .randn (3 , 4 , 5 ),),
@@ -7757,7 +7793,7 @@ def test_mobilenet_v3(self):
77577793 metric = {
77587794 # GPU has accuracy issue now
77597795 QnnExecuTorchBackendType .kGpuBackend : {"top_1" : 0 , "top_5" : 0 },
7760- QnnExecuTorchBackendType .kHtpBackend : {"top_1" : 55 , "top_5" : 81 },
7796+ QnnExecuTorchBackendType .kHtpBackend : {"top_1" : 51 , "top_5" : 76 },
77617797 }
77627798 self .assertGreaterEqual (
77637799 msg ["top_1" ], metric [get_backend_type (self .backend )]["top_1" ]
0 commit comments