[Cleanup] Drop empty _DIFFUSION_PIPELINES placeholder (#3040)
Signed-off-by: lishunyang <lishunyang12@163.com>
This commit is contained in:
1 parent
e03ab82dd2
commit
9da06690ea
4 files changed
+14
-29
No files matched your search
@@ -6,11 +6,7 @@ from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from vllm_omni.config.pipeline_registry import (
|
||||
_DIFFUSION_PIPELINES,
|
||||
_OMNI_PIPELINES,
|
||||
_VLLM_OMNI_PIPELINES,
|
||||
)
|
||||
from vllm_omni.config.pipeline_registry import _OMNI_PIPELINES
|
||||
from vllm_omni.config.stage_config import (
|
||||
_PIPELINE_REGISTRY,
|
||||
PipelineConfig,
|
||||
@@ -23,17 +19,9 @@ from vllm_omni.config.stage_config import (
|
||||
class TestCentralRegistryDeclarations:
|
||||
"""Every in-tree pipeline must be declared exactly once in the central registry."""
|
||||
|
||||
def test_union_contains_all_omni(self):
|
||||
def test_omni_entries_visible_in_registry(self):
|
||||
for key in _OMNI_PIPELINES:
|
||||
assert key in _VLLM_OMNI_PIPELINES
|
||||
|
||||
def test_union_contains_all_diffusion(self):
|
||||
for key in _DIFFUSION_PIPELINES:
|
||||
assert key in _VLLM_OMNI_PIPELINES
|
||||
|
||||
def test_no_duplicate_model_type_between_omni_and_diffusion(self):
|
||||
overlap = set(_OMNI_PIPELINES) & set(_DIFFUSION_PIPELINES)
|
||||
assert not overlap, f"Duplicate model_types across omni/diffusion: {overlap}"
|
||||
assert key in _PIPELINE_REGISTRY
|
||||
|
||||
def test_expected_omni_pipelines_present(self):
|
||||
# Guard against accidental removal during future refactors.
|
||||
|
||||
@@ -701,7 +701,7 @@ stages:
|
||||
|
||||
|
||||
class TestPipelineDiscovery:
|
||||
"""Tests for the central pipeline registry (``pipeline_registry._VLLM_OMNI_PIPELINES``)."""
|
||||
"""Tests for the central pipeline registry (``pipeline_registry._OMNI_PIPELINES``)."""
|
||||
|
||||
def test_registry_has_known_models(self):
|
||||
"""Built-in pipelines are lazy-loaded from the central declaration
|
||||
|
||||
@@ -15,7 +15,13 @@ they just no longer need to self-register via ``register_pipeline(...)``.
|
||||
Adding a new pipeline:
|
||||
1. Define the ``PipelineConfig`` instance as a module-level variable in
|
||||
``vllm_omni/.../pipeline.py``.
|
||||
2. Add one line to ``_OMNI_PIPELINES`` or ``_DIFFUSION_PIPELINES`` below.
|
||||
2. Add one line to ``_OMNI_PIPELINES`` below.
|
||||
|
||||
Single-stage diffusion models continue to use the
|
||||
``_create_default_diffusion_stage_cfg`` fallback in
|
||||
``async_omni_engine.py`` — they don't need a registry entry. The empty
|
||||
``_DIFFUSION_PIPELINES`` placeholder previously here (#2915) was removed
|
||||
once #2987 (which would have populated it) was deferred.
|
||||
|
||||
``register_pipeline(config)`` in ``stage_config`` is still supported for
|
||||
out-of-tree plugins and tests that create pipelines at runtime; those override
|
||||
@@ -80,12 +86,3 @@ _OMNI_PIPELINES: dict[str, tuple[str, str]] = {
|
||||
"FISH_SPEECH_PIPELINE",
|
||||
),
|
||||
}
|
||||
|
||||
# --- Single-stage diffusion pipelines (populated in PR 3/N) ---
|
||||
_DIFFUSION_PIPELINES: dict[str, tuple[str, str]] = {}
|
||||
|
||||
# Union view used by ``_LazyPipelineRegistry``; don't mutate at runtime.
|
||||
_VLLM_OMNI_PIPELINES: dict[str, tuple[str, str]] = {
|
||||
**_OMNI_PIPELINES,
|
||||
**_DIFFUSION_PIPELINES,
|
||||
}
|
||||
@@ -274,9 +274,9 @@ class _LazyPipelineRegistry:
|
||||
|
||||
def _get_lazy_map(self) -> dict[str, tuple[str, str]]:
|
||||
if self._lazy_map is None:
|
||||
from vllm_omni.config.pipeline_registry import _VLLM_OMNI_PIPELINES
|
||||
from vllm_omni.config.pipeline_registry import _OMNI_PIPELINES
|
||||
|
||||
self._lazy_map = _VLLM_OMNI_PIPELINES
|
||||
self._lazy_map = _OMNI_PIPELINES
|
||||
return self._lazy_map
|
||||
|
||||
def _load_lazy(self, model_type: str) -> PipelineConfig | None:
|
||||
@@ -374,7 +374,7 @@ _PIPELINE_REGISTRY = _LazyPipelineRegistry()
|
||||
def register_pipeline(pipeline: PipelineConfig) -> None:
|
||||
"""Register a pipeline config dynamically.
|
||||
|
||||
In-tree pipelines are declared in ``pipeline_registry._VLLM_OMNI_PIPELINES``
|
||||
In-tree pipelines are declared in ``pipeline_registry._OMNI_PIPELINES``
|
||||
and loaded lazily; calling ``register_pipeline`` is only needed for
|
||||
out-of-tree plugins or tests that build a ``PipelineConfig`` at runtime.
|
||||
A dynamic registration overrides the central-registry entry with the same
|
||||
|
||||
Reference in new issue
Block a user