Skip to content

Studio: let Desktop start on Windows AMD when the Triton pairing fails - #18527

Merged
danielhanchen merged 2 commits into
unslothai:mainfrom
oobabooga:worktree-rocm-triton-pairing-keeps-manifest
Nov 20, 2026
Merged

danielhanchen merged 2 commits into
unslothai:mainfrom
oobabooga:worktree-rocm-triton-pairing-keeps-manifest

Conversation

@oobabooga

@oobabooga oobabooga commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Problem

On Windows with an AMD GPU, Unsloth Desktop can get stuck in a state where it refuses to start Studio, and its built-in repair does not help. This was reported on Desktop 0.1.920-beta:

  • Desktop said the install was incomplete (studio_install_incomplete).
  • Repair ran unsloth studio update, then the bundled installer. Both finished with exit code 0.
  • Desktop still refused to start Studio: "Repair finished, but Unsloth install is still not desktop-ready."

Why it happens

Two pieces of code disagree about what a failed Triton swap means.

Desktop needs the install manifest. Setup writes unsloth_install_manifest.json into the venv when an install finishes. Desktop only starts Studio if this file is there. If it is missing, Desktop calls the install incomplete.

On AMD, setup can delete the manifest and still report success. #16074 added a step that runs after the dependencies are installed. When ROCm torch 2.11 or 2.12 ends up next to Triton 3.9, this step replaces it with Triton 3.8, because 3.9 breaks fused flex attention decode with those torch versions. The step works like this:

  1. Move the manifest aside, so an interrupted swap is never marked as finished.
  2. Install Triton 3.8.
  3. Check what is installed now.
  4. If 3.8 is in place, put the manifest back.
  5. If not, print a warning ("flex attention decode may run unfused"), delete the manifest, and let setup exit 0. Setup only fails here if the swap broke a Triton that worked before.

Step 5 is the bug. Setup reports success, but Desktop now sees an incomplete install. Repair runs setup again, which reaches the same step, fails the same way, and deletes the manifest again. On a machine where the swap keeps failing, Desktop never recovers.

The swap can fail for several reasons: the install fails, the check after it fails or times out, or a uv override-dependencies setting keeps 3.9 while the install still exits 0. The report does not show which one the reporter hit.

Desktop also hid the reason. Its check after repair returned only yes or no, so the error message never said why the install was not ready.

Fix

studio/setup.ps1: when the swap ends with only a warning, put the manifest back instead of deleting it.

This is safe because a warning means Triton is no worse than before the step:

  • If Triton 3.9 still works, the cost is unfused flex attention decode.
  • If Triton was missing or broken before, it still is, and the backend keeps torch.compile turned off, as it already did (gate_torch_compile_on_windows).

In both cases Studio can still start. The swap is also retried on the next update, even with the manifest in place, because the update's fast path checks the installed Triton directly (Test-RocmTritonPairingNeedsPass). The old code comment said the manifest had to go so that the next update would retry; that is not needed.

Setup still fails, as before, when the swap breaks a Triton that worked. It now also fails if it cannot put the manifest back, instead of reporting success without one.

Desktop (studio/src-tauri): when repair ends with the install still not ready, the error names the reason, for example:

Repair finished, but Unsloth install is still not desktop-ready (studio_install_incomplete).

The log line written when repair falls back from the update to the installer includes the reason too.

Tests (tests/studio/test_rocm_triton_windows_pairing.ps1): cases where the swap only warns now expect the manifest to be kept. A new case checks that setup fails when the manifest cannot be put back.

Testing

Live A/B on Windows AMD hardware

Both versions ran on AMD Strix Halo machines (Windows 11, Radeon 8060S, Python 3.13, torch 2.11.0+rocm7.14.0). "Main" is the base commit and "fix" is the same commit plus this change.

To make the swap fail on purpose, a uv config set override-dependencies = ["triton-windows==3.9.0.post30"]. With that in place, installing Triton 3.8 exits 0 but leaves 3.9 installed.

Each version ran three commands. After each one, the table shows whether the manifest exists and what unsloth studio desktop-capabilities --json reports for studio_install_ok. That value is what Desktop checks before it starts Studio. Every command exited 0.

Command Main Fix
1. install.ps1 --local --python 3.13, swap forced to fail Manifest missing, false Manifest kept, true
2. unsloth studio update (the update Desktop's repair runs), swap still forced to fail Manifest deleted again, false Swap retried, manifest kept, true
3. unsloth studio update --local, override removed Triton 3.8 installed, true Triton 3.8 installed, true

Rows 1 and 2 reproduce the reported failure on main and show the fix. Row 3 shows that both versions install Triton 3.8 once the cause is gone.

Logs: main, fix. The "Evidence after ..." steps print what the table is based on: exit code, the swap messages from the setup log, whether the manifest exists, the torch and Triton versions, and the desktop-capabilities answer. Harness: workflow, evidence script.

The main job's last step (Verdict) is red because of a harness problem unrelated to the results above. That job also tried to run the updated unit tests against main, but the test file was not swapped in, so it ran main's own tests. The likely cause is that the runner checked out the patch with CRLF line endings. The unit comparison was rerun separately, below.

Unit tests

  • Pairing tests on Windows PowerShell 5.1: all pass with the fix. The same tests against main fail 8 checks, which are the warning cases and the new restore-failure case. Logs: main, fix, workflow. The main job is red because those 8 failures are the expected result; its log ends with MATCH.
  • Pairing tests on Linux PowerShell 7.7: 78 of 78 pass.
  • cargo test in studio/src-tauri on Linux: 872 of 872 pass, including two new tests for the repair error. In one of three full runs, an unrelated timing-sensitive test (shell_path::tests::a_job_writing_nonstop_does_not_hold_launch) failed once and then passed on its own.

Not tested

I did not run the Desktop app itself on Windows. The live test checks the same desktop-capabilities answer that Desktop reads before it starts Studio.

Desktop before / after

Unsloth Desktop debug build (Linux, WebDriver journey), merge base 91211c7 vs PR head 904e9bb: all 10 Desktop steps pass on both sides. The startup screen is identical apart from the spinner frame. The only text this PR changes in Desktop is the repair failure message, which now ends with the reason, for example (studio_install_incomplete). That message only appears after a failed repair, and the exact text is checked by a_repair_that_ends_not_ready_names_the_reason.

Desktop startup, before vs after

Real gfx1151 Windows 11 (Windows PowerShell 5.1) re-check on the merged commit: the pairing tests fail 8 checks on the parent and pass 78 of 78 on the merge commit.

On Windows ROCm, setup.ps1 sets the install manifest aside while it pairs
triton-windows 3.8 with torch 2.11 / 2.12. When the pairing could not be
verified but nothing was broken, setup warned, deleted the manifest and exited
0. Desktop reads a missing manifest as studio_install_incomplete, so the app
would not start, and every repair (update, then installer) reached the same
step and dropped the manifest again.

The warning outcome now puts the manifest back. The fast path's
Test-RocmTritonPairingNeedsPass already retries the pairing on the next
update, so the manifest is not needed for that. A replacement that breaks a
working triton still fails setup, and a manifest that cannot be put back now
fails setup instead of being lost silently.

Desktop repair also names the preflight reason when it ends not ready,
instead of the generic "still not desktop-ready" message.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T20:48:04.743383Z 904e9bb Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@oobabooga

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 904e9bbd56

ℹ️ 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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants