Skip to content

[Diffusion]: Diffusion Ring Attention support #273

Merged
hsliuustc0106 merged 33 commits into
vllm-project:mainfrom
mxuax:usp
Dec 31, 2025
Merged

[Diffusion]: Diffusion Ring Attention support #273
hsliuustc0106 merged 33 commits into
vllm-project:mainfrom
mxuax:usp

Conversation

@mxuax
Copy link
Copy Markdown
Contributor

@mxuax mxuax commented Dec 11, 2025

This PR follows Diffusion Ulysses-Sequence-Parallelism support PR#189, allowing users to set Ring Attention for diffusion model, e.g., qwen-image.

Purpose

  1. Create Ring Attention Module (vllm_omni/diffusion/ring_attn)

  2. Refactor Distributed State (vllm_omni/diffusion/distributed/parallel_state.py)

  3. Implement Ring Attention Logic (vllm_omni/diffusion/attention/layer.py)

  4. Modify the generic Attention layer to support Ring Attention and Hybrid (Ulysses + Ring) modes.

  5. Verification and Testing
    Create a new test file to verify the correctness of the Ring Attention implementation on the Qwen model components.


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, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (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)

@mxuax mxuax requested a review from hsliuustc0106 as a code owner December 11, 2025 04:01
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread vllm_omni/diffusion/attention/ring_pytorch_attn.py Outdated
Comment thread vllm_omni/diffusion/attention/ring_flash_attn.py Outdated
Copy link
Copy Markdown
Member

@ZJY0516 ZJY0516 left a comment

Choose a reason for hiding this comment

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

For better project structure, the ring_attn folder should be placed under the attention directory.

Comment thread vllm_omni/diffusion/attention/backends/ring/ring_globals.py
@SamitHuang
Copy link
Copy Markdown
Collaborator

cc @wtomin

Comment thread examples/offline_inference/image_to_image/image_edit.py Outdated
Comment thread examples/offline_inference/image_to_image/image_edit.py Outdated
Comment thread docs/user_guide/diffusion_acceleration.md
Comment thread tests/diffusion/attention/test_sequence_parallel.py
Comment thread vllm_omni/diffusion/attention/backends/ring_flash_attn.py
Comment thread vllm_omni/diffusion/distributed/ring_comm.py Outdated
Copy link
Copy Markdown
Member

@ZJY0516 ZJY0516 left a comment

Choose a reason for hiding this comment

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

please remove some debug lines

Comment thread vllm_omni/diffusion/attention/backends/ring/ring_globals.py Outdated
Comment thread vllm_omni/diffusion/attention/backends/ring/ring_globals.py
Comment thread vllm_omni/diffusion/attention/backends/ring/ring_kernels.py Outdated
Comment thread vllm_omni/diffusion/attention/backends/ring/ring_kernels.py Outdated
Comment thread vllm_omni/diffusion/attention/backends/ring/ring_kernels.py
Comment thread vllm_omni/diffusion/attention/layer.py
Comment thread vllm_omni/diffusion/attention/layer.py
- Implement ring-based P2P communication pattern
- Add ring_flash_attn backend
- Update documentation
- Add unit tests

Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
@mxuax mxuax requested a review from SamitHuang December 29, 2025 10:02
mxuax and others added 3 commits December 30, 2025 11:01
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
@mxuax mxuax requested review from ZJY0516 and wtomin December 30, 2025 03:37
@ZJY0516 ZJY0516 changed the title [Diffusion][WIP]: Diffusion Ring Attention support [Diffusion]: Diffusion Ring Attention support Dec 30, 2025
@ZJY0516 ZJY0516 added the ready label to trigger buildkite CI label Dec 30, 2025
Comment thread docs/user_guide/acceleration/parallelism_acceleration.md
Comment thread examples/offline_inference/image_to_image/image_edit.py Outdated
Comment thread vllm_omni/diffusion/attention/backends/ring/ring_globals.py
Comment thread vllm_omni/diffusion/attention/backends/ring/ring_kernels.py Outdated
Comment thread vllm_omni/diffusion/attention/backends/ring/ring_selector.py
Comment thread vllm_omni/diffusion/attention/backends/ring/ring_selector.py Outdated
Comment thread vllm_omni/diffusion/attention/backends/ring/ring_utils.py Outdated
Comment thread tests/diffusion/attention/test_sequence_parallel.py
mxuax and others added 19 commits December 30, 2025 16:27
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
…nication issue in ring

Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Comment thread .buildkite/pipeline.yml Outdated
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
@hsliuustc0106 hsliuustc0106 enabled auto-merge (squash) December 31, 2025 14:08
@hsliuustc0106 hsliuustc0106 merged commit 680742b into vllm-project:main Dec 31, 2025
6 of 7 checks passed
princepride pushed a commit to princepride/vllm-omni that referenced this pull request Jan 10, 2026
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Co-authored-by: Jiangyun Zhu <riverclouds.zhu@qq.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
ZJY0516 added a commit to LawJarp-A/vllm-omni that referenced this pull request Jan 10, 2026
Signed-off-by: mxuax <mxuax@connect.ust.hk>
Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Co-authored-by: Jiangyun Zhu <riverclouds.zhu@qq.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready label to trigger buildkite CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants