1105  
查询码: 00000511
MR100/BI150+x86容器上运行DeepSeek-V3.1-w4a8模型部署(SDK4.4.0)
2026年03月09日 发布 ,于 2026年03月09日 编辑

卸载原来SDK (如果有,就需要执行,没有跳过这步)

rmmod iluvatar
sudo /usr/local/corex/bin/corex-driver-uninstaller
sudo /usr/local/corex/bin/corex-uninstaller
ls -l /usr/local/corex*
确保/usr/local/ 下没有corex开头的目录

下载模型

apt-get install git-lfs 或者yum install git-lfs 
cd /home/model
git clone https://www.modelscope.cn/deepseek-ai/DeepSeek-V3.1.git

下载4.4.0驱动和镜像包

通过SFTP下载,SFTP下载地址和密码,请联系天数售后工程师获取
sftp -P 29880 iluvatar_mr@iftp.iluvatar.com.cn 

get  /SDK_4.4.0/x86/sdk/ corex-docker-installer-4.4.0-10.2-ubuntu20.04-llm-py3.10-x86_64.run /home

get /client_tmp/support/w4a8/* /home/scripts

安装驱动和镜像

bash /home/corex-docker-installer-4.4.0-10.2-ubuntu20.04-llm-py3.10-x86_64.run  

全选安装


配置环境变量
vi /root/.bashrc
export LD_LIBRARY_PATH=/usr/local/corex-4.4.0/lib
export PATH=/usr/local/corex-4.4.0/bin:$PATH
使环境变量生效
source /root/.bashrc
检查驱动是否安装成功
ixsmi
创建容器


docker run -dit -v /usr/src:/usr/src -v /lib/modules:/lib/modules -v /dev:/dev -v /home:/home --network=host --name=test --pid=host --ipc=host --privileged --cap-add=ALL corex:4.4.0 /bin/bash

进入容器

docker exec -it test bash

量化权重


cd /home/scripts


python3 w4a8_fp82int8.py --input-fp8-hf-path /home/model/DeepSeek-V3.1/  --output-int8-hf-path /home/model/DeepSeek-V3.1-w4a8/  --group-size -1 --format TN --version 2 --split-count 1


python3 w4a8_fp82int8.py --input-fp8-hf-path /home/model/ DeepSeek-V3.1/  --output-int8-hf-path /home/model/ DeepSeek-V3.1-w4a8/  --group-size -1 --format TN --version 2 --split-count 2

起服务

export TORCHDYNAMO_DISABLE=1
export VLLM_W8A8_MOE_USE_W4A8=1
export VLLM_KV_DISABLE_CROSS_GROUP_SHARE=1
export VLLM_PP_LAYER_PARTITION="31,30"
export VLLM_MLA_DISABLE=0

export VLLM_ENFORCE_CUDA_GRAPH=1


python3 -m vllm.entrypoints.openai.api_server \
  --model /home/model/DeepSeek-V3.1-w4a8/ \
  --tensor-parallel-size 8 \
  --pipeline-parallel-size 2 \
  --trust-remote-code \
  --max-model-len 21504 \
  --host 127.0.0.1 \
  --port 1234 \
  --gpu_memory_utilization 0.90 \
  --enable-chunked-prefill \
  --enable-prefix-caching \
  --disable-log-requests


测试

curl -X POST http://127.0.0.1:1234/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
  "model": "/home/model/DeepSeek-V3.1-w4a8/",
  "messages": [
    {
      "role": "system",
      "content": "你是一个专业的企业管理咨询顾问。"
    },
    {
      "role": "user",
      "content": "AEOS体系建设包括哪些内容?"
    }
  ],
  "temperature": 0.0,
  "max_tokens": 4096
}'

笔记



  目录
    天数智芯知识库系统 -V 5.2.7 -wcp