Skip to content

vllm.model_executor.models.deepseek_v2

Inference-only DeepseekV2/DeepseekV3 model.

Classes:

DeepseekAttention

Bases: Module

Normal MHA implementation used by Deepseek v1.

DeepseekV2MLAAttention

Bases: Module

Main reference: DeepseekV2 paper, and FlashInfer Implementation (https://arxiv.org/abs/2405.04434 and https://github.com/flashinfer-ai/flashinfer/pull/551).

For more info see MLACommonImpl in:
vllm/v1/attention/backends/mla/utils.py

DeepseekV2MixtureOfExperts

Bases: MixtureOfExperts

Attributes:

moe_mlp_layers instance-attribute

List of MoE MLP layers in the model.

DeepseekV32IndexerCache

Bases: Module, AttentionLayerBase

Attributes:

uses_shuffled_layout property

Whether this cache's reader expects the shuffled value layout.

_min_latency_fused_qkv_a_proj_impl(input_, weight)

Dynamically run min-latency gemm if num_tokens <= 16. This must be wrapped in a custom op because our torch.compile integration does not support runtime dispatching on num_tokens.