更新时间:2025-09-17 GMT+08:00
分享

多模态模型推理性能测试

多模态模型推理的性能测试目前支持语言+图片、语言+视频模式的测试。测试过程通过acs-bench工具实现,acs-bench工具安装请参考安装acs-bench工具

约束限制

当前版本支持语言+图片、语言+视频多模态性能测试。

获取数据集

  1. 生成图像+文本离线数据集,详细参数解释请参见生成数据集参数说明
    # 生成对应的随机数据集(图像加文本),以token长度为100,图像长宽分别为(250, 250)为例
    acs-bench generate dataset \
    --tokenizer ./model/Qwen-2.5-VL-72B/ \
    --output-path ./ \
    --num-requests 10 \
    --input-length 100 \
    --modal-type "image-text" \
    --config-option image_height:250,image_width:250

    生成的json数据集文件会存放在--output-path目录下,名称为${input-length}_image_${image_height}_${image_width}.json

  2. 生成视频+文本离线数据集,详细参数解释请参见生成数据集参数说明
    # 生成对应的随机数据集(视频加文本),以token长度为100,视频帧长宽分别为(250, 250)、视频时长和帧数分别为(3,25)为例
    acs-bench generate dataset \
    --tokenizer ./model/Qwen-2.5-VL-72B/ \
    --output-path ./ \
    --num-requests 10 \
    --input-length 100 \
    --modal-type "video-text" \
    --config-option image_height:250,image_width:250,duration:3,fsp:25

    生成的json数据集文件会存放在--output-path目录下,名称为${input-length}_video_${image_height}_${image_width}_${duration}_${fps}.json

生成数据集命令中的--input-length和--num-requests仅支持单个值。

如果需要生成其他规格的数据集,将--input-length或--num-requests修改成对应规格的值后,执行命令。

性能压测模式验证

使用acs-bench prof命令对多模态模型进行性能压测的示例如下,详细参数解释请参见使用示例的参数说明,输出产物说明参见产物说明

# (1)以图片+文本多模态为例,使用线程池为例进行并发测试(后端并发模式默认为多线程模式`threading-pool`,可以选择异步协程并发模式`asyncio`、多进程模式`processing-pool`或者多线程模式`threading-pool`)
$ acs-bench prof \
--tokenizer ./model/Qwen-2.5-VL-72B/ \
--provider ./provider/providers.yaml \
--input-path ./built_in_dataset/ \
--concurrency-backend threading-pool \
--backend openai-chat --warmup 1 \
--epochs 2 \
--num-requests 1,2,4,8 --concurrency 1,2,4,8 \
--input-length 128,2048 --output-length 128,2048 \
--modal-type "image-text" \
--config-option image_height:250,image_width:250 \
--benchmark-save-path ./output_path/

# (2)以视频+文本多模态为例,使用线程池为例进行并发测试(后端并发模式默认为多线程模式`threading-pool`,可以选择异步协程并发模式`asyncio`、多进程模式`processing-pool`或者多线程模式`threading-pool`)
$ acs-bench prof \
--tokenizer ./model/Qwen-2.5-VL-72B/ \
--provider ./provider/providers.yaml \
--input-path ./built_in_dataset/ \
--concurrency-backend threading-pool \
--backend openai-chat --warmup 1 \
--epochs 2 \
--num-requests 1,2,4,8 --concurrency 1,2,4,8 \
--input-length 128,2048 --output-length 128,2048 \
--modal-type "video-text" \
--config-option image_height:250,image_width:250,duration:3,fsp:25 \
--benchmark-save-path ./output_path/

爬坡模式验证

使用acs-bench prof命令对多模态模型进行爬坡压测的示例如下,详细参数解释请参见使用示例的参数说明,输出产物说明参见产物说明

# (1)以图片+文本多模态为例,使用线程池为例进行爬坡测试(后端并发模式默认为多线程模式`threading-pool`,可以选择异步协程并发模式`asyncio`、多进程模式`processing-pool`或者多线程模式`threading-pool`)
$ acs-bench prof \
--tokenizer ./model/Qwen-2.5-VL-72B/ \
--provider ./provider/providers.yaml \
--input-path ./built_in_dataset/ \
--concurrency-backend threading-pool \
--backend openai-chat --warmup 1 \
--epochs 2 \
--use-climb --climb-mode linear --growth-rate 2 --init-concurrency 1 --growth-interval 5000 \
--num-requests 1,2,4,8 --concurrency 1,2,4,8 \
--input-length 128,2048 --output-length 128,2048 \
--modal-type "image-text" \
--config-option image_height:250,image_width:250 \
--benchmark-save-path ./output_path/

# (2)以视频+文本多模态为例,使用线程池为例进行爬坡测试(后端并发模式默认为多线程模式`threading-pool`,可以选择异步协程并发模式`asyncio`、多进程模式`processing-pool`或者多线程模式`threading-pool`)
$ acs-bench prof \
--tokenizer ./model/Qwen-2.5-VL-72B/ \
--provider ./provider/providers.yaml \
--input-path ./built_in_dataset/ \
--concurrency-backend threading-pool \
--backend openai-chat --warmup 1 \
--epochs 2 \
--use-climb --climb-mode linear --growth-rate 2 --init-concurrency 1 --growth-interval 5000 \
--num-requests 1,2,4,8 --concurrency 1,2,4,8 \
--input-length 128,2048 --output-length 128,2048 \
--modal-type "video-text" \
--config-option image_height:250,image_width:250,duration:3,fsp:25 \
--benchmark-save-path ./output_path/

性能压测模式验证和爬坡模式验证示例中的 --input-length参数值,必须在提前生成的数据集中存在,如果不存在,参考获取数据集,生成对应输入长度的数据集。

相关文档