一、测试条件
- SDK版本:4.4.0
- GPU型号:MR100
- 模型所需最低GPU数量:4
- CPU架构:X86_64
二、创建容器
1、获取镜像
docker pull harbor.iluvatar.com.cn:10443/saas/mr-bi150-4.4.0-x86-ubuntu20.04-py3.10-poc-llm-infer:v1.2.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=Qwen3-VL-30B-A3B-Instruct-W4A8 --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.4 /bin/bash
3、进入容器
docker exec -it Qwen3-VL-30B-A3B-Instruct-W4A8 bash
三、启动服务
1、魔搭上下载权重
pip install modelscope
pip install --upgrade modelscope
modelscope download --model iluvatar-corex/Qwen3-VL-30B-A3B-Instruct-W4A8 --local_dir /data/models/Qwen3-VL-30B-A3B-Instruct-W4A8
2、启动模型
export VLLM_RPC_TIMEOUT=50000
export VLLM_ENFORCE_CUDA_GRAPH=1
export VLLM_KV_DISABLE_CROSS_GROUP_SHARE=1
export VLLM_W8A8_MOE_USE_W4A8=1
export VLLM_USE_V1=0
vllm serve /data/models/Qwen3-VL-30B-A3B-Instruct-W4A8 --trust-remote-code --tensor-parallel-size 4 --max-num-seqs 64 --enable-chunked-prefill --max-model-len 32768 --max-num-batched-tokens 16384 --gpu-memory-utilization 0.90 --compilation-config '{"cudagraph_mode": "FULL_DECODE_ONLY", "level": 0}'
四、curl请求测试
1、普通Curl请求测试
#使用v1 chat接口
curl -s -X POST "http://127.0.0.1:8000/v1/chat/completions" -H "Content-Type: application/json" -d '{
"model": "/data/models/Qwen3-VL-30B-A3B-Instruct-W4A8",
"messages": [{"role": "user", "content": "请介绍一下人工智能"}],
"temperature": 0.7,
"top_p": 0.9,
"chat_template_kwargs": {
"enable_thinking": false
}
}'
2、使用jq格式化curl输出
1)、安装jq
apt-get update
apt-get install jq
2)、curl请求测试
文本请求
curl -s -X POST "http://127.0.0.1:8000/v1/chat/completions" -H "Content-Type: application/json" -d '{
"model": "/data/models/Qwen3-VL-30B-A3B-Instruct-W4A8",
"messages": [{"role": "user", "content": "请介绍一下人工智能"}],
"temperature": 0.7,
"top_p": 0.9,
"chat_template_kwargs": {
"enable_thinking": false
}
}' | jq -r '.choices[0].message.content'
图片解析
curl -s -X POST "http://127.0.0.1:$port/v1/chat/completions" \
-H "Content-Type: application/json" \
-d '{
"model": "'"$model_start_path"'",
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://gips1.baidu.com/it/u=3874647369,3220417986&fm=3028&app=3028&f=JPEG&fmt=auto?w=720&h=1280"
}
},
{
"type": "text",
"text": "请详细描述这张图片的内容"
}
]
}
],
"temperature": 0.7,
"max_tokens": 1024,
"chat_template_kwargs": {
"enable_thinking": false
}
}' | jq -r '.choices[0].message.content'
五、Benchmark测试
1、进入容器,执行测试
docker exec -it Qwen3-VL-30B-A3B-Instruct-W4A8 bash
文本Benchmark
vllm bench serve --model /data/models/Qwen3-VL-30B-A3B-Instruct-W4A8 --num-prompt 1 --max-concurrency 1 --port 8000 --random_input_len 1024 --random_output_len 1024
多模态Benchmark
sftp -P 29880 iluvatar_mr@iftp.iluvatar.com.cn
密码请咨询天数售后
get /client_tmp/support/Benchmark/benchmark_vl.tar.gz
tar -zxvf benchmark_vl.tar.gz
python3 benchmark_serving_vl.py --model /data/models/Qwen3-VL-30B-A3B-Instruct-W4A8 --num-prompts 1 --output-tokens 512 --port 8000