Views
No views yet
deepseek-ai/DeepSeek-OCR-2
for vLLM inference. Produced with Intel AutoRound
using data-free RTN.sam_model, qwen2_model), embed_tokens, lm_head, projector, all layernorms.deepseek_ocr2.py builds those modules
with plain torch.nn.Linear (not the quant-aware parallel linears), so they can't
carry GPTQ tensor suffixes. Only the deepseek_v2 decoder is wrapped in quant-aware
linears in vLLM's current implementation.| Size on disk | 4.49 GB |
| Quantized linears | 2148 |
| group_size | 32 (uniform) |
| Tensor parallel | works at TP=1 and TP=2 |
| dtype | fp16 + int32 (no bf16) |
1vllm serve <path-to-this-checkpoint> \
2 --served-model-name deepseek-ai/DeepSeek-OCR-2 \
3 --dtype half \
4 --quantization gptq \
5 --gpu-memory-utilization 0.7 \
6 --max-num-seqs 16 \
7 --logits_processors vllm.model_executor.models.deepseek_ocr:NGramPerReqLogitsProcessor \
8 --no-enable-prefix-caching \
9 --mm-processor-cache-gb 0--tensor-parallel-size 2 if you have two GPUs; the g32 layout aligns cleanly
for TP=2 on every quantized layer.--logits_processors ...NGramPerReqLogitsProcessor is the OCR-specific decoding
helper that ships in vLLM's deepseek_ocr module.--no-enable-prefix-caching and --mm-processor-cache-gb 0 are appropriate for
OCR (every image is unique; prefix and mm caches just waste memory).trust_remote_code needed (and shouldn't be passed). vLLM uses its in-tree
DeepseekOCR2ForCausalLM class. The original HF auto_map was removed from
config.json to prevent transformers from demanding it.model_type is deepseek_vl_v2 (matching the original HF config); this is
what vLLM's registry keys on.g_idx in the checkpoint: desc_act=False means vLLM doesn't create the
g_idx parameter, and shipping one breaks loading.1from auto_round import AutoRound
2# scheme="W8A16", group_size=32, sym=True, iters=0, disable_opt_rtn=True
3# skip via layer_config: model.layers.{i}.self_attn.{q,k,v,o}_proj (bits=16)
4ar.save_quantized(out_dir, format="auto_gptq")auto_map stripped from config, model_type reset to
deepseek_vl_v2, modules_to_not_convert populated for attention, all bf16/f32
tensors cast to fp16, all g_idx tensors dropped, single safetensors file.