---
title: DeepSeek-R1-Distill-Llama-8B-awq-asym-uint4-g128-lmhead
canonical_url: "https://www.modelscope.ai/models/AMD/DeepSeek-R1-Distill-Llama-8B-awq-asym-uint4-g128-lmhead"
md_url: "https://www.modelscope.ai/models/AMD/DeepSeek-R1-Distill-Llama-8B-awq-asym-uint4-g128-lmhead.md"
repository: AMD/DeepSeek-R1-Distill-Llama-8B-awq-asym-uint4-g128-lmhead
last_updated: 2025-12-27
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - llama
architectures:
  - LlamaForCausalLM
base_model:
  - deepseek-ai/DeepSeek-R1-Distill-Llama-8B
base_model_relation: quantized
parameters: 1.5B
tensor_type:
  - BF16
  - I32
library_name:
  - safetensors
  - pytorch
frameworks:
  - pytorch
language:
  - en
downloads: 129
stars: 0
---

# DeepSeek-R1-Distill-Llama-8B-awq-asym-uint4-g128-lmhead

> DeepSeek-R1-Distill-Llama-8B-awq-asym-uint4-g128-lmhead - An open-source model by AMD on ModelScope. DeepSeek-R1-Distill-Llama-8B-awq-asym-uint4-g128-lmhead ## Introduction This model was created by applying Quark with calibration samples from Pile dataset.…

AMD/DeepSeek-R1-Distill-Llama-8B-awq-asym-uint4-g128-lmhead is a 1.5B-parameter text-generation model on ModelScope. derived from deepseek-ai/DeepSeek-R1-Distill-Llama-8B.

- **Repository**: AMD/DeepSeek-R1-Distill-Llama-8B-awq-asym-uint4-g128-lmhead
- **Tasks**: text-generation
- **Parameters**: 1.5B
- **Base model**: deepseek-ai/DeepSeek-R1-Distill-Llama-8B
- **Downloads**: 129
- **Stars**: 0
- **Last updated**: 2025-12-27

Source: https://www.modelscope.ai/models/AMD/DeepSeek-R1-Distill-Llama-8B-awq-asym-uint4-g128-lmhead

---

# DeepSeek-R1-Distill-Llama-8B-awq-asym-uint4-g128-lmhead
- ## Introduction
  This model was created by applying [Quark](https://quark.docs.amd.com/latest/index.html) 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](https://quark.docs.amd.com/latest/install.html)
2. Run the quantization script in the example folder using the following command line:
    ```sh
    export MODEL_DIR = [local model checkpoint folder] or DeepSeek-R1-Distill-Llama-8B
    # 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
<table>
  <tr>
   <td><strong>Benchmark</strong>
   </td>
   <td><strong>deepseek-ai/DeepSeek-R1-Distill-Llama-8B</strong>
   </td>
   <td><strong>amd/DeepSeek-R1-Distill-Llama-8B-awq-asym-uint4-g128-lmhead (this model)</strong>
   </td>
  </tr>
  <tr>
   <td>Perplexity-wikitext2
   </td>
   <td>13.1432
   </td>
   <td>14.2143
   </td>
  </tr>
  
</table>

#### 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.
