vllm.models.deepseek_v4.common.vision ¶
DeepSeek-V4 vision tower (ViT + aligner) with TP-sharded linears.
Ported from the official reference implementation (deepseek-ai/DeepSeek-V4-Flash-Vision-Exp). Weight names match the HF checkpoint so no renaming is needed at load time. Attention and MLP weights are tensor-parallel sharded (replicated when the vision head count is not divisible by TP size, or under --mm-encoder-tp-mode data); the patch embed and norms are replicated, so the residual stream is full-width on every rank.
Classes:
-
DeepseekV4Aligner–Spatial merge (downsample_ratio x downsample_ratio) + MLP projector.
-
DeepseekV4ViT–DeepSeek-V4 ViT: full bidirectional attention per image, 2D RoPE.
DeepseekV4Aligner ¶
Bases: Module
Spatial merge (downsample_ratio x downsample_ratio) + MLP projector.
Source code in vllm/models/deepseek_v4/common/vision.py
DeepseekV4ViT ¶
Bases: Module
DeepSeek-V4 ViT: full bidirectional attention per image, 2D RoPE.