perf(qwen3-tts): cache decoder masks and compile pre-transformer (#5107)

Signed-off-by: Ziyang Zhang <hafuhafu@qq.com>
Co-authored-by: Sy03 <1370724210@qq.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
authored and GitHub committed 2026-07-25 08:09:19 +00:00
1 parent 7afd3a0dcb
commit af2f84582b
3 files changed
+249 -40

No files matched your search

@@ -12,15 +12,21 @@ import os
os.environ["VLLM_WORKER_MULTIPROC_METHOD"] = "spawn"
import pytest
from vllm.platforms import current_platform
from tests.helpers.mark import hardware_test
from tests.helpers.runtime import OmniServerParams
from tests.helpers.stage_config import get_deploy_config_path, modify_stage_config
from tests.helpers.stage_config import (
get_deploy_config_path,
get_deploy_config_stage,
modify_stage_config,
)
MODEL = "Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice"
_DEFAULT_STAGE_CONFIG = get_deploy_config_path("qwen3_tts.yaml")
_STAGE_CONFIG = modify_stage_config(
get_deploy_config_path("qwen3_tts.yaml"),
_DEFAULT_STAGE_CONFIG,
updates={"stages": {0: {"default_sampling_params.max_tokens": 500}}},
)
@@ -50,6 +56,39 @@ tts_server_params = [
)
]
default_tts_server_params = [
pytest.param(
OmniServerParams(
model=MODEL,
stage_config_path=_DEFAULT_STAGE_CONFIG,
server_args=["--trust-remote-code"],
),
id="async_chunk",
)
]
@pytest.mark.core_model
@pytest.mark.advanced_model
@pytest.mark.tts
@pytest.mark.skipif(not current_platform.is_cuda(), reason="CUDA Graph startup test requires CUDA")
@hardware_test(res={"cuda": "L4"}, num_cards=1)
@pytest.mark.parametrize("omni_server", default_tts_server_params, indirect=True)
def test_default_cuda_graph_startup(omni_server) -> None:
"""Verify both stages start with the shipped CUDA Graph configuration.
The fixture reaching this test is the smoke assertion: it waits for the
server to become ready after both stages finish model initialization and
CUDA Graph capture. The regression covered here exited during stage 1
capture, before fixture setup could complete.
"""
for stage_id in (0, 1):
stage = get_deploy_config_stage("qwen3_tts.yaml", stage_id=stage_id)
assert stage.get("enforce_eager", False) is False
assert omni_server.proc is not None
assert omni_server.proc.poll() is None
@pytest.mark.core_model
@pytest.mark.advanced_model