Repository navigation
Studio: stop two backend tests from asking the host what the answer is - #8022
Merged
Merged
Conversation
Both pass on a GPU-less CI runner with no Studio running, and fail on a developer box that has either. Neither is testing the machine. test_a_worker_spawned_during_the_gpu_init_retry_does_not_inherit_the_override asserts the shim makes two import attempts, the second under UNSLOTH_ZOO_DISABLE_GPU_INIT. df5f139 gated that retry on _gpu_present(), because the flag makes unsloth_zoo stub triton and bitsandbytes for the whole process and that would turn a healthy GPU into 500s. So on a machine with an accelerator there is one attempt, not two. Its two neighbours in the same file already pin _gpu_present for exactly this reason; this one was missed. test_a_corrupt_pid_file_does_not_abort_shutdown ends by asserting _remove_pid_file unlinks a record holding its own PID. _legacy_heir scans the real Studio root and hands studio.pid to a live sibling instead of deleting it, so with any server running on the machine the file is rewritten and the assertion fails. Pinned to no heir, which is the case that assertion is about. The handoff had no coverage of its own, so it has one now: the branch that broke the test above is worth pinning rather than only working around.
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! 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.
Two tests in
studio/backend/tests/pass on a GPU-less CI runner with no Studio running and fail on a developer box that has either. Neither is testing the machine.test_hf_xet_fallback.py::test_a_worker_spawned_during_the_gpu_init_retry_does_not_inherit_the_overrideIt asserts the shim makes two
unsloth_zooimport attempts, the second underUNSLOTH_ZOO_DISABLE_GPU_INIT, and that neither spawned child inherits the flag.df5f139bagated that retry on_gpu_present(): the flag makesunsloth_zootake its MLX/CPU path and stub triton and bitsandbytes for the whole process, which would turn a healthy GPU into 500s. On a machine with an accelerator there is therefore one attempt, not two, and the test fails withassert 1 == 2.The two neighbouring tests in the same file already pin
_gpu_presentfor exactly this reason (monkeypatch.setattr(degraded, "_gpu_present", lambda: False), with the comment "The retry only applies to a host with no accelerator"). This one was missed. Same idiom applied.test_text_io_encoding.py::test_a_corrupt_pid_file_does_not_abort_shutdownIts last assertion is that
_remove_pid_file()unlinks a record holding this process's own PID._legacy_heir()scans the real Studio root and handsstudio.pidto a live sibling rather than deleting it, so with any Studio server running on the machine the file is rewritten andassert not pid_file.exists()fails:Pinned to "no heir", which is the case that assertion is about.
test_the_legacy_pid_record_is_handed_to_a_live_siblingpins the branch that broke the test above, rather than only working around it. Correction to the commit message, which claims the handoff had no coverage:tests/test_studio_pid_files.py::test_the_legacy_pointer_moves_to_a_live_siblingalready covers it against the real_legacy_heirunder an isolated root. I found that only after pushing -- my search was for the symbol name, and that test exercises the behaviour through_remove_pid_filewithout naming it. The new test is narrower (it stubs_legacy_heir, so it covers the two-line branch in_remove_pid_file) and is kept because it is what makes the stub in the test above self-evidently safe.Verification
Run on a 8x B200 host with a Studio server up, i.e. the environment that reproduced both failures. No production code changes.