hf_mirrors/Qwen3-1.7B-W4A8-V1
Model Introduction
Files & versions
Analysis

Qwen3-1.7B-W4A8-V1

此模型使用msmodelslim 对 Qwen3 1.7B 进行 w4a8 dynamic 量化(新版格式)

量化准备

git clone https://gitcode.com/ascend/msit

cd msit/msmodelslim
bash install.sh
pip install accelerate

cd msmodelslim/example/Qwen

量化方法

# Original weight path, Replace with your local model path
MODEL_PATH=/path/to/model
# Path to save converted weight, Replace with your local path
SAVE_PATH=/path/to/save/quantmodel
python quant_qwen.py \
          --model_path $MODEL_PATH \
          --save_directory $SAVE_PATH \
          --device_type npu \
          --model_type qwen3 \
          --calib_file None \
          --anti_method m6 \
          --anti_calib_file ./calib_data/mix_dataset.json \
          --w_bit 4 \
          --a_bit 8 \
          --is_lowbit True \
          --open_outlier False \
          --group_size 128 \
          --is_dynamic True \
          --trust_remote_code True \
          --w_method HQQ

使用方法

  1. 在vllm-ascend中推理
export VLLM_USE_MODELSCOPE=True
vllm serve vllm-ascend/Qwen3-1.7B-W4A8-V1 --gpu-memory-utilization 0.96 --quantization ascend --max-model-len 9600 

您可以通过如下git clone命令,或者ModelScope SDK来下载模型

SDK下载

#安装ModelScope
pip install modelscope
#SDK模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('vllm-ascend/Qwen3-1.7B-W4A8-V1')

Git下载

#Git模型下载
git clone https://www.modelscope.cn/Anionex/Qwen3-1.7B-W4A8-V1.git