Repository navigation
Studio tests: fix two tests left stale by refactors (cuDNN strided hook, H3-Image LoRA reload message) - #18583
Conversation
…the backend apply test_attention_hook_installs_on_cudnn_pins searched the source of _apply_attention_backend for the cuDNN branch, which moved into _apply_attention_backend_impl, so it failed with ValueError on main. It now runs the real apply on a fake DiT and asserts the strided install is called for a cuDNN pin on NVIDIA and not for other pins.
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 |
|
Codex Review: Didn't find any major issues. Breezy! 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 review |
|
Codex Review: Didn't find any major issues. Hooray! 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". |
test_attention_hook_installs_on_cudnn_pins(#18083) read the source of_apply_attention_backendand looked for the literalif backend == "_native_cudnn" and target is not None and _is_cuda_nvidia(target):line. #18418 moved that branch into_apply_attention_backend_impl, so on main the test fails withValueError: substring not foundbefore it checks anything. The production hook is still installed; only the test broke, and a test that greps source text would break again on the next refactor.Change
Test only (
tests/test_diffusion_qwenimage21_strided_attn.py). The test now runs the real_apply_attention_backendon a fake DiT, with the card checks stubbed (_is_cuda_nvidia,_cudnn_serves_pipe, kernel install, ROCm guards) and the Qwen-Image-2.1 and FLUX.3 strided installs replaced by recorders. No production code changes.Tests
test_attention_hook_installs_on_cudnn_pins: a_native_cudnnpin on an NVIDIA target engages, pins the DiT, and calls the Qwen-Image-2.1 strided install with(pipe, "_native_cudnn", target, logger). The old version fails on main (ValueError), the new one passes here. With theinstall_q21_strided(...)call removed from_apply_attention_backend_impl, the new test fails, so it still guards the hook.test_attention_hook_skips_other_pins(2 cases): a cuDNN pin on a non-NVIDIA target and a_native_mathpin on NVIDIA engage without calling either strided install.Suite (
test_diffusion_qwenimage21_strided_attn.py,test_diffusion_flux3_strided_attn.py,test_diffusion_int8_attention_auto.py,test_diffusion_int8_attention_dispatch.py,test_diffusion_int8_attention_persisted.py,test_diffusion_attention.py,test_diffusion_attention_honest_status.py,test_diffusion_attention_cudnn_head_dim.py): main 272 passed, 1 skipped, 1 failed (test_attention_hook_installs_on_cudnn_pins); this branch 275 passed, 1 skipped, 0 failed.Not proven here
No GPU run; none is needed for a test-only change. The new test fakes the card and the installs, so it shows the apply calls the hook, not that the strided processors run on a real NVIDIA card (the existing
gpu-marked tests in the same file cover that).Second stale test: MiniMax-H3-Image LoRA reload message
tests/test_diffusion_h3_image_trainer.py::test_backend_runs_only_the_load_time_lora_set_for_h3_imagealso fails on main: #18420 reworded the reload error to the sharedLORA_RELOAD_REMEDY("Reload the model with the LoRA selection: ..."), but the test still matched the old "Load the model again". The behaviour it checks is unchanged (a different LoRA set or weight on an H3-Image load is refused), so the test now matches the current message. The file goes from 1 failed, 20 passed on main to 21 passed here.