ONNX Model Zoo

amd/DeepSeek-R1-Distill-Qwen-7B-awq-asym-uint4-g128-lmhead-onnx-dml

By amd · ↓ 0 · ♥ 0 · Updated 2025-01-30

What's in this repo

This page lists the files in amd/DeepSeek-R1-Distill-Qwen-7B-awq-asym-uint4-g128-lmhead-onnx-dml, including model.onnx.

  • 1 ONNX models (.onnx files)
  • 8 files, including 4 .json, 1 .md, 1 .onnx, 1 .data
  • Last updated 2025-01-30

ONNX files

File Size Download
model.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

DeepSeek-R1-Distill-Qwen-7B-awq-asym-uint4-g128-lmhead-onnx-dml

  • Introduction

    This model was created by applying Quark with calibration samples from Pile dataset.
  • Quantization Strategy

    • Quantized Layers: All linear layers
    • Weight: uint4 asymmetric per-group, group_size=128
  • Quick Start

  1. Download and install Quark
  2. Run the quantization script in the example folder using the following command line:
    export MODEL_DIR = [local model checkpoint folder] or DeepSeek-R1-Distill-Qwen-7B
    # single GPU
    python quantize_quark.py --model_dir $MODEL_DIR \
                            --output_dir output_dir $MODEL_NAME-awq-asym-uint4-g128-lmhead \
                            --quant_scheme w_uint4_per_group_asym \
                            --num_calib_data 128 \
                            --quant_algo awq \
                            --dataset pileval_for_awq_benchmark \
                            --seq_len 512 \
                            --model_export hf_format \
                            --data_type bfloat16 \
                            --exclude_layers
    # cpu
    python quantize_quark.py --model_dir $MODEL_DIR \
                            --output_dir output_dir $MODEL_NAME-awq-asym-uint4-g128-lmhead \
                            --quant_scheme w_uint4_per_group_asym \
                            --num_calib_data 128 \
                            --quant_algo awq \
                            --dataset pileval_for_awq_benchmark \
                            --seq_len 512 \
                            --model_export hf_format \
                            --data_type bfloat16 \
                            --exclude_layers \
                            --device cpu
    

Deployment

Quark has its own export format, quark_safetensors, which is compatible with autoAWQ exports.

Evaluation

Quark currently uses perplexity(PPL) as the evaluation metric for accuracy loss before and after quantization.The specific PPL algorithm can be referenced in the quantize_quark.py. The quantization evaluation results are conducted in pseudo-quantization mode, which may slightly differ from the actual quantized inference accuracy. These results are provided for reference only.

Evaluation scores

Benchmark | deepseek-ai/DeepSeek-R1-Distill-Qwen-7B | amd/DeepSeek-R1-Distill-Qwen-7B-awq-asym-uint4-g128-lmhead-onnx-dml (this model) |

Perplexity-wikitext2 | 26.0455 | 28.0579 (Measured with CPU Model) |

License

Modifications copyright(c) 2024 Advanced Micro Devices,Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Model info

onnx text-generation conversational en base_model:deepseek-ai/DeepSeek-R1-Distill-Qwen-7B base_model:quantized:deepseek-ai/DeepSeek-R1-Distill-Qwen-7B region:us
↓ 0 ♥ 0

Created: 2025-01-30

Updated: 2025-01-30

View on Hugging Face

Files (8)

.gitattributes
README.md
genai_config.json
model.onnx ONNX
model.onnx.data
special_tokens_map.json
tokenizer.json
tokenizer_config.json

Related models