Skip to content

vllm.models.deepseek_v4.common.spec_decode

Functions:

needs_mtp_hidden_buffer(spec_config)

Whether the drafter reads the target's pre-hc_head residual buffer, which stands in for its final hidden states (aux-state drafters like DSpark don't).

Source code in vllm/models/deepseek_v4/common/spec_decode.py
def needs_mtp_hidden_buffer(spec_config: SpeculativeConfig | None) -> bool:
    """Whether the drafter reads the target's pre-hc_head residual buffer, which
    stands in for its final hidden states (aux-state drafters like DSpark don't).
    """
    return (
        spec_config is not None
        and spec_config.uses_target_hidden_states
        and not spec_config.uses_aux_hidden_states
    )