Repository navigation
Studio Krea 2: detect ROCm by its version tag in the prefix flash pick - #19230
Merged
Merged
Conversation
#19208) The mask-free prefix call's flash pick from #19208 treated a build as CUDA when torch.version.hip was None. AMD SDK / Radeon ROCm wheels leave it unset and carry the tag in torch.__version__, so they could take the CUDA flash pick, and test_no_diffusion_or_video_gate_reads_version_hip_directly fails on main. Use core.inference.rocm_bf16.is_rocm_torch, as every other diffusion gate does, and pin both ROCm spellings.
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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: Didn't find any major issues. Chef's kiss. 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.
Problem
studio/backend/tests/test_diffusion_rocm_tag_detect.py::test_no_diffusion_or_video_gate_reads_version_hip_directlyfails on main in the backend(Python 3.13, diffusion)shard, so open PRs such as #19154 inherit it:Cause
#19208 (Krea 2 valid key prefix without a mask) added a gate that can swap auto's cuDNN pin for CUDA native flash on the mask-free prefix call. It decided "not ROCm" with
getattr(torch.version, "hip", None) is None. AMD SDK / Radeon ROCm wheels leavetorch.version.hipunset and carry the tag intorch.__version__instead. On those builds, the gate could treat a ROCm card as CUDA and force the CUDA flash backend.The guard is right and this is a real bug in the new gate, not a stale test.
Fix
core.inference.rocm_bf16.is_rocm_torch(torch), like every other diffusion and video gate.test_a_rocm_build_keeps_the_pinchecks that a ROCm build keeps the pin for both spellings:torch.version.hipset, and only a+rocmtag intorch.__version__.Verification
test_diffusion_rocm_tag_detect.pyandtest_diffusion_krea2_prefix_kv.py: 32 passed.diffusion_krea2_prefix_kv.pywith this branch's tests fails both the guard andtest_a_rocm_build_keeps_the_pin[None-2.9.0+rocm7.1]. Theversion.hipcase passes on both, because main already handled it.I could not run this on real ROCm hardware. The check is the version-tag detection, simulated by patching
torch.__version__.