1153  
查询码: 00000389
天垓100+arm上运行qwen3模型 (SDK 3.2.3)
专家 2025年10月13日 发布 ,于 2026年03月04日 编辑

卸载原来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开头的目录

下载SDK最新安装包

在sftp上下载需要的安装包

通过SFTP下载:

sftp -P 29880 iluvatar_mr@iftp.iluvatar.com.cn

SFTP用户名和密码,请联系天数售后工程师获取

get /partial_install_cuda_header.tar.gz /home
get /client_tmp/support/bi100-3.2.3/corex-installer-linux64-3.2.3_arm64_10.2.run /home

安装3.2.3 SDK步骤

安装cuda header               (如果已安装:可以用ls -l /usr/local/cuda-10.2检查一下,就不需要执行下面步骤再进行安装了)
tar -zxvf partial_install_cuda_header.tar.gz
cd partial_install_cuda_header
bash install-cuda-header.sh
宿主机上安装驱动和软件栈
bash /home/corex-installer-linux64-3.2.3_arm64_10.2.run --silent --driver --toolkit 
设置环境变量
vi /root/.bashrc
export LD_LIBRARY_PATH=/usr/local/corex/lib
export PATH=/usr/local/corex/bin:$PATH
使环境变量生效

source /root/.bashrc

检查是否安装成功

ixsmi

粘贴图片

确保已安装docker

下载Qwen3模型权重

apt-get install git-lfs 或者yum install git-lfs 

mkdir -p /home/Qwen/

cd /home/Qwen/

git clone https://www.modelscope.cn/Qwen/Qwen3-4B.git 

git clone https://www.modelscope.cn/Qwen/Qwen3-8B.git 
git clone https://www.modelscope.cn/Qwen/Qwen3-14B.git 

git clone https://www.modelscope.cn/Qwen/Qwen3-32B.git 

准备镜像

联网拉取镜像

docker pull harbor.iluvatar.com.cn:10443/saas/bi100-3.2.3-aarch64-ubuntu20.04-py3.10-poc-llm-infer:v1.2.3

启动容器

docker run -dit -v /usr/src:/usr/src -v /lib/modules:/lib/modules -v /dev:/dev -v /home:/home --network=host --name=Qwen3 --ipc=host --privileged --cap-add=ALL --pid=host harbor.iluvatar.com.cn:10443/saas/bi100-3.2.3-aarch64-ubuntu20.04-py3.10-poc-llm-infer:v1.2.3 /bin/bash

进入容器

docker exec -it Qwen3 bash

运行offline_inference测试

cd /root/apps/llm-modelzoo/inference/Qwen/vllm

python3 offline_inference.py --model /home/Qwen/Qwen3-4B/  --max-tokens 256 --temperature 0.0 --max-model-len 3096 
python3 offline_inference.py --model /home/Qwen/Qwen3-8B/  --max-tokens 256 --temperature 0.0 --max-model-len 3096 
python3 offline_inference.py --model /home/Qwen/Qwen3-14B/  --max-tokens 256 -tp 2 --temperature 0.0 --max-model-len 3096 
python3 offline_inference.py --model /home/Qwen/Qwen3-32B/  --max-tokens 256 -tp 4 --temperature 0.0 --max-model-len 3096 

api测试

CURL测试

# server 端

python3 -m vllm.entrypoints.openai.api_server --model /home/Qwen/Qwen3-4B/ --gpu-memory-utilization 0.9 --max-num-batched-tokens 5120 --max-model-len 2048 --max-num-seqs 256 --host 0.0.0.0 --port 1234 --trust-remote-code
python3 -m vllm.entrypoints.openai.api_server --model /home/Qwen/Qwen3-8B/ --gpu-memory-utilization 0.9 --max-num-batched-tokens 5120 --max-model-len 2048 --max-num-seqs 256 --host 0.0.0.0 --port 1234 --trust-remote-code
python3 -m vllm.entrypoints.openai.api_server --model /home/Qwen/Qwen3-14B/ --gpu-memory-utilization 0.9 --max-num-batched-tokens 5120 --max-model-len 2048 --max-num-seqs 256 -tp 2 --host 0.0.0.0 --port 1234 --trust-remote-code
python3 -m vllm.entrypoints.openai.api_server --model /home/Qwen/Qwen3-32B/ --gpu-memory-utilization 0.9 --max-num-batched-tokens 5120 --max-model-len 2048 --max-num-seqs 256 -tp 4 --host 0.0.0.0 --port 1234 --trust-remote-code


# client 端

curl -X POST http://0.0.0.0:1234/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"model": "/home/Qwen/Qwen3-4B/","prompt": "介绍一下湖南省常德市","temperature": 0.0,"max_tokens": 512}'


curl -X POST http://0.0.0.0:1234/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"model": "/home/Qwen/Qwen3-8B/","prompt": "介绍一下湖南省常德市","temperature": 0.0,"max_tokens": 512}'


curl -X POST http://0.0.0.0:1234/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"model": "/home/Qwen/Qwen3-14B/","prompt": "介绍一下湖南省常德市","temperature": 0.0,"max_tokens": 512}'


curl -X POST http://0.0.0.0:1234/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"model": "/home/Qwen/Qwen3-32B/","prompt": "介绍一下湖南省常德市","temperature": 0.0,"max_tokens": 512}'

常见问题

1、返回值乱码问题,尝试修改模型精度,增加下面的参数

--dtype float16

或者 

--dtype bfloat16

粘贴图片


笔记



 附件

附件类型

PNGPNG

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