@@ -114,7 +114,16 @@ class OVCLIExportTestCase(unittest.TestCase):
114
114
(
115
115
"automatic-speech-recognition" ,
116
116
"whisper" ,
117
- "--quant-mode int8 --dataset librispeech --num-samples 1 --smooth-quant-alpha 0.9 --trust-remote-code" ,
117
+ "int8" ,
118
+ "--dataset librispeech --num-samples 1 --smooth-quant-alpha 0.9 --trust-remote-code" ,
119
+ (14 , 22 , 21 ) if is_transformers_version ("<=" , "4.36.0" ) else (14 , 22 , 25 ),
120
+ (14 , 21 , 17 ) if is_transformers_version ("<=" , "4.36.0" ) else (14 , 22 , 18 ),
121
+ ),
122
+ (
123
+ "automatic-speech-recognition" ,
124
+ "whisper" ,
125
+ "f8e4m3" ,
126
+ "--dataset librispeech --num-samples 1 --smooth-quant-alpha 0.9 --trust-remote-code --sym" ,
118
127
(14 , 22 , 21 ) if is_transformers_version ("<=" , "4.36.0" ) else (14 , 22 , 25 ),
119
128
(14 , 21 , 17 ) if is_transformers_version ("<=" , "4.36.0" ) else (14 , 22 , 18 ),
120
129
),
@@ -407,13 +416,14 @@ def test_exporters_cli_full_quantization(
407
416
self ,
408
417
task : str ,
409
418
model_type : str ,
419
+ quant_mode : str ,
410
420
option : str ,
411
421
expected_num_fq_nodes_per_model : Tuple [int ],
412
422
expected_num_weight_nodes_per_model : Tuple [int ],
413
423
):
414
424
with TemporaryDirectory () as tmpdir :
415
425
subprocess .run (
416
- f"optimum-cli export openvino --model { MODEL_NAMES [model_type ]} { option } { tmpdir } " ,
426
+ f"optimum-cli export openvino --model { MODEL_NAMES [model_type ]} --quant-mode { quant_mode } { option } { tmpdir } " ,
417
427
shell = True ,
418
428
check = True ,
419
429
)
@@ -424,9 +434,9 @@ def test_exporters_cli_full_quantization(
424
434
submodels = [model .encoder , model .decoder , model .decoder_with_past ]
425
435
self .assertEqual (len (expected_num_fq_nodes_per_model ), len (submodels ))
426
436
for i , model in enumerate (submodels ):
427
- actual_num_fq_nodes , actual_num_weight_nodes = get_num_quantized_nodes (model )
428
- self .assertEqual (expected_num_fq_nodes_per_model [i ], actual_num_fq_nodes )
429
- self .assertEqual (expected_num_weight_nodes_per_model [i ], actual_num_weight_nodes ["int8" ])
437
+ actual_num_f_nodes , actual_num_weight_nodes = get_num_quantized_nodes (model )
438
+ self .assertEqual (expected_num_fq_nodes_per_model [i ], actual_num_f_nodes )
439
+ self .assertEqual (expected_num_weight_nodes_per_model [i ], actual_num_weight_nodes [quant_mode ])
430
440
431
441
def test_exporters_cli_int4_with_local_model_and_default_config (self ):
432
442
with TemporaryDirectory () as tmpdir :
0 commit comments