@@ -347,7 +347,7 @@ class OVWeightQuantizationConfig(OVQuantizationConfigBase):
347347 Indicates whether to apply a scale estimation algorithm that minimizes the L2 error between the original and
348348 compressed layers. Providing a dataset is required to run scale estimation.
349349 weight_format (`str`, defaults to 'int'):
350- Data format weights are compressed to. Possible values: ['int4', 'int8', 'mxfp4'].
350+ Data format weights are compressed to. Possible values: ['int4', 'int8', 'mxfp4', 'nf4' ].
351351 qptq (`bool`, *optional*):
352352 Whether to apply GPTQ algorithm. GPTQ optimizes compressed weights in a layer-wise fashion to minimize the
353353 difference between activations of a compressed and original layer. Dataset is required to run GPTQ.
@@ -455,20 +455,22 @@ def post_init(self):
455455
456456 if self .weight_format is None :
457457 self .weight_format = "int4" if self .bits == 4 else "int8"
458- if self .weight_format not in ["int4" , "int8" , "mxfp4" ]:
458+ if self .weight_format not in ["int4" , "int8" , "mxfp4" , "nf4" ]:
459459 raise ValueError (
460- f"Weight format must be one of the following: ['int4', 'int8', 'mxfp4'], but found: { self .weight_format } ."
460+ f"Weight format must be one of the following: ['int4', 'int8', 'mxfp4', 'nf4' ], but found: { self .weight_format } ."
461461 )
462- if self .weight_format == "mxfp4" :
462+ if self .weight_format in [ "mxfp4" , "nf4" ] :
463463 if self .bits != 4 :
464464 raise ValueError (
465- f"When applying weight compression with 'mxfp4 ' weight format the `bits` parameters must be set to 4, but found { self .bits } "
465+ f"When applying weight compression with '{ self . weight_format } ' weight format, the `bits` parameter must be set to 4, but found { self .bits } "
466466 )
467467 if self .quant_method == OVQuantizationMethod .AWQ :
468- raise ValueError ("The AWQ algorithm is not supported for 'mxfp4 ' weight format" )
468+ raise ValueError (f "The AWQ algorithm is not supported for '{ self . weight_format } ' weight format" )
469469 if self .scale_estimation :
470- raise ValueError ("The Scale Estimation algorithm is not supported for 'mxfp4' weight format" )
471- if self .gptq :
470+ raise ValueError (
471+ f"The Scale Estimation algorithm is not supported for '{ self .weight_format } ' weight format"
472+ )
473+ if self .weight_format == "mxfp4" and self .gptq :
472474 raise ValueError ("The GPTQ algorithm is not supported for 'mxfp4' weight format" )
473475
474476
0 commit comments