Views
No views yet
deepseek-ai/DeepSeek-R1-Distill-Qwen-32B with INT4 weight compression.deepseek-ai/DeepSeek-R1-Distill-Qwen-32Bdeepseek-ai/DeepSeek-R1-Distill-Qwen-32B model card states that both the code repository and model weights are licensed under the MIT License. It also states that the DeepSeek-R1 series supports commercial use and allows modifications and derivative works, including distillation.LICENSE file for attribution and compliance.1optimum-cli export openvino \
2 --model deepseek-ai/DeepSeek-R1-Distill-Qwen-32B \
3 --weight-format int4 \
4 --group-size 128 \
5 --ratio 1.0 \
6 ov_DeepSeek-R1-Distill-Qwen-32B_int4
7Quantization
8Weight format: INT4
9Group size: 128
10Ratio: 1.0
11Export tool: Optimum Intel
12Compression backend: NNCF through Optimum Intel
13Runtime format: OpenVINO IR
14
15INT4 compression is intended to reduce model size and memory usage compared with higher precision weights. As with any converted and quantized model, output quality and numerical behavior may differ from the original model and should be validated for your use case.
16Installation
17pip install -r examples/requirements.txt
186. Test with Optimum Intel first
19
20Create or use the included script:
21
22python examples/test_deepseek32b_ov_optimum.py \
23 --model-dir . \
24 --device CPU \
25 --max-new-tokens 128 \
26 --prompt "Explain OpenVINO in one short paragraph."
277. Test with OpenVINO GenAI
28
29OpenVINO GenAI provides a clean runtime path for generative inference with OpenVINO-converted models.
30
31Run from inside the model directory:
32
33python examples/test_deepseek32b_ov_genai.py \
34 --model-dir . \
35 --device CPU \
36 --max-new-tokens 128 \
37 --prompt "Explain OpenVINO in one short paragraph."
38If CPU works, then try GPU
39
40First check that OpenVINO detects GPU devices. The included GenAI script prints available OpenVINO devices.
41
42Then run:
43
44python examples/test_deepseek32b_ov_genai.py \
45 --model-dir . \
46 --device GPU.0 \
47 --max-new-tokens 64 \
48 --prompt "Explain OpenVINO in one short paragraph."
49Notes
50This model is text-only.
51This repository uses both Optimum Intel and OpenVINO GenAI examples.
52The Optimum Intel path is useful for validating the exported model with Transformers-style APIs.
53The OpenVINO GenAI path is recommended for generative inference with OpenVINO-converted models.
54OpenVINO Model Server compatibility is not claimed unless separately validated.
55Limitations
56
57This repository inherits the limitations of the original deepseek-ai/DeepSeek-R1-Distill-Qwen-32B model. Additional differences may arise from OpenVINO conversion, INT4 compression, runtime package versions, and generation configuration.
58
59Attribution
60
61This is an unofficial OpenVINO conversion of the original DeepSeek model. All rights to the original model, training, and licensing remain with the original authors.
62
63Here is how I converted the original model to OV:
64
65cd ~
66
67python3.11 -m venv deepseek32b_ov_env
68source ~/deepseek32b_ov_env/bin/activate
69
70python -m pip install --upgrade pip setuptools wheel
71
72pip install -U \
73 "openvino>=2025.1.0" \
74 "optimum-intel[openvino]>=1.22.0" \
75 "nncf>=2.14.0" \
76 "transformers>=4.48.0" \
77 "accelerate" \
78 "safetensors" \
79 "huggingface_hub" \
80 "sentencepiece" \
81 "protobuf"
82
83cd ~/ov_models
84
85MODEL_ID="deepseek-ai/DeepSeek-R1-Distill-Qwen-32B"
86OUT_DIR="ov_DeepSeek-R1-Distill-Qwen-32B_int4"
87
88mkdir -p export_logs
89
90optimum-cli export openvino \
91 --model "$MODEL_ID" \
92 --weight-format int4 \
93 --group-size 128 \
94 --ratio 1.0 \
95 "$OUT_DIR" \
96 2>&1 | tee export_logs/deepseek_r1_distill_qwen_32b_int4_export.log