Fix MLA scaling when YARN scaling is disabled (#26203)

Co-authored-by: BBuf <xiaoyu.zhang@radixark.net>
This commit is contained in:
Xiaoyu Zhang
2026-06-11 22:17:55 +08:00
committed by GitHub
co-authored by BBuf
parent d571e076fa
commit 1a6b5561db
2 changed files with 57 additions and 0 deletions
@@ -1679,6 +1679,11 @@ def compute_mla_mscale_scaling(rope_scaling: dict, base_scaling: float) -> float
Used by DeepSeek, BailingMoe, SarvamMLA and similar MLA models.
Warns if 'factor' is missing from rope_scaling (common in v5 configs).
"""
if not rope_scaling.get("apply_yarn_scaling", True) or not rope_scaling.get(
"apply_scale", True
):
return base_scaling
mscale_all_dim = rope_scaling.get("mscale_all_dim", False)
if "factor" not in rope_scaling:
logger.warning(