Skip to content

[diffusion] Fix test_qwen_added_qkv_lossless_uses_three_reference_gemms after #41272 - #41477

Closed
triple-mu wants to merge 2 commits into
sgl-project:mainfrom
triple-mu:fix/qwen-added-qkv-test-fake
Closed

triple-mu wants to merge 2 commits into
sgl-project:mainfrom
triple-mu:fix/qwen-added-qkv-test-fake

Conversation

@triple-mu

@triple-mu triple-mu commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

#41272 made the Qwen-Image lossless added-QKV split apply only when to_added_qkv is a MergedColumnParallelLinear (LoRA wrappers are called as they are). The fake _PackedAddedQKV in test_model_fast_paths.py::test_qwen_added_qkv_lossless_uses_three_reference_gemms is a plain nn.Module, so it now takes the packed path and the test fails with assert packed.calls == 0 (got 1) on main and on every PR's merge ref (seen on #41340 run 36333720101, jobs 108660581027 and 108667121455, two different H100 hosts). Because the JIT kernel job stops at the first failing file, the remaining kernel tests in that job do not run either.

Modifications

Test-only, the production LoRA guard and the assertions are unchanged:

  • _PackedAddedQKV subclasses MergedColumnParallelLinear (its __init__ is skipped: no parallel state is needed), so _split_unquantized_merged_linear runs on a genuine MergedColumnParallelLinear instance and the lossless test again asserts three reference GEMMs and zero packed calls.
  • New test_qwen_added_qkv_lossless_calls_a_wrapped_linear_as_is: a projection that is not a MergedColumnParallelLinear (a LoRA wrapper) is called once on the lossless path and its chunks are returned unchanged, which pins the behavior [diffusion] fix: LoRA-wrapped linears crash Qwen-Image and MiniMax-H3 inference #41272 introduced.

Accuracy Tests

pytest test/registered/kernels/ops/diffusion/test_model_fast_paths.py -k qwen_added_qkv passes locally on the main tree (RTX 3080 Ti, torch 2.9): 2 passed.

Checklist


CI States

Latest PR Test (Base): ❌ Run #36365430406
Latest PR Test (Extra): ❌ Run #36365430246
Latest PR Test (AMD ROCm 10): ❌ Run #36365430324

Since sgl-project#41272 the Qwen-Image lossless added-QKV split applies only when
to_added_qkv is a MergedColumnParallelLinear (LoRA wrappers are called as
they are), so the plain nn.Module fake in
test_qwen_added_qkv_lossless_uses_three_reference_gemms now takes the packed
path and the test fails on main and on every PR's merge ref. The fake
subclasses MergedColumnParallelLinear and skips its __init__, which needs no
parallel state here.
A projection that is not a MergedColumnParallelLinear (a LoRA wrapper) is
called as it is on the lossless path since sgl-project#41272; the packed fake exercises
the genuine split, the wrapped fake pins the call-through.
@triple-mu

Copy link
Copy Markdown
Contributor Author

Superseded: #41339 carried these two commits and was merged as 2e7e0802f4, so main now has the MergedColumnParallelLinear fake and the wrapped-linear test. Closing.

@triple-mu triple-mu closed this Sep 28, 2026
@triple-mu
triple-mu deleted the fix/qwen-added-qkv-test-fake branch September 29, 2026 10:34
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.

1 participant