[Fix] Reuse resolved pipeline configuration for orchestration defaults

Signed-off-by: Sy03 <1370724210@qq.com>
This commit is contained in:
Sy03 committed 2026-09-16 16:47:48 +08:00
1 parent 288a707bb6
commit f25595e03a
2 files changed
+26 -28

No files matched your search

+23 -2
View File
@@ -16,7 +16,7 @@ from pytest_mock import MockerFixture
from vllm.v1.engine.utils import EngineZmqAddresses
from vllm_omni.config.config_factory import StageConfigFactory
from vllm_omni.config.stage_config import DuplexSessionRuntimeConfig
from vllm_omni.config.stage_config import DuplexSessionRuntimeConfig, PipelineConfig, StagePipelineConfig
from vllm_omni.engine.async_omni_engine import AsyncOmniEngine
from vllm_omni.engine.stage_engine_core_client import StageEngineCoreClientBase
from vllm_omni.engine.stage_engine_startup import (
@@ -378,6 +378,7 @@ class TestSingleStageModeDetection:
stage_cfgs: list[Any] | None = None,
resolved_config_path: str = "/fake/path",
patch_deploy_config: bool = True,
resolved_pipeline: PipelineConfig | None = None,
**kwargs: Any,
) -> AsyncOmniEngine:
mock_stage_configs = stage_cfgs or [_make_stage_cfg(0)]
@@ -392,10 +393,19 @@ class TestSingleStageModeDetection:
"vllm_omni.engine.async_omni_engine.load_deploy_config",
return_value=SimpleNamespace(duplex_session=DuplexSessionRuntimeConfig()),
)
def resolve_stage_configs(engine, *args, **kwargs):
if resolved_pipeline is not None:
engine._config_resolution = SimpleNamespace(
pipeline_config=resolved_pipeline, config_path=resolved_config_path
)
return resolved_config_path, mock_stage_configs
mocker.patch.object(
AsyncOmniEngine,
"_resolve_stage_configs",
return_value=(resolved_config_path, mock_stage_configs),
autospec=True,
side_effect=resolve_stage_configs,
)
mocker.patch.object(AsyncOmniEngine, "_bootstrap_orchestrator")
mock_thread_cls = mocker.patch("threading.Thread")
@@ -420,6 +430,17 @@ class TestSingleStageModeDetection:
)
assert engine.single_stage_mode is True
@pytest.mark.parametrize("model_type, expected", [("qwen3_tts", True), ("qwen3_omni_moe", False)])
def test_event_driven_default_uses_resolved_pipeline(self, mocker, model_type, expected):
pipeline = PipelineConfig(
model_type=model_type,
stages=(StagePipelineConfig(stage_id=0, model_stage="a", final_output=True),),
)
engine = self._make_engine_no_thread(mocker, resolved_pipeline=pipeline)
StageConfigFactory.get_pipeline_config.assert_not_called()
assert engine._event_driven_orch_default is expected
def test_stage_id_kwarg_promotes_to_single_stage_mode(self, mocker: MockerFixture):
engine = self._make_engine_no_thread(
mocker,