F
F-loyd/DeepSeek-VL2-Tiny
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

DeepSeek-VL2-Tiny

Model Information

  • Model ID: deepseek-ai/deepseek-vl2-tiny
  • Architecture: DeepSeek-VL2 (MoE vision-language model)
  • Library: transformers
  • Task: image-text-to-text
  • License: other (DeepSeek License)

DeepSeek-VL2-Tiny is a lightweight vision-language model from DeepSeek-AI. It combines a SigLIP vision encoder with a DeepSeek-V2 MoE language backbone. The tiny variant has 12 layers, 1280 hidden size, 10 attention heads, and 64 routed experts (with 6 active per token), making it suitable for efficient multimodal inference on single-NPU Ascend devices.

Ascend NPU Adaptation

This repository contains the Ascend NPU adaptation results for deepseek-ai/deepseek-vl2-tiny on vLLM-Ascend.

Adaptation Patch

The full adaptation patch is provided as deepseek-vl2-tiny-adapt.patch. It includes:

  1. Documentation: Added DeepSeek-VL2-Tiny.md deployment guide for vLLM-Ascend
  2. Model Index: Registered the model in the supported models index
  3. E2E Test Config: Added DeepseekVL2Tiny.yaml end-to-end test configuration
  4. Bug Fix: Fixed Triton RoPE kernel crash when rope_dim=0 (caused by qk_rope_head_dim=0 in the tiny config)

Supported Features

FeatureStatus
ACLGraphVerified
Text inferenceVerified
Image+Text inferenceVerified
Expert Parallel (EP)MoE supported, EP not explicitly verified on tiny variant
Multi-nodeN/A (single-NPU sufficient)

Environment

  • Hardware: Atlas A2 Series (single NPU sufficient)
  • Framework: vLLM-Ascend
  • Data Type: bfloat16

Deployment

export VLLM_USE_MODELSCOPE=True
export PYTORCH_NPU_ALLOC_CONF=max_split_size_mb:256

vllm serve deepseek-ai/deepseek-vl2-tiny \
  --dtype bfloat16 \
  --trust-remote-code \
  --max-model-len 4096 \
  --gpu-memory-utilization 0.7 \
  --port 8000

Known Issues & Fixes

  • Triton RoPE crash with rope_dim=0: The deepseek-vl2-tiny config sets qk_rope_head_dim=0, which caused the vllm-ascend Triton RoPE kernel to crash because tl.arange(0, 0) is invalid. Fixed by adding an early-return guard (if rope_dim <= 0: return ...) in vllm_ascend/ops/triton/rope.py.

Offline Inference

from vllm import LLM, SamplingParams

MODEL_PATH = "deepseek-ai/deepseek-vl2-tiny"

llm = LLM(
    model=MODEL_PATH,
    trust_remote_code=True,
    max_model_len=4096,
    limit_mm_per_prompt={"image": 1},
)

sampling_params = SamplingParams(max_tokens=32, temperature=0)

messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": [
        {"type": "image_url", "image_url": {"url": "https://modelscope.oss-cn-beijing.aliyuncs.com/resource/qwen.png"}},
        {"type": "text", "text": "What is in the image?"}
    ]}
]

outputs = llm.chat(messages, sampling_params=sampling_params)
print(outputs[0].outputs[0].text)

Citation

@article{deepseekvl2,
  title={DeepSeek-VL2: Mixture-of-Experts Vision-Language Models for Advanced Multimodal Understanding},
  author={DeepSeek-AI},
  journal={arXiv preprint arXiv:2412.10302},
  year={2024}
}