# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Shared EPLB MoE registration helpers for DeepSeek V4 family models.""" import torch.nn as nn from vllm.config import ModelConfig def dspark_draft_supports_eplb(draft_model_config: ModelConfig) -> bool: """Return whether a DSpark draft can share EPLB state with the target. Only DeepSeek-V4 DSpark drafts reuse the target expert layout. V4.1 drafts use a smaller routed-expert count and cannot share EPLB state. """ return getattr(draft_model_config.hf_config, "model_type", None) == "deepseek_v4"