Skip to content

Studio tests: fix two tests left stale by refactors (cuDNN strided hook, H3-Image LoRA reload message) - #18583

Merged
danielhanchen merged 2 commits into
mainfrom
fix-recheck-cudnn-pin-test
Nov 20, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
fix-recheck-cudnn-pin-test

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

test_attention_hook_installs_on_cudnn_pins (#18083) read the source of _apply_attention_backend and looked for the literal if 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 with ValueError: substring not found before 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_backend on 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_cudnn pin 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 the install_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_math pin 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_image also fails on main: #18420 reworded the reload error to the shared LORA_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.

…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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T07:15:15.701622Z a327d4e 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.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: a409ecde39

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

@danielhanchen danielhanchen changed the title Studio tests: check the Qwen-Image-2.1 strided cuDNN hook by running the backend apply Studio tests: fix two tests left stale by refactors (cuDNN strided hook, H3-Image LoRA reload message) Nov 20, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: a327d4e4b8

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

@danielhanchen
danielhanchen merged commit bcf37df into main Nov 20, 2026
@danielhanchen
danielhanchen deleted the fix-recheck-cudnn-pin-test branch November 20, 2026 07:59
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.

1 participant