Repository navigation
Studio: extend the ROCm MIOpen cutoff and Qwen-Image-2.1 query chunking beyond gfx1151 - #320
Closed
danielhanchen wants to merge 1 commit into
Closed
danielhanchen wants to merge 1 commit into
danielhanchen wants to merge 1 commit into
Conversation
…ng beyond gfx1151
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. |
Owner
Author
|
@codex review |
1 similar comment
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
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.
Three recent AMD fixes for Qwen-Image-2.1 turn on automatically only on Strix Halo (gfx1151), because that was the only GPU they had been tested on. @LeoBorcherding has since tested all three on a discrete Radeon AI PRO R9700 (RDNA 4, gfx1201). Based on his results and upstream evidence, this PR enables two of them on more Radeon GPUs.
Each section gives the change, Leo's R9700 measurement, the reasoning for anything enabled beyond that measurement, and what stays excluded. His runs used Windows 11, PyTorch 2.11 / ROCm 7.13, and main at
364a42f0, with the existing environment overrides forcing each path on and off.MIOpen search cutoff (#12359)
Change.
MIOPEN_SEARCH_CUTOFF=1now defaults on when every visible GPU isgfx110*,gfx115*orgfx120*, instead of only gfx1151. Explicit environment values still win, including0.Measured. From the #12359 test, with empty MIOpen caches and one clean run per side:
=1Images differ by at most 2/255, consistent with the variation between stock runs.
Beyond the measurement. The rest of RDNA 3, 3.5 and 4 is included because the cause is not specific to one GPU. ROCm 7.13 ships no system find databases for any of them, so every first convolution search starts cold. AMD itself sets the cutoff for its cold diffusion benchmarks on Navi31, Navi48 and Strix Halo.
Excluded. Hosts with any other architecture keep MIOpen's default:
MIOPEN_NAIVE_DISABLE_IF_ALT, cost 18.8% throughput on MI355X.gfx12.The cutoff can discard the only applicable solver and fail a convolution. This risk already applies to the gfx1151 default, and
MIOPEN_SEARCH_CUTOFF=0opts out.Attention query chunking (#12335)
Change. Automatic 512-row query chunking now covers gfx1200 and gfx1201 as well as gfx1151. The shape and backend guards and the
UNSLOTH_QWEN_IMAGE_ROCM_QUERY_CHUNKINGoverrides are unchanged. The arch is now read with_props_gfx_arch, as the MIOpen and vision gates already do.Measured. From the #12335 test, four runs per side in alternating order:
Outputs differ by at most 17/255, against 2/255 between stock runs, so chunking changes the numerics slightly.
Beyond the measurement. gfx1200 is included because AOTriton 0.11.2b gives it gfx1201's tuning database and kernel pack, so it runs the same attention kernels.
Excluded. gfx1100, the other RDNA 3 and 3.5 GPUs, and CDNA stay opt-in until they are measured.
Vision eager attention (#12360)
Unchanged. In the #12360 test, native vision SDPA stayed finite on the R9700 with a 1024² reference, with the same speed and memory as eager attention.
Validation
All 237 tests across the MIOpen cutoff, query chunking, diffusion speed and vision attention suites pass. Gate coverage includes mixed hosts, excluded architectures and explicit overrides.
This commit was not run on AMD hardware. gfx1200, discrete RDNA 3 and Linux RDNA 4 remain untested.
Mirror of unslothai/unsloth#12471 by @oobabooga, opened for review only.
Do not merge here. Fixes agreed on this mirror must be applied to the source PR.
Source description digest at mirror time:
3e1040750f5b