@@ -154,17 +154,8 @@ def test_act_config_MXFP4_saving(self):
154154 quantized_model_path = self .save_dir
155155 autoround .quantize_and_save (output_dir = quantized_model_path , format = "auto_round" )
156156 model = AutoModelForCausalLM .from_pretrained (quantized_model_path , device_map = "cpu" )
157- lmhead_config = model .config .quantization_config .extra_config ["lm_head" ]
158- assert "act_data_type" in lmhead_config .keys () and lmhead_config ["act_data_type" ] == "mx_fp_rceil"
159- assert "act_bits" in lmhead_config .keys () and lmhead_config ["act_bits" ] == 8
160- assert "act_group_size" in lmhead_config .keys () and lmhead_config ["act_group_size" ] == 32
161- assert "act_sym" in lmhead_config .keys () and lmhead_config ["act_sym" ]
162- assert "data_type" in lmhead_config .keys () and lmhead_config ["data_type" ] == "mx_fp"
163- assert "bits" in lmhead_config .keys () and lmhead_config ["bits" ] == 8
164- assert "group_size" in lmhead_config .keys () and lmhead_config ["group_size" ] == 32
165- assert "sym" in lmhead_config .keys () and lmhead_config ["sym" ]
166- assert "super_bits" in lmhead_config .keys () and lmhead_config ["super_bits" ] is None
167- assert "super_group_size" in lmhead_config .keys () and lmhead_config ["super_group_size" ] is None
157+ assert "lm_head" not in model .config .quantization_config .extra_config
158+
168159 # check inblock layer config values
169160 kproj_config = model .config .quantization_config .extra_config ["model.decoder.layers.1.self_attn.k_proj" ]
170161 assert "act_data_type" in kproj_config .keys () and kproj_config ["act_data_type" ] == "mx_fp_rceil"
@@ -204,7 +195,7 @@ def test_act_config_NVFP4_saving(self):
204195
205196 def test_WOQ_config_INT_saving (self ):
206197 scheme = "W4A16"
207- layer_config = {"k_proj" : {"bits" : 8 }} # "lm_head": {"bits": 4},
198+ layer_config = {"k_proj" : {"bits" : 8 }}
208199 autoround = AutoRound (
209200 self .model_name ,
210201 scheme = scheme ,
@@ -218,18 +209,6 @@ def test_WOQ_config_INT_saving(self):
218209 autoround .quantize_and_save (output_dir = quantized_model_path , format = "auto_round" )
219210 model = AutoModelForCausalLM .from_pretrained (quantized_model_path , device_map = "cpu" )
220211 extra_config = model .config .quantization_config .extra_config
221- # lmhead_config = extra_config["lm_head"]
222- # assert "act_data_type" in lmhead_config.keys() and lmhead_config["act_data_type"] == "float"
223- # assert "act_bits" in lmhead_config.keys() and lmhead_config["act_bits"] == 16
224- # assert "act_group_size" in lmhead_config.keys() and lmhead_config["act_group_size"] == 128
225- # assert "act_sym" in lmhead_config.keys() and not lmhead_config["act_sym"]
226- # assert "data_type" in lmhead_config.keys() and lmhead_config["data_type"] == "int"
227- # assert "bits" in lmhead_config.keys() and lmhead_config["bits"] == 4
228- # assert "group_size" in lmhead_config.keys() and lmhead_config["group_size"] == 128
229- # assert "sym" in lmhead_config.keys() and not lmhead_config["sym"]
230- # assert "act_dynamic" in lmhead_config.keys() and lmhead_config["act_dynamic"]
231- # assert "super_bits" in lmhead_config.keys() and lmhead_config["super_bits"] is None
232- # assert "super_group_size" in lmhead_config.keys() and lmhead_config["super_group_size"] is None
233212
234213 # check inblock layer config values
235214 kproj_config = extra_config ["model.decoder.layers.1.self_attn.k_proj" ]
@@ -270,18 +249,8 @@ def test_act_config_FP8_saving(self):
270249 from transformers import AutoConfig
271250
272251 extra_config = AutoConfig .from_pretrained (quantized_model_path ).quantization_config ["extra_config" ]
273- lmhead_config = extra_config ["lm_head" ]
274- assert "act_data_type" in lmhead_config .keys () and lmhead_config ["act_data_type" ] == "fp"
275- assert "act_bits" in lmhead_config .keys () and lmhead_config ["act_bits" ] == 8
276- assert "act_group_size" in lmhead_config .keys () and lmhead_config ["act_group_size" ] == 0
277- assert "act_sym" in lmhead_config .keys () and lmhead_config ["act_sym" ]
278- assert "data_type" in lmhead_config .keys () and lmhead_config ["data_type" ] == "fp"
279- assert "bits" in lmhead_config .keys () and lmhead_config ["bits" ] == 8
280- assert "group_size" in lmhead_config .keys () and lmhead_config ["group_size" ] == - 1
281- assert "sym" in lmhead_config .keys () and lmhead_config ["sym" ]
282- assert "act_dynamic" in lmhead_config .keys () and not lmhead_config ["act_dynamic" ]
283- assert "super_bits" in lmhead_config .keys () and lmhead_config ["super_bits" ] is None
284- assert "super_group_size" in lmhead_config .keys () and lmhead_config ["super_group_size" ] is None
252+ assert "lm_head" not in extra_config
253+
285254 # check inblock layer config values
286255 kproj_config = extra_config ["model.decoder.layers.0.self_attn.k_proj" ]
287256 assert "act_data_type" in kproj_config .keys () and kproj_config ["act_data_type" ] == "fp"
0 commit comments