[Bugfix][Spec Decode][MoE] Avoid uninitialized EPLB state in DeepSeek V4.1 DSpark drafter (#56387)
Signed-off-by: zack <51604064+luoyuctl@users.noreply.github.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
import torch.nn as nn
|
||||
|
||||
from vllm.config import ModelConfig, VllmConfig, replace
|
||||
from vllm.config import ModelConfig, ParallelConfig, VllmConfig, replace
|
||||
from vllm.logger import init_logger
|
||||
from vllm.v1.attention.backends.registry import AttentionBackendEnum
|
||||
from vllm.v1.worker.gpu.spec_decode.utils import get_pp_safe_draft_load_config
|
||||
@@ -31,6 +31,29 @@ def _resolve_dspark_attention_backend(
|
||||
return None
|
||||
|
||||
|
||||
def _get_dspark_parallel_config(
|
||||
parallel_config: ParallelConfig,
|
||||
tensor_parallel_size: int,
|
||||
) -> ParallelConfig:
|
||||
if parallel_config.enable_eplb:
|
||||
logger.warning_once(
|
||||
"EPLB is disabled for the DSpark draft model. EPLB remains enabled "
|
||||
"for the target model."
|
||||
)
|
||||
|
||||
return replace(
|
||||
parallel_config,
|
||||
pipeline_parallel_size=1,
|
||||
tensor_parallel_size=tensor_parallel_size,
|
||||
enable_eplb=False,
|
||||
eplb_config=replace(
|
||||
parallel_config.eplb_config,
|
||||
num_redundant_experts=0,
|
||||
),
|
||||
enable_elastic_ep=False,
|
||||
)
|
||||
|
||||
|
||||
def load_dspark_model(target_model: nn.Module, vllm_config: VllmConfig) -> nn.Module:
|
||||
speculative_config = vllm_config.speculative_config
|
||||
assert speculative_config is not None
|
||||
@@ -54,12 +77,9 @@ def load_dspark_model(target_model: nn.Module, vllm_config: VllmConfig) -> nn.Mo
|
||||
|
||||
draft_vllm_config = replace(
|
||||
vllm_config,
|
||||
parallel_config=replace(
|
||||
parallel_config=_get_dspark_parallel_config(
|
||||
vllm_config.parallel_config,
|
||||
pipeline_parallel_size=1,
|
||||
tensor_parallel_size=(
|
||||
speculative_config.draft_parallel_config.tensor_parallel_size
|
||||
),
|
||||
speculative_config.draft_parallel_config.tensor_parallel_size,
|
||||
),
|
||||
attention_config=replace(
|
||||
vllm_config.attention_config,
|
||||
|
||||
Reference in New Issue
Block a user