2727
2828def run_visual_language_generation_optimum (
2929 inputs , num , model , processor , args , iter_data_list , md5_list , prompt_index ,
30- bench_hook , model_precision , proc_id , mem_consumption , decym_frames = None ):
30+ bench_hook , model_precision , proc_id , mem_consumption ):
3131 from optimum .intel .utils .import_utils import is_transformers_version
3232 set_seed (args ['seed' ])
3333 if args ['batch_size' ] != 1 :
3434 log .warning ("Only batch size 1 available for benchmarking" )
3535 args ["batch_size" ] = 1
3636
37+ decym_frames = args ["video_frames" ]
3738 prompts , images , videos = extract_prompt_issues (inputs , decym_frames , False )
3839 if args ["output_dir" ] is not None and num == 0 :
3940 for bs_index , in_text in enumerate (prompts ):
@@ -180,12 +181,13 @@ def run_visual_language_generation_optimum(
180181
181182
182183def run_visual_language_generation_genai (
183- inputs , num , model , processor , args , iter_data_list , md5_list , prompt_index ,
184- streamer , model_precision , proc_id , mem_consumption , decym_frames = None ):
184+ inputs , num , model , processor , args , iter_data_list , md5_list ,
185+ prompt_index , streamer , model_precision , proc_id , mem_consumption ):
185186 if args ['batch_size' ] != 1 :
186187 log .warning ("Only batch size 1 available for benchmarking" )
187188 args ["batch_size" ] = 1
188189
190+ decym_frames = args ["video_frames" ]
189191 prompts , images , videos = extract_prompt_issues (inputs , decym_frames , True )
190192 if args ["output_dir" ] is not None and num == 0 :
191193 for bs_index , in_text in enumerate (prompts ):
@@ -294,9 +296,7 @@ def run_visual_language_generation_genai(
294296 metrics_print .print_generated (num , warm_up = (num == 0 ), generated = generated_text [0 ], prompt_idx = prompt_index )
295297
296298
297- def run_visual_language_generation_benchmark (
298- model_path , framework , device , args , num_iters ,
299- mem_consumption , decym_frames = None ):
299+ def run_visual_language_generation_benchmark (model_path , framework , device , args , num_iters , mem_consumption ):
300300 outs = FW_UTILS [framework ].create_image_text_gen_model (model_path , device , mem_consumption , ** args )
301301 model , processor , pretrain_time , bench_hook , use_genai = outs
302302 model_precision = model_utils .get_model_precision (model_path .parts )
@@ -335,7 +335,7 @@ def run_visual_language_generation_benchmark(
335335 iter_timestamp [num ][p_idx ]['start' ] = datetime .datetime .now ().isoformat ()
336336 gen_fn (
337337 input_text , num , model , processor , args , iter_data_list , md5_list ,
338- p_idx , bench_hook , model_precision , proc_id , mem_consumption , decym_frames )
338+ p_idx , bench_hook , model_precision , proc_id , mem_consumption )
339339 iter_timestamp [num ][p_idx ]['end' ] = datetime .datetime .now ().isoformat ()
340340 prefix = f"[warm-up][P{ p_idx } ]" if num == 0 else f"[{ num } ][P{ p_idx } ]"
341341 log .info (f"{ prefix } start: { iter_timestamp [num ][p_idx ]['start' ]} , end: { iter_timestamp [num ][p_idx ]['end' ]} " )
@@ -348,8 +348,8 @@ def run_visual_language_generation_benchmark(
348348 metrics_print .print_unicode (prefix , max_output = metrics_print .MAX_INPUT_TXT_IN_LOG )
349349 iter_timestamp [num ][p_idx ]['start' ] = datetime .datetime .now ().isoformat ()
350350 gen_fn (
351- input_text , num , model , processor , args , iter_data_list , md5_list , prompt_idx_list [ idx ],
352- bench_hook , model_precision , proc_id , mem_consumption , decym_frames )
351+ input_text , num , model , processor , args , iter_data_list , md5_list ,
352+ prompt_idx_list [ idx ], bench_hook , model_precision , proc_id , mem_consumption )
353353 iter_timestamp [num ][p_idx ]['end' ] = datetime .datetime .now ().isoformat ()
354354 prefix = f"[warm-up][P{ p_idx } ]" if num == 0 else f"[{ num } ][P{ p_idx } ]"
355355 log .info (f"{ prefix } start: { iter_timestamp [num ][p_idx ]['start' ]} , end: { iter_timestamp [num ][p_idx ]['end' ]} " )
0 commit comments