@@ -427,6 +427,9 @@ class OVWeightQuantizationConfig(OVQuantizationConfigBase):
427
427
retained in their original precision without any quantization.
428
428
- "int8_sym" stands for 8-bit integer symmetric quantization without zero point.
429
429
- "int8_asym" stands for 8-bit integer asymmetric quantization with zero points per each quantization group.
430
+ statistics_path (`str`, *optional*):
431
+ The directory to save/load NNCF data-aware statistics to/from. Such caching is useful for speeding up
432
+ running many data-aware compression experiments on the same model and dataset.
430
433
"""
431
434
432
435
def __init__ (
@@ -449,6 +452,7 @@ def __init__(
449
452
processor : Optional [str ] = None ,
450
453
lora_correction : bool = None ,
451
454
backup_precision : Optional [str ] = None ,
455
+ statistics_path : Optional [str ] = None ,
452
456
** kwargs ,
453
457
):
454
458
super ().__init__ (
@@ -470,6 +474,7 @@ def __init__(
470
474
self .gptq = gptq
471
475
self .lora_correction = lora_correction
472
476
self .backup_precision = backup_precision
477
+ self .statistics_path = statistics_path
473
478
if kwargs .get ("weight_format" ) is not None :
474
479
logger .warning (
475
480
"The `weight_format` parameter is deprecated and will be removed in optimum-intel v1.24.0. "
@@ -611,6 +616,9 @@ def to_nncf_dict(self) -> Dict[str, Any]:
611
616
awq = True if self .quant_method == OVQuantizationMethod .AWQ else None
612
617
sensitivity_metric = nncf .SensitivityMetric (self .sensitivity_metric ) if self .sensitivity_metric else None
613
618
backup_mode = nncf .BackupMode (self .backup_precision ) if self .backup_precision else None
619
+ advanced_parameters = None
620
+ if self .statistics_path is not None :
621
+ advanced_parameters = nncf .AdvancedCompressionParameters (statistics_path = self .statistics_path )
614
622
result = {
615
623
"mode" : mode ,
616
624
"ratio" : self .ratio ,
@@ -624,6 +632,7 @@ def to_nncf_dict(self) -> Dict[str, Any]:
624
632
"gptq" : self .gptq ,
625
633
"lora_correction" : self .lora_correction ,
626
634
"backup_mode" : backup_mode ,
635
+ "advanced_parameters" : advanced_parameters ,
627
636
}
628
637
return result
629
638
0 commit comments