@@ -1581,6 +1581,24 @@ def test_qnn_backend_skip_node_op(self):
1581
1581
skip_node_op_set = {"aten.add.Tensor" },
1582
1582
)
1583
1583
1584
+ def test_qnn_backend_spill_fill_buffer_size (self ):
1585
+ module = LargeTensorLinear () # noqa: F405
1586
+ sample_input = (torch .randn (1 , 256 , 512 ),)
1587
+ edge_prog = capture_program (module , sample_input )
1588
+
1589
+ backend_options = generate_htp_compiler_spec (
1590
+ use_fp16 = True ,
1591
+ use_multi_contexts = True ,
1592
+ )
1593
+ compiler_specs = generate_qnn_executorch_compiler_spec (
1594
+ soc_model = self .chipset_table [TestQNN .model ],
1595
+ backend_options = backend_options ,
1596
+ )
1597
+ partitioner = QnnPartitioner (compiler_specs )
1598
+ edge_prog .exported_program = to_backend (edge_prog .exported_program , partitioner )
1599
+ max_sf_size = update_spill_fill_size (edge_prog .exported_program )
1600
+ self .assertNotEqual (0 , max_sf_size )
1601
+
1584
1602
def test_qnn_backend_multi_contexts (self ):
1585
1603
module = SimpleModel () # noqa: F405
1586
1604
sample_input = (torch .ones (1 , 32 , 28 , 28 ), torch .ones (1 , 32 , 28 , 28 ))
@@ -2011,6 +2029,25 @@ def calibrator(gm):
2011
2029
).to_executorch ()
2012
2030
self .verify_output (module , sample_input , exec_prog )
2013
2031
2032
+ def test_qnn_backend_spill_fill_buffer_size (self ):
2033
+ module = LargeTensorLinear () # noqa: F405
2034
+ sample_input = (torch .randn (1 , 256 , 512 ),)
2035
+ module = self .get_qdq_module (module , sample_input )
2036
+ edge_prog = capture_program (module , sample_input )
2037
+
2038
+ backend_options = generate_htp_compiler_spec (
2039
+ use_fp16 = False ,
2040
+ use_multi_contexts = True ,
2041
+ )
2042
+ compiler_specs = generate_qnn_executorch_compiler_spec (
2043
+ soc_model = self .chipset_table [TestQNN .model ],
2044
+ backend_options = backend_options ,
2045
+ )
2046
+ partitioner = QnnPartitioner (compiler_specs )
2047
+ edge_prog .exported_program = to_backend (edge_prog .exported_program , partitioner )
2048
+ max_sf_size = update_spill_fill_size (edge_prog .exported_program )
2049
+ self .assertNotEqual (0 , max_sf_size )
2050
+
2014
2051
def test_qnn_backend_graph_level_mixed_precision (self ):
2015
2052
module = SimpleModel () # noqa: F405
2016
2053
sample_input = (torch .ones (1 , 32 , 28 , 28 ), torch .ones (1 , 32 , 28 , 28 ))
0 commit comments