CoolFace
Modelpublic

ISTA-DASLab/DeepSeek-R1-GPTQ-4b-128g-experts

sourceHugging Facemitupdated 1y agoView on Hugging Face
4likes39downloads
Model Card

DeepSeek-R1-GPTQ-4b-128g-experts

<!-- markdownlint-disable first-line-h1 --> <!-- markdownlint-disable html --> <!-- markdownlint-disable no-duplicate-header -->

Model Overview

This model was obtained by quantizing the weights of deepseek-ai/DeepSeek-R1 to INT4 data type. This optimization reduces the number of bits per parameter from 8 to 4, reducing the disk size and GPU memory requirements by approximately 50%.

Only non-shared experts within transformer blocks are compressed. Weights are quantized using a symmetric per-group scheme, with group size 128. The GPTQ algorithm is applied for quantization.

Model checkpoint is saved in compressed_tensors format.

ModelsExperts QuantizedAttention blocks quantizedSize (GB)
deepseek-ai/DeepSeek-R1671 GB
ISTA-DASLab/DeepSeek-R1-GPTQ-4b-128g-experts346 GB
cognitivecomputations/DeepSeek-R1-AWQ340 GB

Evaluation

This model was evaluated on the OpenLLM v1 benchmarks and reasoning tasks (AIME-24, GPQA-Diamond, MATH-500).

Model outputs were generated with the vLLM engine.

For reasoning tasks we estimate pass@1 based on 10 runs with different seeds and temperature=0.6, top_p=0.95 and max_new_tokens=32768.

OpenLLM Leaderboard V1 tasks
Recovery (%)Average ScoreARC-Challenge<br>acc_norm, 25-shotGSM8k<br>exact_match, 5-shotHellaSwag<br>acc_norm, 10-shotMMLU<br>acc, 5-shotTruthfulQA<br>mc2, 0-shotWinoGrande<br>acc, 5-shot
deepseek/DeepSeek-R1100.0081.0472.5395.9189.3087.2259.2882.00
cognitivecomputations/DeepSeek-R1-AWQ100.0781.1073.1295.1589.0786.8660.0982.32
ISTA-DASLab/DeepSeek-R1-GPTQ-4b-128g99.8680.9372.7095.6889.2586.8358.7782.32
ISTA-DASLab/DeepSeek-R1-GPTQ-4b-128g-experts <br> (this model)100.3081.2872.5395.6889.3686.9959.7783.35
Reasoning tasks (AIME-24, GPQA-Diamond, MATH-500)
Recovery (%)Average ScoreAIME 2024<br>pass@1MATH-500<br>pass@1GPQA Diamond<br>pass@1
deepseek/DeepSeek-R1100.0082.9978.3397.2473.38
cognitivecomputations/DeepSeek-R1-AWQ94.2978.2570.6793.6470.46
ISTA-DASLab/DeepSeek-R1-GPTQ-4b-128g96.5280.1072.9697.0970.26
ISTA-DASLab/DeepSeek-R1-GPTQ-4b-128g-experts <br> (this model)98.8182.0077.0097.0871.92

Reproduction

The results were obtained using the following commands:

OpenLLM v1

bash
MODEL=ISTA-DASLab/DeepSeek-R1-GPTQ-4b-128g-act_order-mse_scale-experts
MODEL_ARGS="pretrained=$MODEL,dtype=auto,add_bos_token=True,max_model_len=4096,tensor_parallel_size=8,gpu_memory_utilization=0.8,enable_chunked_prefill=True,trust_remote_code=True"

lm_eval \
  --model vllm \
  --model_args $MODEL_ARGS \
  --tasks openllm \
  --batch_size auto

For reasoning evals we adopted the protocol from the open-r1 repository.

Reasoning tasks

bash
MODEL=ISTA-DASLab/DeepSeek-R1-GPTQ-4b-128g-act_order-mse_scale-experts
MODEL_ARGS="pretrained=$MODEL,dtype=bfloat16,max_model_length=38768,gpu_memory_utilization=0.8,tensor_parallel_size=8,add_special_tokens=false,generation_parameters={\"max_new_tokens\":32768,\"temperature\":0.6,\"top_p\":0.95,\"seed\":7686}"

export VLLM_WORKER_MULTIPROC_METHOD=spawn
lighteval vllm $MODEL_ARGS "custom|aime24|0|0,custom|math_500|0|0,custom|gpqa:diamond|0|0" \
    --custom-tasks src/open_r1/evaluate.py \
    --use-chat-template \
    --output-dir $OUTPUT_DIR

Please use this version of vLLM: https://github.com/vllm-project/vllm/pull/16038

Performance benchmarking

We follow the standard vLLM performance benchmarking with ShareGPT dataset and observe the following metrics (lower is better):

Time to First Token<br>Median TTFT (ms) ↓Time per Output Token<br>Median TPOT (ms) ↓Inter-token Latency<br>Median ITL (ms) ↓
cognitivecomputations/DeepSeek-R1-AWQ1585.4555.4143.06
ISTA-DASLab/DeepSeek-R1-GPTQ-4b-128g-experts<br> (this model)1344.6841.4936.33
ISTA-DASLab/DeepSeek-R1-GPTQ-4b-128g815.1944.6537.88

GPTQ models are faster across all metrics than AWQ models because GPTQ uses less bits-per-parameter than AWQ. More specifically, AWQ has to use smaller group-size of 64 (vs 128 in GPTQ) to preserve accuracy, and zero-points due to asymmetric quantization.

Contributors

Denis Kuznedelev (Yandex), Eldar Kurtić (Red Hat AI & ISTA), Jiale Chen (ISTA), Michael Goin (Red Hat AI), Elias Frantar (ISTA), Dan Alistarh (Red Hat AI & ISTA).