1056  
查询码: 00000585
Qwen2.5-1.5B-Instruct模型部署(SDK 4.4.0)
专家 2026年05月18日 发布 ,于 2026年05月18日 编辑

一、测试条件

sdk4.4版、X86环境 、MR100卡、镜像harbor.iluvatar.com.cn:10443/saas/mr-bi150-4.4.0-x86-ubuntu20.04-py3.10-poc-llm-infer:v1.2.3

二、创建容器

1、获取镜像

docker pull harbor.iluvatar.com.cn:10443/saas/mr-bi150-4.4.0-x86-ubuntu20.04-py3.10-poc-llm-infer:v1.2.3

2、创建容器

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

三、启动服务

1、魔搭上下载权重

pip install modelscope
pip install --upgrade modelscope
modelscope download --model Qwen/Qwen2.5-1.5B-Instruct --local_dir Qwen2.5-1.5B-Instruct

2、启动模型

#Qwen2.5-1.5B-Instruct
export VLLM_ENFORCE_CUDA_GRAPH=1
export VLLM_KV_DISABLE_CROSS_GROUP_SHARE=1
export VLLM_RPC_TIMEOUT=50000
vllm serve /data/models/Qwen2.5-1.5B-Instruct \
  --trust-remote-code \
  --tensor-parallel-size 1 \
  --max-num-seqs 16 \
  --enable-chunked-prefill \
  --max-model-len 16384 \
  --host 0.0.0.0 \
  --gpu-memory-utilization 0.85 \
  --compilation-config '{"cudagraph_mode": "FULL_DECODE_ONLY", "level": 0}'

四、curl请求测试

1、普通Curl请求测试

#使用v1 chat接口
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
-d '{
"model": " /data/models/Qwen2.5-1.5B-Instruct",
"messages": [
{"role": "user", "content": "请详细介绍人工智能"}
],
"max_tokens": 1024
}'
#使用v1 completions接口
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
-d '{
"model": " /data/models/Qwen2.5-1.5B-Instruct",
"prompt": "请详细介绍人工智能",
"max_tokens": 1024,
"temperature": 0.7,
"top_p": 0.9
}'

2、使用jq格式化curl输出

1)、安装jq

apt-get update
apt-get install jq

2)、curl请求测试

-H "Content-Type: application/json" \
-d '{
"model": " /data/models/Qwen2.5-1.5B-Instruct",
"prompt": "请介绍一下人工智能\n",
"temperature": 0.0,
"max_tokens": 512
}' | jq -r '.choices[0].text'

五、Benchmark测试

1、benchmark工具下载

sftp -P 29880 iluvatar_mr@iftp.iluvatar.com.cn    (访问密码请咨询天数售后)
get /client_tmp/support/kk/vllm_benchmark.tar.gz  /home/

2、进入容器,执行测试

docker exec -it sdk440llminfer123 bash
cd /data/models/vllm_benchmark
python3 benchmark_serving.py --model /data/models/Qwen2.5-1.5B-Instruct --dataset-name random --random-input-len 1024 --random-output-len 1024 --num-prompts 1 --host "0.0.0.0" --port 8000
笔记



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