[EPLB] Add EPLB support to dspark draft models (DeepSeekV4) (#57549)

Signed-off-by: Markov Ilya <markovilya197@gmail.com>
This commit is contained in:
Ilya Markov
2026-10-12 10:03:09 -04:00
committed by GitHub
parent b3ee560ae8
commit a281ad32f0
12 changed files with 665 additions and 76 deletions
+18 -3
View File
@@ -6,6 +6,7 @@ import torch.nn as nn
from vllm.config import ModelConfig, ParallelConfig, VllmConfig, replace
from vllm.logger import init_logger
from vllm.model_executor.model_loader.utils import get_draft_load_config
from vllm.models.deepseek_v4.common.eplb_util import dspark_draft_supports_eplb
from vllm.v1.attention.backends.registry import AttentionBackendEnum
from vllm.v1.worker.gpu.spec_decode.utils import get_pp_safe_draft_load_config
@@ -35,11 +36,24 @@ def _resolve_dspark_attention_backend(
def _get_dspark_parallel_config(
parallel_config: ParallelConfig,
tensor_parallel_size: int,
draft_model_config: ModelConfig,
) -> ParallelConfig:
if parallel_config.enable_eplb:
enable_draft_eplb = parallel_config.enable_eplb and dspark_draft_supports_eplb(
draft_model_config
)
if parallel_config.enable_eplb and not enable_draft_eplb:
logger.warning_once(
"EPLB is disabled for the DSpark draft model. EPLB remains enabled "
"for the target model."
"EPLB is disabled for the DSpark draft model (%s). EPLB remains "
"enabled for the target model.",
draft_model_config.hf_config.model_type,
)
if enable_draft_eplb:
return replace(
parallel_config,
pipeline_parallel_size=1,
tensor_parallel_size=tensor_parallel_size,
enable_elastic_ep=False,
)
return replace(
@@ -81,6 +95,7 @@ def load_dspark_model(target_model: nn.Module, vllm_config: VllmConfig) -> nn.Mo
parallel_config=_get_dspark_parallel_config(
vllm_config.parallel_config,
speculative_config.draft_parallel_config.tensor_parallel_size,
draft_model_config,
),
attention_config=replace(
vllm_config.attention_config,