Skip to content

feat: add RegionE support for Qwen-Image-Edit. - #2250

Open
BurnWan wants to merge 3 commits into
xLLM-AI:mainfrom
BurnWan:feat/regione
Open

feat: add RegionE support for Qwen-Image-Edit.#2250
BurnWan wants to merge 3 commits into
xLLM-AI:mainfrom
BurnWan:feat/regione

Conversation

@BurnWan

@BurnWan BurnWan commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds RegionE support for Qwen-Image-Edit Plus and integrates it with the DiT cache framework.

Main changes include:

  • Add RegionE-aware denoising flow in /export/home/wanben.burn/xllm/xllm/models/dit/pipelines/pipeline_qwenimage_edit_plus.h.

    • Prepare RegionE inference state before the denoising loop.
    • Build per-step RegionE plans and inputs.
    • Support partial latent execution, cached velocity reuse, direct unedited-region updates, and scatter/reduce back to full latents.
    • Preserve the original scheduler path when RegionE is disabled.
  • Add RegionE-aware transformer behavior in /export/home/wanben.burn/xllm/xllm/models/dit/transformers/transformer_qwen_image.h.

    • Disable DiT SP communication overlap for RegionE.
    • Process RegionE image K/V cache inside double-stream attention.
    • Adjust image RoPE for partial-query/full-KV attention layouts.
    • Add RegionE block-level state setup and image KV prefetching.

These changes are needed because RegionE changes the execution granularity from full-image latent updates to region-aware/partial latent updates, which requires coordination between the pipeline scheduler loop, transformer attention, KV cache handling, RoPE alignment, and sequence-parallel synchronization.

Related Issues

N/A

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor
  • Documentation
  • Test
  • Build or CI

Pull Request Checklist

Thank you for contributing to xLLM. Before requesting review, please make sure the following items are complete.

PR Title and Commit Messages

  • The PR title and each commit message follow the xLLM commit format: <type>: <subject>.

Allowed types: feat, bugfix, docs, test, refactor, chore, style, revert, perf, model, build, release.
The subject should use clear English, start with a verb, include at least 4 words, and end with ..

Pre-commit Checks

  • I have installed pre-commit by running pip install pre-commit or an equivalent command.
  • I have installed the hooks with pre-commit install.
  • I have run pre-commit run --all-files and fixed any reported issues.

If you are unsure how to set up pre-commit, see the pre-commit documentation.

Self Review

  • I have self-reviewed the code according to .agents/skills/code-review/references/custom-code-style.md, especially code written or assisted by AI.
  • I have rebased this PR onto the latest main branch.

Build and Test Coverage

  • Tests have been added or updated as needed.
  • CUDA: python setup.py build test has passed on a CUDA machine.
  • NPU: python setup.py build test has passed on an NPU machine.
  • MLU: python setup.py build test has passed on an MLU machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants