Repository navigation
Studio: judge an HSA_OVERRIDE_GFX_VERSION GPU by its override in the cold engine status - #16670
Merged
Merged
Conversation
…cold engine status Since startup ML warmup became opt-in (#16469), an idle managed-engine status poll on a ROCm host with HSA_OVERRIDE_GFX_VERSION answered Checking for a supported AMD GPU on every poll until something else imported torch. Read a readable global override as the gfx target ROCr presents for every GPU KFD lists, so the cold poll reaches the verdict torch would report without importing torch. Unreadable or per-device overrides and an unreadable KFD topology stay provisional as before.
…ling text, major up to 63)
danielhanchen
added a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Nov 4, 2026
[skip ci]
Member
Author
|
@codex review |
1 similar comment
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. |
danielhanchen
added a commit
to Etherll/unsloth
that referenced
this pull request
Nov 5, 2026
|
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.
What changes
Since #16469 made startup ML warmup opt-in, torch is no longer imported at startup. On a ROCm host that sets
HSA_OVERRIDE_GFX_VERSION(for example 11.0.0 on a gfx1102 Radeon), the vLLM / SGLang status endpoint then answered "Checking for a supported AMD GPU." on every poll and never reached a verdict until something else imported torch (the Settings Resources tab does; About and the download manager do not). Before #16469 it probed torch and answered "supported".The cold path now reads a readable global override the way libhsakmt does (
ROCR-Runtimelibhsakmt/src/topology.c,topology_sysfs_get_node_props:sscanf("%u.%u.%u%c"), so trailing text such as a space is rejected, major at most 63; the name isgfx<major><minor><stepping in hex>, so 11.0.0 is gfx1100 and 9.0.10 is gfx90a) and applies it to every GPU the KFD topology lists, as libhsakmt does for every GPU node. That is the target torch reports for each device, so the poll reaches the same verdict as before #16469 without importing torch.Unchanged and still provisional ("Checking") until torch reports: an unreadable override, any per-device
HSA_OVERRIDE_GFX_VERSION_<n>, and an unreadable KFD topology. Hosts without an override, CUDA, CPU-only, Windows and macOS take the same code path as before. No UI text changes. The new helper is a pure function of the environment, so repeated polls give the same answer.studio/backend/utils/hardware/amd.py:hsa_override_gfx_target(), the same name rule asinstall_python_stack._hsa_override_gfx_arch, but stricter on input: a value libhsakmt rejects (trailing whitespace or text, major above 63) stays unreadable here, so the status never reports supported for an override the runtime refuses.studio/backend/core/inference/engine_install.py:_rocm_reasonuses it before falling back to "Checking".Results
Cold status (
support_reason("vllm", wait=False), 3 polls) over mocked hosts. "torch" = whether the poll ran hardware detection or the torch probe.Tests
test_cold_status_judges_an_overridden_gpu_by_the_override_without_torch(gpu_id None, 0, 1; the torch probe raises if called) andtest_hsa_override_gfx_target; both fail on main.test_hsa_override_gfx_targetalso covers"11.0.0 "and"64.0.0"(both unreadable, as in libhsakmt).test_cold_status_does_not_judge_an_overridden_gpu_by_its_kernel_targetnow expects the override verdict instead of "Checking".test_managed_engines_rocm.py,test_engine_status_stays_cold.py,test_ml_warmup_idle_runtime.py, every backend test touchingengine_installorHSA_OVERRIDE_GFX_VERSION, andtests/studio -k "engine or rocm or amd or hsa": same failing IDs on main and this branch.Not covered
_hsa_override_gfx_archstill strips trailing whitespace, so it accepts a value libhsakmt rejects; that is a separate, pre-existing difference and is not changed here.HIP_VISIBLE_DEVICESordinal or stacked masks) are not modelled: the override applies to every device, so the per-GPU answer is the override target either way.