[Mypy Fix] Mypy fix for "vllm/model_executor/models/[cC][dD]" (#52003)

This commit is contained in:
Wentao Ye
2026-08-13 11:33:55 +08:00
committed by GitHub
parent 15227b934a
commit 9a276d6375
24 changed files with 153 additions and 66 deletions
+6 -4
View File
@@ -68,6 +68,7 @@ class DeepSeekMultiTokenPredictorLayer(nn.Module):
def __init__(self, vllm_config: VllmConfig, prefix: str) -> None:
super().__init__()
assert vllm_config.speculative_config is not None
config = vllm_config.speculative_config.draft_model_config.hf_config
self.config = config
quant_config = vllm_config.quant_config
@@ -423,7 +424,7 @@ class DeepSeekMTP(nn.Module, DeepseekV2MixtureOfExperts):
# with expert_id.
is_expert_weight = False
for mapping in expert_params_mapping:
param_name, weight_name, expert_id, shard_id = mapping
param_name, weight_name, expert_id, expert_shard_id = mapping
if weight_name not in chunk_name:
continue
@@ -446,7 +447,7 @@ class DeepSeekMTP(nn.Module, DeepseekV2MixtureOfExperts):
param,
weight_to_load,
name_mapped,
shard_id=shard_id,
shard_id=expert_shard_id,
expert_id=expert_id,
return_success=True,
)
@@ -467,9 +468,10 @@ class DeepSeekMTP(nn.Module, DeepseekV2MixtureOfExperts):
if name.endswith(".bias") and name not in params_dict:
continue
name = maybe_remap_kv_scale_name(name, params_dict)
if name is None:
remapped_name = maybe_remap_kv_scale_name(name, params_dict)
if remapped_name is None:
continue
name = remapped_name
# According to DeepSeek-V3 Technical Report, MTP modules
# shares embedding layer. We only load the first weights.