Skip to content

[Config Refactor 2.5/N] Centralize pipeline registry#2915

Merged
lishunyang12 merged 6 commits intovllm-project:mainfrom
lishunyang12:refactor-2.5-central-registry
Apr 19, 2026
Merged

[Config Refactor 2.5/N] Centralize pipeline registry#2915
lishunyang12 merged 6 commits intovllm-project:mainfrom
lishunyang12:refactor-2.5-central-registry

Conversation

@lishunyang12
Copy link
Copy Markdown
Collaborator

@lishunyang12 lishunyang12 commented Apr 19, 2026

Summary

Moves all in-tree PipelineConfig declarations to a single central registry (vllm_omni/config/pipeline_registry.py), mirroring vLLM's vllm/model_executor/models/registry.py pattern. _PIPELINE_REGISTRY is now a lazy proxy that imports the per-model pipeline.py module on first lookup, so a missed registration is impossible to hide in a scattered per-model file.

Preparatory work for PR 3/N (single-stage diffusion models), which will add 17 more pipeline entries. Keeping registrations centralized makes that addition one-line-per-model.

Motivation

Implements the registry centralization requested in @alex-jw-brooks's review comment on #2383:

"I think it may be easier to read if pipelines are explicitly declared in one place in the registry, rather than registered in their own pipeline files, otherwise it may be easy to miss if something isn't registered by mistake. vLLM also has some stuff like this too ..."

Resolves #2887 item 4.

Changes

  • New vllm_omni/config/pipeline_registry.py declares _OMNI_PIPELINES and _DIFFUSION_PIPELINES dicts of model_type -> (module_path, variable_name).
  • vllm_omni/config/stage_config.py: replaces the dict _PIPELINE_REGISTRY with _LazyPipelineRegistry; drops the now-redundant _discover_all_pipelines filesystem walk. register_pipeline() remains public for out-of-tree plugins and test fixtures, with dynamic registrations overriding the central entry.
  • 3 pipeline.py files (qwen2_5_omni, qwen3_omni, qwen3_tts): remove self-registration calls.
  • tests/config/test_pipeline_registry.py (new): covers central declarations, lazy loading, dynamic registration, and override semantics.
  • tests/test_config_factory.py::TestPipelineDiscovery: updated to the lazy-load API; removed the now-stale _discover_all_pipelines test.

Non-goals

  • No new pipelines added (3/N).
  • No change to PipelineConfig / StagePipelineConfig schema.
  • No change to deploy YAML format.

Test plan

  • pre-commit run --all-files passes
  • pytest tests/config/test_pipeline_registry.py -v
  • pytest tests/test_config_factory.py -v
  • CI green (function test, perf test, omni stage tests)

cc @alex-jw-brooks

… in pipeline.py

Moves pipeline declarations to vllm_omni/config/pipeline_registry.py (one
dict per category, keyed by model_type -> (module, var)), mirroring vLLM's
models/registry.py. _PIPELINE_REGISTRY is now a lazy proxy that imports the
module on first lookup, so a missed registration is impossible to hide in a
per-model pipeline.py.

- New: vllm_omni/config/pipeline_registry.py (_OMNI_PIPELINES,
  _DIFFUSION_PIPELINES, union _VLLM_OMNI_PIPELINES)
- stage_config: replace dict _PIPELINE_REGISTRY with _LazyPipelineRegistry;
  drop the now-unnecessary _discover_all_pipelines walk.
- qwen2_5_omni / qwen3_omni / qwen3_tts pipeline.py: remove
  register_pipeline() self-calls; pipelines are declared centrally now.
- register_pipeline() kept public for plugins/tests; dynamic registrations
  override the central entry.

Addresses vllm-project#2887 item 4 and vllm-project#2383 (comment).
Preparatory work for #3/N (17 single-stage diffusion models).

