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.
This repository contains the Ascend NPU adaptation results for deepseek-ai/deepseek-vl2-tiny on vLLM-Ascend.
The full adaptation patch is provided as deepseek-vl2-tiny-adapt.patch. It includes:
DeepSeek-VL2-Tiny.md deployment guide for vLLM-AscendDeepseekVL2Tiny.yaml end-to-end test configurationrope_dim=0 (caused by qk_rope_head_dim=0 in the tiny config)| Feature | Status |
|---|---|
| ACLGraph | Verified |
| Text inference | Verified |
| Image+Text inference | Verified |
| Expert Parallel (EP) | MoE supported, EP not explicitly verified on tiny variant |
| Multi-node | N/A (single-NPU sufficient) |
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 8000rope_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.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)@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}
}