[BugFix] Fix modulate_index shape error in Qwen-Image-Edit Task#1100
[BugFix] Fix modulate_index shape error in Qwen-Image-Edit Task#1100ZJY0516 merged 87 commits intovllm-project:mainfrom
Conversation
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
… to support cp_plan Signed-off-by: mxuax <[email protected]>
…paration in a block Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Removed context parallelism plan and related comments. Signed-off-by: XU Mingshi <[email protected]>
Signed-off-by: XU Mingshi <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: XU Mingshi <[email protected]>
…llustration Signed-off-by: mxuax <[email protected]>
…e lengths - Add sp_attention_mask, sp_padding_size, sp_original_seq_len to ForwardContext - Add auto_pad option to SequenceParallelInput - Implement _shard_with_auto_pad in SequenceParallelSplitHook - Update SequenceParallelGatherHook to remove padding - Update QwenImage _sp_plan with auto_pad=True - Update QwenImageCrossAttention to use sp_attention_mask Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
… code, add some comment Signed-off-by: mxuax <[email protected]>
…struction Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: mxuax <[email protected]>
Signed-off-by: XU Mingshi <[email protected]>
Signed-off-by: XU Mingshi <[email protected]>
💡 Codex Reviewvllm-omni/vllm_omni/diffusion/attention/backends/flash_attn.py Lines 26 to 30 in 05a1d17 Raising ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
This BugFix is ready. @ZJY0516 @hsliuustc0106 |
|
please add the benchmark results from benchmark/diffusion folder |
There was a problem hiding this comment.
Pull request overview
This PR fixes a shape mismatch error in the Qwen-Image-Edit task when using sequence parallelism (USP=2 or higher). The bug occurred because the modulate_index tensor was not being sharded correctly when zero_cond_t is enabled in image editing models.
Changes:
- Introduced
ModulateIndexPreparemodule to encapsulatemodulate_indexcreation logic and enable proper sequence parallel sharding - Updated
_sp_planconfiguration to shard themodulate_indexoutput - Refactored the forward method to use the new module instead of inline tensor creation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I think this is what we need to catch in CI |
gcanlin
left a comment
There was a problem hiding this comment.
LGTM. It works on NPU as well.
This PR fixes the bug for edit, but the benchmark is for t2i. Thus, I think it won't influence the result. |
…-project#1100) Signed-off-by: mxuax <[email protected]> Signed-off-by: XU Mingshi <[email protected]> Co-authored-by: Hongsheng Liu <[email protected]>
PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED.
This PR fixes issue #1094.
Purpose
Fix modulate_index shape error in Qwen-Image-Edit Task
This bug is due to zero_cond_t being true when editing, and the current sp_plan does not include the sharding for the variable modulate_index created. I added a new submodule to handle this
Test Plan
Command:
CUDA_VISIBLE_DEVICES=0,1,2,3 python examples/offline_inference/image_to_image/image_edit.py --model "Qwen/Qwen-Image-Edit-2511" --image input.png --prompt "Add a sunset sky background" --output output_u2r2.png --ulysses_degree 2 --ring_degree 2 --enforce_eager --num_inference_steps 20input image:

Test Result
Success with the right image.

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)