[Diffusion][Feature] CFG parallel support for Qwen-Image#444
[Diffusion][Feature] CFG parallel support for Qwen-Image#444hsliuustc0106 merged 15 commits intovllm-project:mainfrom
Conversation
|
looking forward to it |
|
do we expect it to be merged before 1230 release? @wtomin |
I think so. I will get it done today. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
any progress or comment @gcanlin @ZJY0516 @wtomin @SamitHuang |
gcanlin
left a comment
There was a problem hiding this comment.
Would CGF parallel perform better than USP? If roughly the same, I’d prefer to move this to the next release to ensure the quality of 0.12.0.
They are orthogonal |
9107039 to
b96d386
Compare
|
@hsliuustc0106 The current branch is compatible with tea_cache. |
|
fix precommit please |
|
@ZJY0516 PTAL final check |
|
Also work on NPU. Thanks! And it achieved the expected speedup.
|
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
Signed-off-by: Didan Deng <[email protected]>
|
@wtomin lack of parameter passing in online serving scenarios, please add |
…t#444) Signed-off-by: Didan Deng <[email protected]>
…t#444) Signed-off-by: Didan Deng <[email protected]>
…t#444) Signed-off-by: Didan Deng <[email protected]>
…t#444) Signed-off-by: Didan Deng <[email protected]>
PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED.
Purpose
This PR aims to support CFG-Parallel for Qwen-Image series of models. CFG-parallel runs the positive/negative prompts of classifier-free guidance (CFG) on different devices, then merges on a single device to perform the scheduler step. It includes:
Edits the pipelines: split the positive/negative prompts in
diffusefunction, and merge the predicted noise before scheduler step.pipeline_qwen_image.py
pipeline_qwen_image_edit.py
pipeline_qwen_image_edit_plus.py
pipeline_qwen_image_layered.py
Edits the
image_edit.pyandtext_to_image.pyto supportcfg_parallel_sizeargument.Update documents.
Test Plan
python examples/offline_inference/text_to_image/text_to_image.py --cfg_parallel_size 2python examples/offline_inference/text_to_image/text_to_image.py --cfg_parallel_size 2 --cache_backend tea_cachepython examples/offline_inference/image_to_image/image_edit.py --model "Qwen/Qwen-Image-Edit" --image ./qwen_image_output.png --prompt "turn this coffee cup to a glass of wine'" --output output_image_edit.png --num_inference_steps 50 --cfg_scale 4.0 --cfg_parallel_size 2python examples/offline_inference/image_to_image/image_edit.py --model "Qwen/Qwen-Image-Edit" --image ./qwen_image_output.png --prompt "turn this coffee cup to a glass of wine'" --output output_image_edit.png --num_inference_steps 50 --cfg_scale 4.0 --cache_backend tea_cache --cfg_parallel_size 2python examples/offline_inference/image_to_image/image_edit.py --model "Qwen/Qwen-Image-Edit-2509" --image ./qwen_image_output.png --prompt "turn this coffee cup to a glass of wine'" --output output_image_edit.png --num_inference_steps 50 --cfg_scale 4.0 --cfg_parallel_size 2python examples/offline_inference/image_to_image/image_edit.py --model "Qwen/Qwen-Image-Layered" --image ./qwen_image_output.png --prompt "turn this coffee cup to a glass of wine'" --output output_image_edit.png --num_inference_steps 50 --cfg_scale 4.0 --layers 2 --color-format "RGBA" --output "layered" --cfg_parallel_size 2Test Result
Qwen/Qwen-ImageQwen/Qwen-ImageQwen/Qwen-Image-EditQwen/Qwen-Image-EditQwen/Qwen-Image-Edit-2509Qwen/Qwen-Image-Edit-2509Qwen/Qwen-Image-LayeredQwen/Qwen-Image-LayeredQwen/Qwen-ImageQwen/Qwen-ImageQwen/Qwen-Image-EditQwen/Qwen-Image-EditSetting:
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.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)