Repository navigation
Studio: finish the backend CI cleanup #8506 started - #8554
Merged
Merged
Conversation
#8506 fixed the pre-quant allowlist tests but left test_diffusion_convrot.py on the same footing, and set the STT cancel timeout aside as a flake. Both are addressed here. The allowlist stand-in moves to conftest so the two files that load through the same registration share it instead of one carrying a private copy. The STT cancel path collected twice in a row while holding the model lock that wait_for_load_to_settle waits on. A long-lived backend reaches millions of tracked objects, where one pass costs about a second, so the join(timeout = 2) sat on a cliff. The release already collects and nothing becomes garbage after it, so the second call keeps its cache sweep and skips the collection.
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 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.
Follow-up to #8506, which cleared most of the Backend CI reds. Two things it left.
test_diffusion_convrot.py was on the same footing as the pre-quant tests
#8506 diagnosed this exactly right: the Backend tests job installs torch and transformers and no torchao, so
_register_prequant_safe_globalsnever meets its floor, every load refuses, and the assertions land on the refusal instead of the loader. It fixedtest_diffusion_prequant.pywith an autouse stand-in fixture.test_diffusion_convrot.pyloads through the same registration (_load_rotated->pq) and did not get the fixture, so two of its tests still fail on a runner without torchao:Rather than copy a 25-line fixture into a second file and let the two drift, the fixture moves to
tests/conftest.pywithoutautouse, and each of the two modules opts in with a one-line autouse alias. Every existing use ofreal_prequant_safe_globalsas a named parameter keeps working, and nothing else in the suite picks it up.The STT cancel timeout is a real 2 second cliff, not a flake
#8506 saw
test_pending_load_can_be_cancelled_without_waiting_for_model_lockfail in the same run, could not reproduce it, and set it aside. There is a mechanism.The cancel path ran two full
gc.collect()passes back to back while holding the model lock thatwait_for_load_to_settlewaits on:A whole-suite session ends around 2.7M tracked objects, where a single pass costs about a second, so the load thread's
join(timeout = 2)sits right on the edge. Reproduced by inflating the heap: two collects of 1.9s and 1.6s, failing at the same line, passing below the cliff._release_engine_lockedalready collects, andcandidateis dropped before it runs, so nothing has become garbage in between. The second call keeps its cache sweep, because the device this load picked need not be the resident's, and skips the collection. The branch where no resident was released is unchanged.Also here:
test_research_runs_hardening.pytimed the whole test rather than the cleanup, so it measured runner speed. It now asserts on the sum of the discard waits, which is what "one cleanup bound, not two" actually means.Verification
The CI condition is torchao being absent, which this host does not reproduce on its own (torchao is installed but only partly importable). Blocking it with a
ModuleNotFoundError-raisingmeta_pathfinder reproduces the failures exactly.The pre-existing failure in the right-hand column is
test_the_registration_floor_needs_a_real_torchao, which fails onmainon this host for the same reason and is not touched here.Affected suites together, torchao blocked: 328 passed, 7 skipped, 1 failed. The one failure is
test_decoding_stops_as_soon_as_the_request_is_cancelled, which needs PyAV and fails identically onmainhere.The research and STT changes rest on measured mechanism rather than a red-to-green flip I could run locally, since neither failure reproduces on this machine. The research change removes the dependency on runner speed entirely; the STT change removes the 2 second cliff and halves the stall behind it.