Skip to content

vllm.model_executor.models.deepseek_mtp

Classes:

DeepSeekMTP

Bases: Module, DeepseekV2MixtureOfExperts, SupportsPP

_rewrite_spec_layer_name(spec_layer, name)

Rewrite the weight name to match the format of the original model. Add .mtp_block for modules in transformer layer block for spec layer and rename shared layer weights to be top level.

DeepSeekMultiTokenPredictor

Bases: Module

Methods:

  • compact_topk_indices –

    Gather the top-k index rows at slot_ids to the front of the buffer.

  • set_skip_topk –

    Toggle skip_topk on all MTP layers with sparse attention.

compact_topk_indices(slot_ids)

Gather the top-k index rows at slot_ids to the front of the buffer.

set_skip_topk(skip)

Toggle skip_topk on all MTP layers with sparse attention.

Called by the proposer to implement index_share_for_mtp_iteration: step 0 sets skip=False (compute own indices), steps 1+ set skip=True (reuse step 0's indices).