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:
kk
2025-08-05 09:14:52 +08:00
committed by GitHub
parent 7cb20754fa
commit d4bf5a8524
12 changed files with 1159 additions and 1 deletions

View File

@@ -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