model: support Qwen3.5 (#18489)

Co-authored-by: 瑀澈 <yuche.lz@alibaba-inc.com>
This commit is contained in:
Zheng Li
2026-02-10 00:27:59 +08:00
committed by GitHub
co-authored by 瑀澈
parent 0b4d4f2838
commit 27c447653d
17 changed files with 1923 additions and 9 deletions
@@ -350,6 +350,7 @@ class ForwardBatch(ForwardBatchDeepSeekMHAMixin):
# Speculative decoding
spec_info: Optional[SpecInput] = None
spec_algorithm: SpeculativeAlgorithm = None
mm_input_embeds: Optional[torch.Tensor] = None
capture_hidden_mode: CaptureHiddenMode = None
# For padding
@@ -38,6 +38,8 @@ from sglang.srt.configs import (
Lfm2Config,
NemotronH_Nano_VL_V2_Config,
NemotronHConfig,
Qwen3_5Config,
Qwen3_5MoeConfig,
Qwen3NextConfig,
)
from sglang.srt.configs.device_config import DeviceConfig
@@ -1548,8 +1550,15 @@ class ModelRunner(ModelRunnerKVCacheMixin):
@property
def hybrid_gdn_config(self):
config = self.model_config.hf_config
if isinstance(config, Qwen3NextConfig | JetNemotronConfig | JetVLMConfig):
config = self.model_config.hf_config.get_text_config()
if isinstance(
config,
Qwen3NextConfig
| Qwen3_5Config
| Qwen3_5MoeConfig
| JetNemotronConfig
| JetVLMConfig,
):
return config
return None
@@ -2532,7 +2541,9 @@ class ModelRunner(ModelRunnerKVCacheMixin):
def model_is_mrope(self) -> bool:
"""Detect if the model has "mrope" rope_scaling type.
mrope requires keep "rope_deltas" between prompt and decoding phases."""
rope_scaling = getattr(self.model_config.hf_text_config, "rope_scaling", {})
rope_scaling = getattr(
self.model_config.hf_text_config, "rope_parameters", None
) or getattr(self.model_config.hf_text_config, "rope_scaling", {})
if rope_scaling is None:
return False
is_mrope_enabled = "mrope_section" in rope_scaling