Skip to content

[ConfigRefactor] GLM-Image#2977

Merged
hsliuustc0106 merged 11 commits intovllm-project:mainfrom
JaredforReal:config
Apr 22, 2026
Merged

[ConfigRefactor] GLM-Image#2977
hsliuustc0106 merged 11 commits intovllm-project:mainfrom
JaredforReal:config

Conversation

@JaredforReal
Copy link
Copy Markdown
Contributor

@JaredforReal JaredforReal commented Apr 21, 2026

Migrate GLM-Image to the new declarative config system (PipelineConfig + DeployConfig), fixing a broken two-stage pipeline where only the diffusion stage was loaded.

  1. Model type detection failure — GLM-Image is a diffusers-style repo with model_index.json at root but no config.json. _auto_detect_model_type() only checked for config.json, so it returned None and the system fell back to single-stage diffusion.
  2. async_chunk defaulted to True — The legacy deploy YAML didn't set async_chunk, and merge_pipeline_deploy would raise ValueError since no GLM-Image stage declares async-chunk processors.
  3. Legacy YAML format — The deploy YAML used the old nested engine_args:/runtime:/stage_type: format with topology fields that now belong in PipelineConfig.

Changes

  • PipelineConfig.diffusers_class_name — New field lets pipelines declare their diffusers _class_name. The model type detector now checks model_index.json and matches against registered pipelines, eliminating the need for a separate _DIFFUSERS_CLASS_TO_CONFIG mapping table.
  • StagePipelineConfig.model_subdir / tokenizer_subdir — Moved from deploy YAML to pipeline topology. These are structural properties (AR config lives in vision_language_encoder/), not deployment knobs. Injected into engine_args by _build_engine_args.
  • deploy/glm_image.yaml — Rewritten to the new flat format with async_chunk: false, containing only deployment knobs (GPU placement, memory, sampling params). All topology fields removed.
  • pipeline.py — Added diffusers_class_name, model_subdir, tokenizer_subdir, requires_multimodal_data, and model_arch on the diffusion stage.

Test plan

  • Online: vllm serve zai-org/GLM-Image --port 8000 --host 0.0.0.0 — verify both AR and diffusion stages initialize (check logs for model loading messages from both stages)
    Try override with --stage-overrides '{"0": {"gpu_memory_utilization": 0.65}}'
  • Offline: python examples/offline_inference/glm_image/end2end.py --model-path <path-to-GLM-Image> --prompt "A cat sitting on the table" --output cat.png --height 1024 --width 1024 --num-inference-steps 50 --enable-diffusion-pipeline-profiler

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan. Please provide the test scripts & test commands. Please state the reasons if your codes don't require additional test scripts. For test file guidelines, please check the test style doc
  • The test results. Please paste the results comparison before and after, or the e2e results.
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model. Please run mkdocs serve to sync the documentation editions to ./docs.
  • (Optional) Release notes update. If your change is user-facing, please update the release notes draft.

BEFORE SUBMITTING, PLEASE READ https://github.com/vllm-project/vllm-omni/blob/main/CONTRIBUTING.md (anything written below this line will be removed by GitHub Actions)

Signed-off-by: JaredforReal <w13431838023@gmail.com>
Signed-off-by: JaredforReal <w13431838023@gmail.com>
Copilot AI review requested due to automatic review settings April 21, 2026 06:47
@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
Copy link
Copy Markdown
Collaborator

Are there any doc that you need you update as well?

@JaredforReal JaredforReal changed the title [ConfigRefactor] GLM-Image [WIP][ConfigRefactor] GLM-Image Apr 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors GLM-Image configuration to the new “frozen pipeline topology + deploy YAML” split introduced by the config refactor work, and updates offline example entrypoints to reference the new deploy config location.

Changes:

  • Removed legacy stage_configs/glm_image*.yaml configs and introduced vllm_omni/deploy/glm_image.yaml.
  • Added a frozen GLM-Image PipelineConfig (model_executor/models/glm_image/pipeline.py) and registered it in pipeline_registry.py.
  • Updated offline inference examples to use the new deploy YAML path by default.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
