Repository navigation
Define _recover_vulkan_stall below the CPU fallback it calls - #15261
Merged
Merged
Conversation
Member
Author
|
@codex review |
Codex Review SummaryThis 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. |
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ 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.
Summary
studio/backend/tests/test_model_memory_settings.py::TestNoNestedHelperIsUsedBeforeItsDef::test_every_nested_def_precedes_its_callsfails on main, so(Python 3.13, g-r)is red on unrelated PRs (for example #15225):#14521 (load GGUF on CPU when the auto-selected Vulkan driver hangs) added the nested
_recover_vulkan_stallinsideload_model. It calls_try_auto_vulkan_cpu_fallback, which is defined about 40 lines further down. Today this does not raise: all three callers of_recover_vulkan_stallsit below both definitions, and a closure looks the name up when it runs. But the guard's rule is "a nested helper is defined above every textual use", because the looser version (the call is fine as long as every caller of the caller runs late enough) already shipped broken once and aborted every full-offload launch. Keeping that simple rule true is cheaper than teaching the guard call-graph ordering.Change
_recover_vulkan_stall(unchanged, 19 lines) from just above_vulkan_stall_pendingto just below_try_auto_vulkan_cpu_fallback. It is still above its first caller. Onlydefs sit between the old and new spots, and the defaults are literals, so nothing evaluates differently.Verification
test_every_nested_def_precedes_its_calls: fails on main, passes with this change.test_vulkan_no_device_cpu_route.py,test_gpu_init_crash_message.py,test_load_mode_fit_matrix.py,test_vram_budget_settings.py,test_model_memory_settings.py:1 failed, 2402 passedon main (the guard),2403 passedwith this change.