Repository navigation
Unsloth Studio / Desktop (AMD, Windows): never run amd-smi from the installers - #19615
Conversation
…mi unless opted in amd-smi.exe elevates a child and pops a UAC/DiskPart prompt that RunAsInvoker cannot suppress, with or without a HIP SDK. The runtime already made it opt-in (unslothai#14041); the four installer gates still ran it whenever a HIP SDK was found, so updates popped the prompt. Match the runtime: UNSLOTH_ENABLE_AMD_SMI=1 only.
hipinfo, hipconfig, WMI and the forwarded --rocm-gfx already give the arch and ROCm version, so the amd-smi list/static/version probes and their helper go.
|
@codex review |
1 similar comment
|
@codex review |
Codex Review Summary: ❌ FailedThis 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. 🚀 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". |
|
pre-commit.ci run |
# Conflicts: # install.ps1 # studio/setup.ps1 [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f7131a119
ℹ️ 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".
| _win_probes = [(["hipinfo"], lambda out: "gcnarchname" in out.lower())] | ||
| if _amd_smi_allowed(): | ||
| _win_probes.append((["amd-smi", "list"], _amd_smi_has_gpu)) | ||
| for _cmd, _check in _win_probes: |
There was a problem hiding this comment.
Preserve AMD detection when hipinfo crashes after reporting an arch
If the Windows HIP SDK's hipinfo prints gcnArchName and then crashes with 0xC0000005, the remaining probe still discards the valid arch because it requires returncode == 0. Removing the fallback therefore prevents _auto_host_following_rocm_torch() from confirming AMD on a mixed AMD+NVIDIA host without a manual gfx environment override: Automatic updates now take the CUDA branch even when ROCm torch is installed/requested, and the updater's forwarded gfx does not clear the NVIDIA flags. Accept arch-bearing partial output here, as setup.ps1 and install_python_stack._detect_windows_gfx_arch() already do, to preserve this route without running amd-smi.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d514274: detect_host and the Windows notice probe now accept hipinfo output that names gcnArchName whatever the exit code, as setup.ps1 / install.ps1 do; regression test test_a_crashed_hipinfo_counts_only_when_it_named_an_arch fails without the fix.
…longer backs it up [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! 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". |
…ince unsloth-zoo #2910) (#20024) ## Problem `MLX CI on Mac M1` fails two stub parity tests in `studio/backend/tests/test_mlx_inference_backend.py`, for example on #19615's run: ``` test_the_stub_answers_every_helper_zoo_imports_from_inference: AssertionError: zoo imports ['_MarkovTreeDrafter'] from mlx.inference and the stub cannot answer them test_the_stub_accepts_every_call_zoo_makes_to_an_inference_helper: AttributeError: _MarkovTreeDrafter ``` unsloth-zoo #2910 (DSpark trees over the Markov lattice under Fast Verify) made `unsloth_zoo/mlx/speculative.py` import `_MarkovTreeDrafter` from `.inference`, and check `isinstance(drafter._draft, _MarkovTreeDrafter)`. The test's stand-in for `unsloth_zoo.mlx.inference` reads the names zoo imports from zoo's own source, and it fails until each one has an answer. That is its job, and it caught the new import as intended. ## Fix Add `_MarkovTreeDrafter` to the stub's private helpers, as a plain class like `_SparseDrafter` next to it. The `isinstance` check then has a type to test against. ## Verification `tests/test_mlx_inference_backend.py -k stub`: | unsloth-zoo | this branch | main's stub | |---|---|---| | main (`2fc45a4`, includes #2910) | 11 passed, 1 skipped | 2 failed (the two above) | | released 2026.11.11 | 11 passed, 1 skipped | not run | The skip is the `mlx_lm` case, which needs Apple Silicon.
…t (red on main since #19615) (#20060) ## Problem The `parity (ubuntu-latest)` job fails one check in `tests/studio/test_nvidia_adapter_presence.ps1` on main (`bcbfe14c4f`), for example on the #20038 staging run: ``` FAIL WMI without the AMD card: an opted-in amd-smi vetoes the promotion 1 check(s) failed ``` #19615 made the Windows installers stop running `amd-smi`, because it pops a UAC prompt that cannot be suppressed. With it went the `UNSLOTH_ENABLE_AMD_SMI` opt-in in `Test-OtherVendorAdapterPresent`, which used to let an opted-in `amd-smi` veto promoting the NVIDIA route. That was the intended change, and `install.ps1` and `studio/setup.ps1` no longer mention `amd-smi` at all. This test still listed "an opted-in amd-smi" among the signals that veto, so it now asserts behaviour that was deliberately removed. ## Fix - The opted-in `amd-smi` case is dropped from the list of AMD signals that veto the promotion. `hipinfo` on PATH, a HIP SDK under `HIP_PATH`, and a HIP SDK under `ROCM_PATH` still veto, and are still checked. - The `amd-smi` check now asserts what #19615 made true: `amd-smi` on PATH does not veto, either without the opt-in or with `UNSLOTH_ENABLE_AMD_SMI=1`. - The new assertion with the opt-in set would have failed on the code before #19615, so a return of the `amd-smi` probe would be caught. ## Verification - `pwsh -NoProfile -File tests/studio/test_nvidia_adapter_presence.ps1` on Linux: `all checks passed`. Before, on main: `1 check(s) failed`, the line above. - The test file stays ASCII-only.
AMD's
amd-smi.exeon Windows elevates a child and pops a UAC prompt for DiskPart, which RunAsInvoker can't suppress. #14041 took it off the app's default path (studio/backend/utils/hardware/amd.py). The installers kept running it whenever a HIP SDK was detectable:install.ps1andstudio/setup.ps1:amd-smi list(plusstatic --asic) when hipinfo found no GPU, andamd-smi versionwhen hipconfig gave no version.studio/install_python_stack.pyandstudio/install_llama_prebuilt.py:_amd_smi_allowed()returned true for any hipinfo outside the venv, soamd-smi version/amd-smi listran on every install and update.Reported in the Discord help thread: an RX 9060 XT user got several DiskPart UAC prompts while updating Unsloth Desktop.
Change. The Windows installers never run amd-smi, opted in or not.
install.ps1/setup.ps1: the amd-smilist,static --asicandversionprobes,Invoke-AmdSmiNoElevate, and the opted-in amd-smi veto in the adapter check are removed._amd_smi_allowed()isplatform.system() != "Windows"(Linux keeps amd-smi). The Windows notice probe ininstall_python_stack.pyruns hipinfo only. The_path_inside_venv/_external_hipinfo_on_pathhelpers only fed the old gate, so they're gone.--rocm-gfx. The PowerShell venv-hipinfo exclusion stays, since$HipSdkInstalledstill drives the hipinfo probe.amd.pystill honoursUNSLOTH_ENABLE_AMD_SMI=1.Tests. The gate tests cover both Python copies and pin "never on Windows" for no HIP SDK / HIP SDK and unset / opt-in / opt-out, plus a text check that neither PowerShell installer mentions amd-smi. Tests of the removed amd-smi parsing are dropped. The hipinfo mask test now checks that an amd-smi on PATH is ignored on Windows.
What ran. On macOS, every install test file that mentions amd-smi: 1733 passed, 2 failed (
test_amd_fastpath_probe, which fail the same way on main on this machine). The pwsh tests were skipped because there's no pwsh here. I haven't run it on a Windows AMD box, and the reporter hasn't confirmed the HIP SDK yet.