Repository navigation
Studio INT8 attention: read ROCm through is_rocm_torch, skip the dispatch fixture without diffusers - #17737
Merged
Conversation
…atch fixture without diffusers
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. |
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
danielhanchen
added a commit
that referenced
this pull request
Nov 14, 2026
…nt the diffusion shard (#17736) ## Summary Follow-up to #17723, which moved `test_diffusion*` into its own `(Python 3.13, diffusion)` backend shard. Two things went red once that shard ran (seen on a staging run against current main): 1. `Repo tests (CPU, studio)` and `workflow-trigger lint`: ``` tests/studio/test_backend_ci_parallel_isolation.py::test_the_command_scan_sees_the_parallel_run_and_the_serial_steps AssertionError: expected fourteen parallel pytest runs, four shards of the backend matrix and ten of repo-cpu-tests ... assert 15 == 14 ``` That test pins the number of parallel pytest runs on purpose, so a new shard has to be stated there. #17723 updated `test_ci_backend_pytest_shards.py` but missed this one. My mistake. 2. `(Python 3.13, diffusion)`: five tests in `studio/backend/tests/test_diffusion_lm_studio.py` fail with `PackageNotFoundError: No package metadata was found for unsloth_zoo`: - `test_frame_relay_throttles_and_never_raises_into_the_sampler` - `test_frame_relay_sends_zero_based_steps_and_honours_stop_sequences` - `test_frame_relay_cuts_frames_at_the_first_eos` - `test_diffusion_eos_ids_match_the_sampler_cut` - `test_chat_diffusion_load_refuses_an_unmarked_model_and_keeps_the_token_boundary` They import `core.inference.inference`, which imports `unsloth`, and the backend job installs neither `unsloth_zoo` nor `trl`. They only passed in the old a-f shard because an earlier file on the same worker (`test_audio_chat_load.py`, `test_chat_prompt_bos.py`) had already imported that module with its own `unsloth` stubs and left it cached. In a shard of only `test_diffusion*` files that never happens. So these tests have depended on xdist scheduling since #13593; the split only made it deterministic. ## Change - `tests/studio/test_backend_ci_parallel_isolation.py`: 15 parallel runs, 5 backend shards. - `studio/backend/tests/test_diffusion_lm_studio.py`: a small `inference_mod` fixture the five tests now take. - When `unsloth_zoo` is installed, or the module is already imported, it returns the real module. Nothing changes there. - Otherwise it stubs `unsloth` and `unsloth.chat_templates` (the same two names the other backend tests stub) through `monkeypatch`, and also drops the freshly imported `core.inference.inference`. So no later test inherits a module bound to these stubs. - The tests keep running in the backend job instead of being skipped there. ## Testing - Locally, with `diffusers`, `unsloth_zoo` and `trl` hidden from import (the backend job's environment): `test_diffusion_lm_studio.py`, `test_diffusion_int8_attention.py` and `test_diffusion_rocm_tag_detect.py` on their own. The five tests fail on main with the same error and pass here. They also pass with the real packages installed. - The same files in one process, before and after `test_audio_chat_load.py` and `test_chat_prompt_bos.py`: 78 passed, 33 skipped in both orders. - Every test that reads `studio-backend-ci.yml` (15 files): 341 passed, 3 skipped. The isolation test fails on main. - `test_backend_tests_stub_heavy_imports.py` and `test_sibling_imported_tests_import_their_helpers_top_level.py`: pass. The other failures on the new shard come from #17718 and are fixed in #17737.
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.
Summary
Two failures from #17718 (INT8 attention kernel for diffusion DiTs) that show up in the backend CPU job, now that
test_diffusion*runs in its own shard:prefetch_fix()indiffusion_int8_attention_triton.pydecides "NVIDIA build of torch" withtorch.version.hip is None. AMD SDK / Radeon wheels leavetorch.version.hipunset and only carryrocmintorch.__version__, so on those builds the NVIDIA sm_8x prefetch patch would be installed on an AMD device. The guard is right and the read is a real bug.diffusion_int8_attention.pyalready usesis_rocm_torch; the Triton module now does too._active_backendfixture importsdiffusers.models.attention_dispatchdirectly. The test bodies already skip without diffusers through_h3(), but the fixture runs first, so the tests error at setup instead of skipping. It now usespytest.importorskip.Testing
test_diffusion_rocm_tag_detect.py: fails on main (the raw read above), passes here.diffusers,unsloth_zooandtrlhidden from import (the backend job's environment),test_diffusion_int8_attention.pyandtest_diffusion_rocm_tag_detect.py: 4 errors on main, all pass or skip here.