Repository navigation
tests: do not read a host refusal as an H3 reference-load regression - #8638
Conversation
test_a_quantized_reference_load_resolves_the_reference_denoiser fails any ValueError out of validate_load_request as "ref2va <scheme> should be loadable but was refused". Two of that function's refusals are about the machine rather than the request: Metal cannot place the modular workflow at all, since torch.mps exposes no mem_get_info for the auto CPU offload, and a diffusers without the bundled revision has no transformer class to build. On either host the test reports a regression in a pairing that was never in question. It goes unnoticed because studio-backend-ci.yml runs the backend suite on ubuntu-latest only, so the file has never run on macOS; it shows up the moment it does, and on any checkout carrying a different diffusers. The refusal check is now gated on the same two conditions the product tests, so it runs wherever the load can actually be attempted and is skipped where it cannot. The prequant resolution is a registry lookup that holds on every host, so it stays unconditional and macOS keeps covering it.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 316679984e
ℹ️ 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".
| import diffusers | ||
| return hasattr(diffusers, fam.transformer_class) |
There was a problem hiding this comment.
Treat unimportable diffusers as an unattemptable host
When diffusers is absent or its top-level import fails, assert_pipeline_class_available deliberately absorbs that error in non-strict mode and returns, so execution reaches this unguarded import and the test fails before the existing except Exception around validate_load_request can handle the host limitation. This regresses the test on supported torch-free/native-engine installations; wrap the import and transformer probe in the same host-availability guard and return False when either raises.
Useful? React with 👍 / 👎.
assert_pipeline_class_available answers only whether the installed diffusers is new enough, so under its default non-strict mode an unimportable one returns instead of raising. Control therefore reached the modular-workflow probe below it, whose bare import diffusers raised ModuleNotFoundError straight out of the helper -- past the caller's own except Exception -- and failed the test on a host that simply has no diffusers. studio.txt does not install one, so that host is supported, not exotic.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79205069b2
ℹ️ 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".
| except Exception: | ||
| # Anything past the quant check (the diffusers probe) is not this test's business. | ||
| pass | ||
| if check_refusal: |
There was a problem hiding this comment.
Keep the validation assertion active in backend CI
In the Backend CI workflow (.github/workflows/studio-backend-ci.yml), every Python matrix job installs studio.txt, torch, and transformers, but not requirements/diffusers-pin.txt; since studio.txt deliberately does not install diffusers, this condition is false and validate_load_request is never called in the environment that runs this test. The remaining resolve_prequant_source assertion only checks the filename registry, so a regression that makes video_family_prequant_available reject either ref2va scheme would now pass all CI jobs. Stub the H3 diffusers/device prerequisites for this validation assertion rather than conditionally removing it.
Useful? React with 👍 / 👎.
Summary
test_a_quantized_reference_load_resolves_the_reference_denoisertreats anyValueErrorout ofvalidate_load_requestas "ref2va<scheme>should be loadable but was refused". Two of that function's refusals are about the machine rather than the request:_load_h3_modular_pipelinehands every non-CPU device toComponentsManager.enable_auto_cpu_offload, which readstorch.<device>.mem_get_info, andtorch.mpshas never exposed it (video.py:1040).MiniMaxH3Transformer3DModelto build (video.py:1107).On either host the test reports a regression in a pairing that was never in question.
Why it has not been seen in CI
studio-backend-ci.ymlruns the backend suite onubuntu-latestonly, sotest_video_backend.pyhas never run on macOS. Running it there is what surfaced this:It also fires on any checkout carrying a different diffusers, which is the form it takes locally.
Changes
_h3_pipeline_load_is_attemptable(fam)evaluates the same two conditions the product tests: the resolved device target, andassert_pipeline_class_availableplus the transformer class for a modular family.The guard is not a blanket suppression. With it forced on, the test still fails on a genuine refusal, which is how I verified it:
Validation
tests/test_video_backend.py: 214 passed (the case was red on this checkout before the change, for the diffusers-revision form).Worth considering separately: the reason this sat unnoticed is that the backend suite has no macOS leg. Adding one would catch this class of thing, at the cost of another job on an already busy queue, so I have left that call out of this PR.