Support OCP MXFP4 quantization on AMD GPUs (#8255)
Co-authored-by: wunhuang <wunhuang@amd.com> Co-authored-by: Hubert Lu <Hubert.Lu@amd.com>
This commit is contained in:
@@ -843,6 +843,16 @@ def maybe_remap_kv_scale_name(name: str, params_dict: dict) -> Optional[str]:
|
||||
return None
|
||||
return remapped_name
|
||||
|
||||
quark_scale_names = {
|
||||
".q_proj.output_scale": ".attn.q_scale",
|
||||
".k_proj.output_scale": ".attn.k_scale",
|
||||
".v_proj.output_scale": ".attn.v_scale",
|
||||
"self_attn.prob_output_scale": ".attn.prob_scale",
|
||||
}
|
||||
for quark_scale_name, sglang_scale_name in quark_scale_names.items():
|
||||
if name.endswith(quark_scale_name):
|
||||
return name.replace(quark_scale_name, sglang_scale_name)
|
||||
|
||||
# If there were no matches, return the untouched param name
|
||||
return name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user