@@ -1108,26 +1108,47 @@ def test_exporters_cli_full_quantization(
11081108 expected_fake_nodes_per_model ,
11091109 )
11101110
1111- @parameterized .expand (
1112- [
1113- (
1114- "falcon-40b" ,
1115- "bigscience/bloomz-560m" ,
1116- AutoModelForCausalLM ,
1117- OVModelForCausalLM ,
1118- "--task text-generation-with-past --weight-format int4" ,
1119- _DEFAULT_4BIT_WQ_CONFIGS ,
1120- ),
1121- (
1122- "clip" ,
1123- "hf-tiny-model-private/tiny-random-CLIPModel" ,
1124- AutoModelForZeroShotImageClassification ,
1125- OVModelForZeroShotImageClassification ,
1126- "--task zero-shot-image-classification --quant-mode int8" ,
1127- _DEFAULT_INT8_FQ_CONFIGS ,
1128- ),
1129- ]
1130- )
1111+ DEFAULT_CONFIG_TEST_CONFIGURATIONS = [
1112+ (
1113+ "falcon-40b" ,
1114+ "bigscience/bloomz-560m" ,
1115+ AutoModelForCausalLM ,
1116+ OVModelForCausalLM ,
1117+ "--task text-generation-with-past --weight-format int4" ,
1118+ _DEFAULT_4BIT_WQ_CONFIGS ,
1119+ {"model" : {"int8" : 6 , "int4" : 6 }},
1120+ {"model" : 0 },
1121+ ),
1122+ (
1123+ "clip" ,
1124+ "hf-tiny-model-private/tiny-random-CLIPModel" ,
1125+ AutoModelForZeroShotImageClassification ,
1126+ OVModelForZeroShotImageClassification ,
1127+ "--task zero-shot-image-classification --quant-mode int8" ,
1128+ _DEFAULT_INT8_FQ_CONFIGS ,
1129+ {"model" : {"int8" : 65 }},
1130+ {"model" : 65 },
1131+ ),
1132+ (
1133+ "gpt_oss_mxfp4" ,
1134+ "openai/gpt-oss-20b" ,
1135+ AutoModelForCausalLM ,
1136+ OVModelForCausalLM ,
1137+ "--task text-generation-with-past --weight-format int4" ,
1138+ _DEFAULT_4BIT_WQ_CONFIGS ,
1139+ {"model" : {"int8" : 22 , "int4" : 4 }},
1140+ {"model" : 0 },
1141+ ),
1142+ ]
1143+
1144+ # filter models type depending on min max transformers version
1145+ SUPPORTED_DEFAULT_CONFIG_TEST_CONFIGURATIONS = [
1146+ config
1147+ for config in DEFAULT_CONFIG_TEST_CONFIGURATIONS
1148+ if TEST_NAME_TO_MODEL_TYPE .get (config [0 ], config [0 ]) in get_supported_model_for_library ("transformers" )
1149+ ]
1150+
1151+ @parameterized .expand (SUPPORTED_DEFAULT_CONFIG_TEST_CONFIGURATIONS )
11311152 def test_exporters_cli_with_default_config (
11321153 self ,
11331154 model_name ,
@@ -1136,6 +1157,8 @@ def test_exporters_cli_with_default_config(
11361157 ov_model_cls ,
11371158 options ,
11381159 default_configs_collection ,
1160+ expected_num_weight_nodes_per_model ,
1161+ expected_fake_nodes_per_model ,
11391162 ):
11401163 with TemporaryDirectory () as tmpdir :
11411164 pt_model = auto_model_cls .from_pretrained (MODEL_NAMES [model_name ])
@@ -1167,15 +1190,26 @@ def test_exporters_cli_with_default_config(
11671190 )
11681191
11691192 model = ov_model_cls .from_pretrained (tmpdir )
1193+
1194+ check_compression_state_per_model (
1195+ self ,
1196+ model .ov_submodels ,
1197+ expected_num_weight_nodes_per_model ,
1198+ expected_fake_nodes_per_model ,
1199+ )
1200+
11701201 rt_info = model .model .get_rt_info ()
11711202 nncf_info = rt_info ["nncf" ]
11721203 model_quantization_config = nncf_info ["weight_compression" if is_weight_compression else "quantization" ]
11731204
11741205 default_config = {** default_configs_collection [model_id ]}
1175- default_config .pop ("dataset" , None )
1206+ if "quantization_config2" in default_config :
1207+ # For GPT-OSS use the second config as reference
1208+ default_config = default_config ["quantization_config2" ]
1209+ dataset = default_config .pop ("dataset" , None )
1210+ default_config .pop ("weight_only" , None )
11761211 if is_weight_compression :
11771212 bits = default_config .pop ("bits" , None )
1178- self .assertEqual (bits , 4 )
11791213 sym = default_config .pop ("sym" , False )
11801214 default_config ["mode" ] = f"int{ bits } _{ 'sym' if sym else 'asym' } "
11811215 quant_method = default_config .pop ("quant_method" , None )
@@ -1184,7 +1218,8 @@ def test_exporters_cli_with_default_config(
11841218 advanced_parameters = eval (model_quantization_config ["advanced_parameters" ].value )
11851219 model_quantization_config ["statistics_path" ] = Mock ()
11861220 model_quantization_config ["statistics_path" ].value = advanced_parameters ["statistics_path" ]
1187- default_config ["statistics_path" ] = f"{ tmpdir } /statistics"
1221+ if dataset is not None :
1222+ default_config ["statistics_path" ] = f"{ tmpdir } /statistics"
11881223 else :
11891224 dtype = default_config .pop ("dtype" , None )
11901225 self .assertEqual (dtype , "int8" )
0 commit comments