From bf7fb6b9259b70be24cc62fcebf2815e064dadf1 Mon Sep 17 00:00:00 2001 From: David Wang <21328423+dcw02@users.noreply.github.com> Date: Sun, 7 Jun 2026 23:52:07 -0400 Subject: [PATCH] fix dflash rope config parsing for updated transformers (#27477) --- python/sglang/srt/models/dflash.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/sglang/srt/models/dflash.py b/python/sglang/srt/models/dflash.py index 7e79f0c34..58537eba7 100644 --- a/python/sglang/srt/models/dflash.py +++ b/python/sglang/srt/models/dflash.py @@ -31,6 +31,7 @@ from sglang.srt.speculative.dflash_utils import ( parse_dflash_draft_config, ) from sglang.srt.utils import is_npu +from sglang.srt.utils.hf_transformers_utils import get_rope_config _is_npu = is_npu() if _is_npu: @@ -94,8 +95,7 @@ class DFlashAttention(nn.Module): self.q_norm = RMSNorm(head_dim, eps=rms_norm_eps) self.k_norm = RMSNorm(head_dim, eps=rms_norm_eps) - rope_theta = float(getattr(config, "rope_theta", 1000000)) - rope_scaling = getattr(config, "rope_scaling", None) + rope_theta, rope_scaling = get_rope_config(config) rope_is_neox_style = bool( getattr( config, "rope_is_neox_style", getattr(config, "is_neox_style", True)