一、测试条件
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
docker pull registry.iluvatar.com.cn:10443/customer/sz/vllm0.11.2-4.4.0-x86:v9 #或使用此镜像,使用此镜像时,无需更新vllm和安装numpy1.26.4
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/Qwen3.6-27B --local_dir /data/models/Qwen3.6-27B
2、环境准备
下载并安装vllm和numpy1.26.4
sftp -P 29880 iluvatar_mr@iftp.iluvatar.com.cn (访问密码请咨询天数售后)
get /client_tmp/support/vllm_solution/vllm-0.11.2+corex.4.4.0-py3-none-any.whl
pip uninstall vllm && pip install vllm-0.11.2+corex.4.4.0-py3-none-any.whl
pip install numpy==1.26.4
3、启动模型
#Qwen3.6-27B
export VLLM_ENFORCE_CUDA_GRAPH=1
export VLLM_KV_DISABLE_CROSS_GROUP_SHARE=1
vllm serve /data/models/Qwen3.6-27B \
--trust-remote-code \
--tensor-parallel-size 8 \
--max-num-seqs 64 \
--enable-chunked-prefill \
--max-model-len 32768 \
--reasoning-parser qwen3 \
--enable-auto-tool-choice \
--tool-call-parser qwen3_coder \
--host 0.0.0.0 \
--gpu-memory-utilization 0.90 \
--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/Qwen3.6-27B",
"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/Qwen3.6-27B",
"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/Qwen3.6-27B",
"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/Qwen3.6-27B --dataset-name random --random-input-len 1024 --random-output-len 1024 --num-prompts 1 --host "0.0.0.0" --port 8000