@@ -444,6 +444,12 @@ def __init__(
444
444
self .gptq = gptq
445
445
self .lora_correction = lora_correction
446
446
self .backup_precision = backup_precision
447
+ if kwargs .get ("weight_format" ) is not None :
448
+ logger .warning (
449
+ "The `weight_format` parameter is deprecated and will be removed in optimum-intel v1.24.0. "
450
+ "Please use `dtype` instead."
451
+ )
452
+ dtype = kwargs .get ("weight_format" )
447
453
self .dtype = dtype
448
454
self .post_init ()
449
455
@@ -484,7 +490,12 @@ def post_init(self):
484
490
)
485
491
486
492
if self .dtype in ["int4" , "int8" ]:
487
- self .bits = 4 if self .dtype == "int4" else 8
493
+ bits = 4 if self .dtype == "int4" else 8
494
+ if self .bits is not None and self .bits != bits :
495
+ logger .warning (
496
+ f"Overriding `bits` parameter to the value `bits`={ bits } to match the given { self .dtype } `dtype`."
497
+ )
498
+ self .bits = bits
488
499
489
500
if self .bits not in [4 , 8 ]:
490
501
raise ValueError (f"Only support quantization to [4,8] bits but found { self .bits } " )
@@ -690,6 +701,12 @@ def __init__(
690
701
self .fast_bias_correction = fast_bias_correction
691
702
self .overflow_fix = overflow_fix
692
703
self .smooth_quant_alpha = smooth_quant_alpha
704
+ if kwargs .get ("activation_format" ) is not None :
705
+ logger .warning (
706
+ "The `activation_format` parameter is deprecated and will be removed in optimum-intel v1.24.0. "
707
+ "Please use `dtype` instead."
708
+ )
709
+ dtype = kwargs .get ("activation_format" )
693
710
self .dtype = dtype
694
711
695
712
f8_dtypes = ["f8e4m3" , "f8e5m2" ]
@@ -778,9 +795,7 @@ def __init__(
778
795
"compression" , None
779
796
) # A field for backward-compatability of training-time compression parameters
780
797
if self .quantization_config is not None :
781
- if isinstance (self .quantization_config , OVWeightQuantizationConfig ) or isinstance (
782
- self .quantization_config , OVQuantizationConfig
783
- ):
798
+ if isinstance (self .quantization_config , (OVWeightQuantizationConfig , OVQuantizationConfig )):
784
799
self .dtype = self .quantization_config .dtype
785
800
elif isinstance (self .quantization_config , OVMixedQuantizationConfig ):
786
801
wc_dtype = self .quantization_config .weight_quantization_config .dtype
0 commit comments