vllm.model_executor.models.deepseek_v2
¶
Inference-only DeepseekV2/DeepseekV3 model.
Classes:
-
DeepseekAttention–Normal MHA implementation used by Deepseek v1.
-
DeepseekV2MLAAttention–Main reference: DeepseekV2 paper, and FlashInfer Implementation
-
DeepseekV2MixtureOfExperts– -
DeepseekV32IndexerCache–
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(list[DeepseekV2MoE]) –List of MoE MLP layers in the model.
moe_mlp_layers
instance-attribute
¶
List of MoE MLP layers in the model.
DeepseekV32IndexerCache
¶
Bases: Module, AttentionLayerBase
Attributes:
-
uses_shuffled_layout(bool) –Whether this cache's reader expects the shuffled value layout.
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.