vllm_omni/model_executor/stage_configs/glm_image_muilticonnector.yaml Removes legacy MultiConnector stage config YAML.
vllm_omni/model_executor/stage_configs/glm_image.yaml Removes legacy GLM-Image stage config YAML.
vllm_omni/model_executor/models/glm_image/pipeline.py Adds frozen two-stage GLM-Image pipeline topology.
vllm_omni/deploy/glm_image.yaml Adds deploy YAML for GLM-Image stages (resources + sampling defaults).
vllm_omni/config/pipeline_registry.py Registers the new glm_image pipeline for lazy loading.
examples/offline_inference/glm_image/run_t2i.sh Points default config to vllm_omni/deploy/glm_image.yaml.
examples/offline_inference/glm_image/run_i2i.sh Points default config to vllm_omni/deploy/glm_image.yaml.
examples/offline_inference/glm_image/end2end.py Updates default config path fallback to the deploy YAML.
examples/offline_inference/glm_image/README.md Updates config-path examples (but still has one lingering legacy path).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/offline_inference/glm_image/README.md Outdated
Comment thread vllm_omni/deploy/glm_image.yaml
Comment thread vllm_omni/deploy/glm_image.yaml Outdated
Comment thread vllm_omni/deploy/glm_image.yaml Outdated
final_output_type="image",
model_arch="GlmImagePipeline",
custom_process_input_func="vllm_omni.model_executor.stage_input_processors.glm_image.ar2diffusion",
omni_kv_config={"need_recv_cache": False},
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

omni_kv_config is set on this StagePipelineConfig, but it is currently never propagated into stage engine_args by merge_pipeline_deploy (and StagePipelineConfig.omni_kv_config is otherwise unused). Either move this into deploy YAML as omni_kv_config (stage engine extra) or update the merge logic to carry it into yaml_engine_args, otherwise this setting has no effect.

Suggested change
omni_kv_config={"need_recv_cache": False},

Copilot uses AI. Check for mistakes.
@lishunyang12
Copy link
Copy Markdown
Collaborator

#2072 Make sure that in 5 level use cases, configs can take affect on this model, especicially stage-config overrides.

Signed-off-by: JaredforReal <w13431838023@gmail.com>
…utils

Signed-off-by: JaredforReal <w13431838023@gmail.com>
@JaredforReal JaredforReal changed the title [WIP][ConfigRefactor] GLM-Image [ConfigRefactor] GLM-Image Apr 21, 2026
@JaredforReal
Copy link
Copy Markdown
Contributor Author

@lishunyang12 lishunyang12 added merge-test label to trigger buildkite merge test CI ready label to trigger buildkite CI labels Apr 21, 2026
@lishunyang12
Copy link
Copy Markdown
Collaborator

Test results have been shown offline. Waiting for CI green.

Signed-off-by: JaredforReal <w13431838023@gmail.com>
@lishunyang12
Copy link
Copy Markdown
Collaborator

PTAL @xiaohajiayou Can you help check if this pr has the override precedence issue you mentioned?

@hsliuustc0106
Copy link
Copy Markdown
Collaborator

resolve conflicts please

@hsliuustc0106
Copy link
Copy Markdown
Collaborator

@gcanlin please take care of pipeline yamls for different hardwares

@gcanlin
Copy link
Copy Markdown
Collaborator

gcanlin commented Apr 21, 2026

@gcanlin please take care of pipeline yamls for different hardwares

I'm verifying the models that we have supported. For GLM-Image, @lyj-jjj Could you please take a look?

@lyj-jjj
Copy link
Copy Markdown
Contributor

lyj-jjj commented Apr 21, 2026

@gcanlin Okay, tomorrow I will test on glm-image.

Signed-off-by: Jared Wen <w13431838023@gmail.com>
Signed-off-by: JaredforReal <w13431838023@gmail.com>
Signed-off-by: JaredforReal <w13431838023@gmail.com>
@lishunyang12 lishunyang12 added this to the v0.20.0 milestone Apr 22, 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

@hsliuustc0106
Copy link
Copy Markdown
Collaborator

one suggestion: please rm the glm-image folder under examples and update the glm-image recipe later

Signed-off-by: JaredforReal <w13431838023@gmail.com>
@JaredforReal
Copy link
Copy Markdown
Contributor Author

@hsliuustc0106 examples removed

@hsliuustc0106
Copy link
Copy Markdown
Collaborator

please remember to update the recipe

@hsliuustc0106 hsliuustc0106 merged commit 5542332 into vllm-project:main Apr 22, 2026
6 of 8 checks passed
qinganrice pushed a commit to qinganrice/vllm-omni that referenced this pull request Apr 23, 2026
Signed-off-by: JaredforReal <w13431838023@gmail.com>
Signed-off-by: Jared Wen <w13431838023@gmail.com>
Co-authored-by: SYLAR <125541396+lishunyang12@users.noreply.github.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 ready label to trigger buildkite CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants