Signed-off-by: Peiyuan Zhou <peiyuanzhou1994@gmail.com> Signed-off-by: zhou <zhou@zhoudeMacBook-Pro.local> Signed-off-by: Stefan Koncarevic <stefan.koncarevic@amd.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Giancarlo Delfin <32987265+TheEpicDolphin@users.noreply.github.com> Co-authored-by: Thien Tran <gau.nernst@yahoo.com.sg> Co-authored-by: OpenAI Codex <codex@openai.com> Co-authored-by: zhou <zhou@zhoudeMacBook-Pro.local> Co-authored-by: stefankoncarevic <Stefan.Koncarevic@amd.com>
37 lines
1.5 KiB
Python
37 lines
1.5 KiB
Python
# SPDX-License-Identifier: Apache-2.0
|
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
"""DeepSeek V3.2 (``deepseek_v32``) model — hardware-isolated entry point.
|
|
|
|
DeepSeek V3.2 introduced the DeepSeek Sparse Attention (DSA) architecture:
|
|
MLA + a "lightning indexer" that selects the top-k tokens for a sparse MLA
|
|
attend. The same model code serves any DSA checkpoint, including GLM-5.2
|
|
(``glm_moe_dsa``), which reuses this architecture.
|
|
|
|
The optimized kernels under ``nvidia/`` target the Blackwell (SM100) family.
|
|
Every other platform — ROCm, XPU, pre-SM100 CUDA (e.g. H100), CPU — falls back
|
|
to the generic ``deepseek_v2`` implementation, which already handles the DSA
|
|
(index_topk) architecture and is ``torch.compile``-friendly there. This matches
|
|
main's behavior on those platforms (no hard failure).
|
|
"""
|
|
|
|
from vllm.platforms import current_platform
|
|
|
|
if current_platform.is_cuda() and current_platform.is_device_capability_family(100):
|
|
from .nvidia.model import DeepseekV32ForCausalLM
|
|
from .nvidia.mtp import DeepseekV32MTP
|
|
|
|
# GLM-5.2 (glm_moe_dsa) reuses the same optimized DSA module on SM100.
|
|
GlmMoeDsaForCausalLM = DeepseekV32ForCausalLM
|
|
else:
|
|
from vllm.model_executor.models.deepseek_mtp import DeepSeekMTP as DeepseekV32MTP
|
|
from vllm.model_executor.models.deepseek_v2 import (
|
|
DeepseekV3ForCausalLM as DeepseekV32ForCausalLM,
|
|
)
|
|
from vllm.model_executor.models.deepseek_v2 import GlmMoeDsaForCausalLM
|
|
|
|
__all__ = [
|
|
"DeepseekV32ForCausalLM",
|
|
"DeepseekV32MTP",
|
|
"GlmMoeDsaForCausalLM",
|
|
]
|