model: support Qwen3.5 (#18489)
Co-authored-by: 瑀澈 <yuche.lz@alibaba-inc.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user