Signed-off-by: lishunyang <lishunyang12@163.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@lishunyang12 lishunyang12 changed the title [Refactor 2.5/N] Centralize pipeline registry (pre-work for diffusion 3/N) [Refactor 2.5/N] Centralize pipeline registry Apr 19, 2026
@lishunyang12 lishunyang12 changed the title [Refactor 2.5/N] Centralize pipeline registry [Config Refactor 2.5/N] Centralize pipeline registry Apr 19, 2026
@hsliuustc0106 hsliuustc0106 added the ready label to trigger buildkite CI label Apr 19, 2026
@lishunyang12 lishunyang12 added merge-test label to trigger buildkite merge test CI and removed ready label to trigger buildkite CI labels Apr 19, 2026
Copy link
Copy Markdown
Collaborator

@hsliuustc0106 hsliuustc0106 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

lishunyang12 and others added 4 commits April 19, 2026 22:16
…iction

Restores the ``del _PIPELINE_REGISTRY[model_type]`` API that the old
plain-dict registry supported. Deleting a dynamically-registered entry
(added via register_pipeline) removes it from the cache; deleting a
central-registry-declared model_type raises KeyError with a hint pointing
at pipeline_registry.py.

Fixes tests/test_config_factory.py::TestPipelineRegistry::test_register_and_lookup.

Signed-off-by: lishunyang <lishunyang12@163.com>
…inheritance test with overlay

build_stage_runtime_overrides: ``model``, ``stage_id``, ``log_stats`` and
``stage_configs_path`` are all in SHARED_FIELDS — they are set uniformly
by the orchestrator, not per-stage. Previously internal_blacklist_keys()
subtracted SHARED_FIELDS from orchestrator_field_names(), so these keys
leaked into a stage's runtime_overrides dict (e.g. a user passing
--model foo made every stage see {"model": "foo"} as a per-stage override).
Fix: default internal_keys to `internal_blacklist_keys() | SHARED_FIELDS`.
Fixes tests/test_config_factory.py ::test_cli_override_excludes_internal_keys,
::test_per_stage_override_excludes_internal_keys,
::test_build_stage_runtime_overrides_ignores_other_stage_and_internal_keys.

test_ci_inherits_from_main: CI overlay
(tests/utils._CI_OVERLAYS["qwen3_omni_moe"]) now explicitly sets
async_chunk: False (added in vllm-project#2383 fix #53) to override the base yaml.
Update the assertion to match current behaviour and document why.

Signed-off-by: lishunyang <lishunyang12@163.com>
…t-filter test

This test overrides ``internal_keys`` explicitly instead of relying on the
default (which now merges SHARED_FIELDS). When caller supplies their own
filter set they opt out of the default protection, so the test data's
``stage_0_model`` wasn't being filtered. Match the default behaviour by
passing the same union so the assertion "model not in overrides" holds.

Signed-off-by: lishunyang <lishunyang12@163.com>
@lishunyang12
Copy link
Copy Markdown
Collaborator Author

lishunyang12 commented Apr 19, 2026

lgtm

I need to fix some pytests as some of them invoke pre-existing bugs from previsou prs.

@lishunyang12
Copy link
Copy Markdown
Collaborator Author

lgtm

I need to fix some pytests as some of them invoke pre-existing bugs from previsou prs.

Solved now.

Signed-off-by: lishunyang <lishunyang12@163.com>
@lishunyang12 lishunyang12 merged commit cd384d9 into vllm-project:main Apr 19, 2026
6 checks passed
lvliang-intel pushed a commit to lvliang-intel/vllm-omni that referenced this pull request Apr 20, 2026
Signed-off-by: lishunyang <lishunyang12@163.com>
qinganrice pushed a commit to qinganrice/vllm-omni that referenced this pull request Apr 23, 2026
Signed-off-by: lishunyang <lishunyang12@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-test label to trigger buildkite merge test CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Follow-up] Deploy/pipeline config follow-ups from #2383

2 participants