[Rebase] Rebase to vllm v0.24.0 (#4709)

This commit is contained in:
Zhou Taichang authored and GitHub committed 2026-06-30 19:41:06 +08:00
1 parent 9a105bf90d
commit a560ed184d
60 files changed
+789 -203

No files matched your search

@@ -32,7 +32,10 @@ from vllm.distributed import get_pp_group, get_tensor_model_parallel_world_size
from vllm.logger import init_logger
from vllm.model_executor.layers.activation import SiluAndMul
from vllm.model_executor.layers.attention import Attention
from vllm.model_executor.layers.fused_moe import FusedMoE
from vllm.model_executor.layers.fused_moe import (
FusedMoE,
fused_moe_make_expert_params_mapping,
)
from vllm.model_executor.layers.layernorm import RMSNorm
from vllm.model_executor.layers.linear import (
MergedColumnParallelLinear,
@@ -341,7 +344,7 @@ class BailingMoeV2SparseMoeBlock(nn.Module):
prefix=f"{prefix}.experts",
)
self.experts.expert_mapping = FusedMoE.make_expert_params_mapping(
self.experts.expert_mapping = fused_moe_make_expert_params_mapping(
self.experts,
ckpt_gate_proj_name="gate_proj",
ckpt_down_proj_name="down_proj",
@@ -140,9 +140,17 @@ class MossTTSDelayTalkerForGeneration(nn.Module):
self.pad_token_id: int = getattr(self.config, "pad_token_id", 151643)
self.im_end_token_id: int = getattr(self.config, "im_end_token_id", 151645)
# Qwen3 backbone — weights live under ``language_model.*``
# Qwen3 backbone — weights live under ``language_model.*``. vLLM's
# Qwen3Model reads num_hidden_layers/hidden_size/etc. from
# vllm_config.model_config.hf_config, but MOSS nests the LLM config under
# ``language_config`` (a Qwen3Config). Rebind the backbone's hf_config to
# it — same pattern as the Qwen3-Omni talker — so the inner model sees a
# real Qwen3Config instead of MossTTSDelayConfig (which lacks
# num_hidden_layers).
lm_vllm_config = vllm_config.with_hf_config(lm_cfg, architectures=["Qwen3ForCausalLM"])
lm_vllm_config.model_config.hf_text_config = lm_vllm_config.model_config.hf_config
self.model = Qwen3Model(
vllm_config=vllm_config,
vllm_config=lm_vllm_config,
prefix=_maybe_prefix(prefix, "model"),
)