@@ -342,33 +342,33 @@ def run(self):
342
342
if no_compression_parameter_provided (self .args ) and self .args .weight_format == "int4" :
343
343
quantization_config = get_default_int4_config (self .args .model )
344
344
else :
345
- quantization_config = prepare_for_wc_config (self .args , _DEFAULT_4BIT_CONFIG )
345
+ quantization_config = prepare_wc_config (self .args , _DEFAULT_4BIT_CONFIG )
346
346
347
347
if quantization_config .get ("dataset" , None ) is not None :
348
348
quantization_config ["trust_remote_code" ] = self .args .trust_remote_code
349
349
ov_config = OVConfig (quantization_config = quantization_config )
350
- elif self . args . quant_mode is not None :
350
+ else :
351
351
if self .args .dataset is None :
352
352
raise ValueError (
353
353
"Dataset is required for full quantization. Please provide it with --dataset argument."
354
354
)
355
355
356
356
if self .args .quant_mode == "nf4_f8e4m3" :
357
- wc_config = prepare_for_wc_config (self .args , _DEFAULT_4BIT_CONFIG )
357
+ wc_config = prepare_wc_config (self .args , _DEFAULT_4BIT_CONFIG )
358
358
wc_config ["weight_format" ] = "nf4"
359
359
360
- q_config = prepare_for_q_config (self .args )
360
+ q_config = prepare_q_config (self .args )
361
361
q_config ["activation_format" ] = "f8e4m3"
362
362
363
363
quantization_config = dict (
364
364
weight_quantization_config = wc_config ,
365
- quantization_config = q_config ,
365
+ activation_quantization_config = q_config ,
366
366
num_samples = self .args .num_samples ,
367
367
dataset = self .args .dataset ,
368
368
trust_remote_code = self .args .trust_remote_code ,
369
369
)
370
370
else :
371
- quantization_config = prepare_for_q_config (self .args )
371
+ quantization_config = prepare_q_config (self .args )
372
372
ov_config = OVConfig (quantization_config = quantization_config )
373
373
374
374
quantization_config = ov_config .quantization_config if ov_config else None
@@ -462,7 +462,7 @@ def run(self):
462
462
)
463
463
464
464
465
- def prepare_for_wc_config (args , default_configs ):
465
+ def prepare_wc_config (args , default_configs ):
466
466
is_int8 = args .weight_format == "int8"
467
467
return {
468
468
"bits" : 8 if is_int8 else 4 ,
@@ -482,9 +482,8 @@ def prepare_for_wc_config(args, default_configs):
482
482
}
483
483
484
484
485
- def prepare_for_q_config (args ):
485
+ def prepare_q_config (args ):
486
486
return {
487
- "weight_format" : args .quant_mode ,
488
487
"activation_format" : args .quant_mode ,
489
488
"bits" : 8 ,
490
489
"sym" : args .sym or False ,
0 commit comments