7
7
import os
8
8
import subprocess
9
9
import sys
10
+ import time
10
11
11
12
12
13
def get_args ():
@@ -199,12 +200,17 @@ def run_elf_with_fvp(script_path: str, elf_file: str, target: str, timeout: int)
199
200
200
201
201
202
if __name__ == "__main__" :
202
-
203
+ total_start_time = time . perf_counter ()
203
204
args = get_args ()
204
205
script_path = os .path .join ("backends" , "arm" , "scripts" )
205
206
206
207
if args .build_libs :
208
+ start_time = time .perf_counter ()
207
209
build_libs (args .test_output , script_path )
210
+ end_time = time .perf_counter ()
211
+ print (
212
+ f"[Test model: { end_time - start_time :.2f} s] Build needed executorch libs"
213
+ )
208
214
209
215
if args .model :
210
216
model_name = args .model .split (" " )[0 ].split (";" )[0 ]
@@ -217,6 +223,7 @@ def run_elf_with_fvp(script_path: str, elf_file: str, target: str, timeout: int)
217
223
args .test_output , f"{ model_name } _arm_delegate_{ args .target } "
218
224
)
219
225
226
+ start_time = time .perf_counter ()
220
227
pte_file = build_pte (
221
228
args .test_output ,
222
229
model_name ,
@@ -226,13 +233,17 @@ def run_elf_with_fvp(script_path: str, elf_file: str, target: str, timeout: int)
226
233
output ,
227
234
args .no_intermediate ,
228
235
)
229
- print (f"PTE file created: { pte_file } " )
236
+ end_time = time .perf_counter ()
237
+ print (
238
+ f"[Test model: { end_time - start_time :.2f} s] PTE file created: { pte_file } "
239
+ )
230
240
231
241
if "ethos-u" in args .target :
232
242
elf_build_path = os .path .join (
233
243
output , f"{ model_name } _arm_delegate_{ args .target } "
234
244
)
235
245
246
+ start_time = time .perf_counter ()
236
247
elf_file = build_ethosu_runtime (
237
248
args .test_output ,
238
249
script_path ,
@@ -243,7 +254,18 @@ def run_elf_with_fvp(script_path: str, elf_file: str, target: str, timeout: int)
243
254
args .extra_flags ,
244
255
elf_build_path ,
245
256
)
246
- print (f"ELF file created: { elf_file } " )
257
+ end_time = time .perf_counter ()
258
+ print (
259
+ f"[Test model: { end_time - start_time :.2f} s] ELF file created: { elf_file } "
260
+ )
247
261
262
+ start_time = time .perf_counter ()
248
263
run_elf_with_fvp (script_path , elf_file , args .target , args .timeout )
249
- print (f"Model: { model_name } on { args .target } -> PASS" )
264
+ end_time = time .perf_counter ()
265
+ print (
266
+ f"[Test model: { end_time - start_time :.2f} s] Tested elf on FVP { elf_file } "
267
+ )
268
+ total_end_time = time .perf_counter ()
269
+ print (
270
+ f"[Test model: { total_end_time - total_start_time :.2f} s total] Model: { model_name } on { args .target } -> PASS"
271
+ )
0 commit comments