@@ -139,5 +139,54 @@ def test_networks_with_usmp_and_cascader_wo_striping(accel_type, model_url, work
139139 assert allocated_pool_info .allocated_size == workspace_size
140140
141141
142+ @pytest .mark .parametrize (
143+ "accel_type, model_url, workspace_size" ,
144+ [
145+ ("ethos-u55-256" , MOBILENET_V1_URL , 1005440 ),
146+ ("ethos-u55-256" , MOBILENET_V2_URL , 1162368 ),
147+ ],
148+ )
149+ def test_networks_with_usmp_and_cascader_with_striping (accel_type , model_url , workspace_size ):
150+ np .random .seed (23 )
151+
152+ pool_name = "my_memory_pool"
153+ host_target = tvm .target .Target ("c" )
154+ ethosu_target = tvm .target .Target ("ethos-u" )
155+ workspace_pools = WorkspaceMemoryPools (
156+ [
157+ WorkspacePoolInfo (
158+ pool_name ,
159+ [host_target , ethosu_target ],
160+ PoolInfoProperties (
161+ size_hint_bytes = 1200000 ,
162+ read_bandwidth_bytes_per_cycle = 16 ,
163+ write_bandwidth_bytes_per_cycle = 16 ,
164+ target_burst_bytes = {ethosu_target : 1 },
165+ ),
166+ )
167+ ]
168+ )
169+ tflite_model_buf = infra .get_tflite_model (model_url )
170+ input_data , output_data = infra .generate_ref_data_tflite (tflite_model_buf )
171+ mod , params = convert_to_relay (tflite_model_buf )
172+ mod = partition_for_ethosu (mod , params )
173+ test_runner = infra .create_test_runner (
174+ accel_type ,
175+ enable_usmp = True ,
176+ enable_cascader = True ,
177+ enable_striping = True ,
178+ workspace_pools = workspace_pools ,
179+ )
180+ compiled_models = infra .build_source (
181+ mod , input_data , output_data , test_runner , workspace_pools = workspace_pools
182+ )
183+ infra .verify_source (compiled_models , test_runner )
184+
185+ allocated_pool_info = list (
186+ dict (compiled_models [0 ].executor_factory .executor_codegen_metadata .pool_inputs ).values ()
187+ )[0 ]
188+ assert allocated_pool_info .allocated_size == workspace_size
189+
190+
142191if __name__ == "__main__" :
143192 pytest .main ([__file__ ])
0 commit comments