Repository navigation
[Diffusion][Perf] Add Qwen-Image QK RoPE Triton path - #5931
Conversation
Add a Qwen-Image specific wrapper for Q/K RMSNorm followed by interleaved RoPE in QwenImageCrossAttention. The model now calls the wrapper directly and leaves platform, dtype, shape, CustomOp dispatch, and fallback handling inside the fused-op module. Add focused correctness coverage for standalone Q/K tensors and Q/K views split from packed QKV, plus a microbenchmark for the fused Q/K operator path. Signed-off-by: dongbo910220 <1275604947@qq.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Omni ReviewBot: no human activity for 29 days@dongbo910220 this pull request has had no human commit, comment or review since 2026-08-10. Per repository policy it may be closed if it stays inactive. To keep it moving, any one of these is enough: push an update, reply to the open blocker, or post the current plan and timeline. |
Signed-off-by: dongbo910220 <1275604947@qq.com>
|
Thanks for the PR. I verified the kernel on an L20 (torch 2.11, Triton 3.6, head A few findings: 1. Constexpr strides → ~220 ms recompile per new seq_len — All Q/K/out strides are 2. Third fused RMSNorm+RoPE implementation — Base main already has 3. Bitwise-identical to 4. Unrelated header rewrite — The "vLLM project" → "vLLM-Omni project" copyright flip is unrelated to the change; please revert. Minor: the PR description's test command lists |
Signed-off-by: dongbo910220 <1275604947@qq.com>
Signed-off-by: dongbo910220 <1275604947@qq.com>
|
Thanks @Dong1017 for the detailed review and the L20 validation. I addressed the findings in
The focused local suites and the latest-main NVIDIA RTX PRO 6000 suites all passed. At |
|
Follow-up on the verification above: I ran the full test suites on an L20 (torch 2.13+cu130, Triton 3.6, head
Update after the two fix commits ( LGTM 🚀 |
Signed-off-by: dongbo910220 <1275604947@qq.com>
|
@dongbo910220 CI failed, PTAL |
Signed-off-by: dongbo910220 <1275604947@qq.com>
|
Thanks @princepride. I investigated all three failed Buildkite checks and found no failure attributable to this PR: CUDA: only I merged the latest upstream |
Keep vllm-project#5931 fused QK-RoPE. Eager CUDA fallback uses RotaryEmbedding like other devices. Tests keep a local FP32 reference for the fused kernel. Signed-off-by: NumberWan <wantszkin2003@gmail.com>
…into one main (vllm-project#5931/vllm-project#7513) already fuses Q/K RMSNorm + RoPE per stream and then concatenates text and image into the joint sequence. Replace the two launches and the three cats with a single fused_joint_qkv_norm_rope call that writes the joint [B, S_txt+S_img, H, D] Q/K/V attention consumes, with no intermediate copies. The table carries the same fp32 coefficients the per-stream path builds, so the joint launch is bitwise equal to it. Any sequence parallelism keeps the per-stream chain: vid_freqs is sharded while txt_freqs is not. Signed-off-by: HuangYuwei <yuweih205@gmail.com>
…into one main (vllm-project#5931/vllm-project#7513) already fuses Q/K RMSNorm + RoPE per stream and then concatenates text and image into the joint sequence. Replace the two launches and the three cats with a single fused_joint_qkv_norm_rope call that writes the joint [B, S_txt+S_img, H, D] Q/K/V attention consumes, with no intermediate copies. The table carries the same fp32 coefficients the per-stream path builds, so the joint launch is bitwise equal to it. Any sequence parallelism keeps the per-stream chain: vid_freqs is sharded while txt_freqs is not. Signed-off-by: HuangYuwei <yuweih205@gmail.com>
Signed-off-by: dongbo910220 <1275604947@qq.com> Signed-off-by: Matthieu Laneuville <matthieu.laneuville@surf.nl>
Signed-off-by: dongbo910220 <1275604947@qq.com>
Purpose
This PR adds a Qwen-Image specific CUDA fast path for Q/K RMSNorm + RoPE.
In
QwenImageCrossAttention, query/key currently go through RMSNorm and Qwen-Image interleaved RoPE as separate operations. This PR fuses that path into a Triton-backed custom op while keeping the existing implementation fortorch.compileand unsupported inputs.Correctness
Result:
Performance Methodology
mainOperator Benchmark
Packed-QKV-derived view:
E2E Benchmark
Qwen-Image, 50 steps:
--enforce-eagertorch.compile