hyena93/VoxCPM2And15
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

0、基础

特别鸣谢https://ai.gitcode.com/Ascend-SACT/VoxCPM2,本库在2_, 3_, 4_ patch基础上修订而来,并且为了方便,只打了一个patch

1、性能优化和VoxCPM1.5支持

1.1 NPU上支持性能profiling,在voxcpm.yaml中enable_profiling: true,即可打开模型每forward()中step顺序和耗时,方便分析
1.2 修订在32请求8并发场景性能劣化问题,原因是混批时用来CFM生成decode_step走的串行,未走batch接口
1.3 开放enable_batched_fsq_fusion: true; enable_batched_prefill_tail: true; enable_loc_dit_fast_rope: true开关并合入相关修订,对性能有少许增益,具体见vLLM-Omni官仓recipes/OpenBMB/VoxCPM2.md的介绍
1.4 合入PR#7866,解决每条请求随机音色问题
1.5 引入对VoxCPM1.5的支持,所有配置方式均不变,修改权重即可
1.6 默认并发数16

2、软硬件环境

项信息
NPU910B4
基础镜像quay.io/ascend/vllm-omni:v0.24.0
模型权重1https://www.modelscope.cn/models/OpenBMB/VoxCPM2
模型权重2[[https://modelscope.cn/models/OpenBMB/VoxCPM1.5]]

3、启动脚本

#!/bin/bash

export HCCL_OP_EXPANSION_MODE="AIV"
export ASCEND_RT_VISIBLE_DEVICES=0
export PYTORCH_NPU_ALLOC_CONF=expandable_segments:True
export TASK_QUEUE_ENABLE=1
export CPU_AFFINITY_CONF=2

# 每请求都打印的INFO日志,通过--disable-log-stats关闭
vllm serve /mnt/tan/models/OpenBMB/VoxCPM2 --served-model-name voxcpm --omni --disable-log-stats --host 0.0.0.0 --port 8987 &

4、Benchmark测试

vllm bench serve --omni \
    --host 127.0.0.1 --port 8987 \
    --model /mnt/tan/models/OpenBMB/VoxCPM2 \
    --served-model-name voxcpm \
    --backend openai-audio-speech \
    --endpoint /v1/audio/speech \
    --dataset-name seed-tts-text \
    --dataset-path /vllm-workspace/vllm-omni/benchmarks/build_dataset/seed_tts_smoke \
    --seed-tts-locale en \
    --num-prompts 64 --num-warmups 1 \
    --max-concurrency 16 --request-rate inf \
    --percentile-metrics ttft,e2el,audio_rtf,audio_ttfp,audio_duration,audio_underrun \
    --trust-remote-code \
    --save-result --result-dir ./results

![[Pasted image 20261101183433.png]]