Skip to content

Studio: avoid slow cold MIOpen searches on gfx1151 - #269

Closed
shimmyshimmer wants to merge 3 commits into
mainfrom
mirror-pr-12359
Closed

shimmyshimmer wants to merge 3 commits into
mainfrom
mirror-pr-12359

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Collaborator

Qwen-Image-2.1's first VAE decode can spend over 13 minutes benchmarking MIOpen convolution solvers on Radeon 8060S, while the next decode takes about two seconds. Cache isolation traced the delay to solver search: retaining the solver database removes it, but retaining only compiled kernels does not.

Fix

Set MIOPEN_SEARCH_CUTOFF=1 during Studio's existing lazy ROCm hardware detection, before model convolutions. MIOpen can skip excessively slow search candidates while retaining its naive fallback solver.

Enable the default only when every visible Torch GPU reports gfx1151. Preserve explicit environment values, including 0; mixed, unknown and other architectures keep their existing defaults. Users on other ROCm GPUs can opt in with the same environment variable. The setting is process-wide and inherited by workers.

Tests

Live A/B against main at 4e8503e437 on Radeon 8060S / gfx1151, Windows and Linux, PyTorch 2.11 / ROCm 7.13. Each OS runs stock and the actual patch on the same runner with separate empty MIOpen caches. Qwen-Image-2.1 Q4_K_M, Auto memory, 1024x1024, 40 steps, two prompts, seed 42, guidance 1.0 and a 19 GiB Torch allocation cap.

First generation Main This PR
Linux VAE decode 800.30 s 19.94 s
Windows VAE decode 939.37 s 23.86 s
Linux full generation 978.47 s 193.40 s
Windows full generation 1249.08 s 239.14 s

All four paired images and decoder input tensors are bit-identical. Cold peak Torch GPU allocation stays 14.92 GiB; warm decode stays around 1.5-2 seconds. The probes confirm that startup sets the flag automatically, with no external override in the patched cases. Load/download time is excluded. Denoiser timing also varied, so the VAE phase is the direct measure of this fix.

Live actual-patch A/B

Separate solver validation passed 468 CPU-reference forward/gradient comparisons across FP32, FP16, BF16, grouped/depthwise/pointwise/3D convolutions and multiple layouts. Solver validation

Rebased onto main at b1c522a4ea; 308 related hardware and startup tests passed, 36 skipped. The live A/B above was run on the stated earlier base and was not repeated after this rebase. Coverage includes explicit overrides, mixed and unknown architectures, probe failures, ROCm SDK version detection, CUDA exclusion and lazy startup. Ruff, formatting and diff checks passed.

Scope

Test hardware is Radeon 8060S / gfx1151 with shared memory. The allocation cap does not emulate a discrete GPU's transfer costs. RX 7900 XT remains untested. This changes cold solver-search behavior, not Auto placement, model-weight memory use or vision-attention correctness.


Mirror of unslothai/unsloth#12359 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: 9cefc9690826

@danielhanchen

Copy link
Copy Markdown
Owner

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T09:15:51.322008Z bbfd543 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: bbfd543d65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

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.

3 participants