Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Qwen-Image-2.1's native BF16 attention becomes a bottleneck at large image sizes on Radeon 8060S. With Q4_K_M and Auto memory at 1536x1536, the measured slowdown remains even when the transformer is resident. Splitting independent query rows reduces the attention runtime while retaining every key and value.
Fix
Install a pipeline-local Qwen-Image-2.1 processor that dispatches eligible queries in 512-row chunks. Enable it automatically only on the measured gfx1151 architecture, for native unmasked BF16 inference with at least 8192 query tokens and the model's 32-head/4096-wide attention layout.
Keep the stock processor for prefill, masks, smaller requests, other attention backends, parallel execution, gradients and compilation. Reuse Diffusers' QKV/cache preparation and output projections. Speed Off disables installation; UNSLOTH_QWEN_IMAGE_ROCM_QUERY_CHUNKING=0 opts out, and =1 allows explicit testing on other ROCm GPUs.
Tests
Live A/B against main at 4700dbc on Radeon 8060S (gfx1151), PyTorch 2.11 / ROCm 7.13, Qwen-Image-2.1 Q4_K_M, Auto memory, seed 42 and guidance 1.0. The planner sees 20 GiB total and 19 GiB free, with a 19 GiB PyTorch allocation cap. Both attention variants were tested without the encoder fix.
Both OS jobs pass. All 16 attention comparisons are pixel-identical, including the 40-step images and image-conditioned outputs. At 1024x1024, both operating systems make zero chunking calls and preserve all three images and warm runtime. Peak GPU allocation is unchanged. The 40-step median decode step falls from 48.99 to 12.38 seconds on Windows and from 16.95 to 10.59 seconds on Linux; the unmodified first step stays around 45 and 20 seconds respectively.
The original 292 related tests passed; after the log clarification, all 174 processor/speed tests pass again. Coverage includes full-key/value chunk boundaries, cached-prefix and projection parity, backend selection, device/runtime guards and local installation. Formatting and diff checks pass. Post-A/B changes are limited to the load-log wording; attention computation is unchanged.
Live A/B run, both OS jobs passed
Scope
The automatic path is limited to gfx1151. RX 7900 XT and other ROCm architectures remain untested. The hardware probes in the run artifacts report shared-memory GPUs and 124.95 GiB of host RAM on Linux / 127.15 GiB on Windows, so the allocation cap does not emulate a discrete GPU's transfer costs. This does not change Auto placement, the Windows encoder fallback or cold MIOpen/VAE initialization. The processor uses helpers from Studio's pinned Diffusers version.