[EPLB] Add EPLB support to dspark draft models (DeepSeekV4) (#57549)
Signed-off-by: Markov Ilya <markovilya197@gmail.com>
This commit is contained in:
@@ -15,6 +15,16 @@ from vllm.v1.worker.gpu.spec_decode.dspark.utils import _get_dspark_parallel_con
|
||||
from vllm.v1.worker.gpu.spec_decode.speculator import DraftModelSpeculator
|
||||
|
||||
|
||||
@dataclass
|
||||
class _FakeHFConfig:
|
||||
model_type: str
|
||||
|
||||
|
||||
@dataclass
|
||||
class _FakeModelConfig:
|
||||
hf_config: _FakeHFConfig
|
||||
|
||||
|
||||
@dataclass
|
||||
class _FakeEPLBConfig:
|
||||
num_redundant_experts: int = 0
|
||||
@@ -37,12 +47,28 @@ class _FakeParallelConfig:
|
||||
raise ValueError("elastic EP requires EPLB")
|
||||
|
||||
|
||||
def test_dspark_parallel_config_disables_eplb_atomically():
|
||||
@pytest.mark.parametrize(
|
||||
("model_type", "enable_eplb", "num_redundant_experts", "shares_eplb_config"),
|
||||
[
|
||||
("deepseek_v4", True, 32, True),
|
||||
("deepseek_v41", False, 0, False),
|
||||
],
|
||||
)
|
||||
def test_dspark_parallel_config_eplb_by_model_type(
|
||||
model_type: str,
|
||||
enable_eplb: bool,
|
||||
num_redundant_experts: int,
|
||||
shares_eplb_config: bool,
|
||||
):
|
||||
target_config = _FakeParallelConfig()
|
||||
draft_model_config = _FakeModelConfig(
|
||||
hf_config=_FakeHFConfig(model_type=model_type)
|
||||
)
|
||||
|
||||
draft_config = _get_dspark_parallel_config(
|
||||
target_config,
|
||||
tensor_parallel_size=4,
|
||||
draft_model_config=draft_model_config,
|
||||
)
|
||||
|
||||
assert target_config.pipeline_parallel_size == 2
|
||||
@@ -54,10 +80,13 @@ def test_dspark_parallel_config_disables_eplb_atomically():
|
||||
assert draft_config is not target_config
|
||||
assert draft_config.pipeline_parallel_size == 1
|
||||
assert draft_config.tensor_parallel_size == 4
|
||||
assert not draft_config.enable_eplb
|
||||
assert draft_config.eplb_config.num_redundant_experts == 0
|
||||
assert draft_config.enable_eplb is enable_eplb
|
||||
assert draft_config.eplb_config.num_redundant_experts == num_redundant_experts
|
||||
assert not draft_config.enable_elastic_ep
|
||||
assert draft_config.eplb_config is not target_config.eplb_config
|
||||
if shares_eplb_config:
|
||||
assert draft_config.eplb_config is target_config.eplb_config
|
||||
else:
|
||||
assert draft_config.eplb_config is not target_config.eplb_config
|
||||
|
||||
|
||||
@pytest.mark.parametrize("pcp_size", [1, 4])
|
||||
|
||||
Reference in New Issue
Block a user