Repository navigation
Conversation
8 tasks done
Collaborator
Author
|
Consolidated into #36680 as requested. The full text-QKV commit and its tests are now preserved there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Qwen-Image projects the short text stream with three separate tensor-parallel Q/K/V GEMMs in every transformer block. vLLM-Omni uses one merged QKV projection. A torch-profiler comparison on 2x H200 showed that merging only the short text branch removes two small split-K launches per block without exposing the large image stream to packed-view materialization costs.
This PR is intentionally separate from the bitwise attention packing optimization because a merged BF16 GEMM changes reduction association.
Modifications
MergedColumnParallelLinearfor the unquantized Qwen-Image added/text QKV projection.add_q_proj,add_k_proj, andadd_v_projweights in Q/K/V order.Accuracy Tests
Validated on the latest main used for this PR (
b647ae8) and 2x NVIDIA H200:python3 test/registered/unit/models/test_qwen_image_fused_qkv.py: 3 passed.This remains a Draft so maintainers can decide whether that BF16 numerical delta is acceptable for the default speed path.
Speed Tests and Profiling
Environment: 2x H200, TP=2, Qwen/Qwen-Image-2512, 1024x1024, 50 steps, guidance=1, BCG enabled, torch.compile disabled. The incremental A/B used the same CustomAllReduceV2 stack on both sides.
Checklist
Background benchmark investigation: BBuf/how-to-optim-algorithm-in-cuda#21
CI States
Latest PR Test (Base): ❌ Run #33069116662
Latest PR Test (Extra): ❌ Run #33069116477
Latest PR Test (AMD ROCm 7.2): ❌ Run #33069116717