Repository navigation
Studio: upgrade a Desktop Chat only install to the full install from Settings - #14593
danielhanchen merged 22 commits into
Conversation
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. |
|
Reached Codex review convergence at oobabooga#404. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. 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 |
|
Codex Review: Didn't find any major issues. Bravo. 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". |
On an upgradable Desktop Chat only install, clicking Train now opens the same Upgrade to the full install dialog as Settings > General instead of doing nothing. The row stays greyed out and never navigates or preloads Train until the backend reports training is available. The dialog states the at least 5 GB of disk space the full install needs. [skip ci]
|
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". |
|
@codex review |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ba2bcf350
ℹ️ 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".
| elif _installed_without_torch() and _a_gpu_build_would_train_here(): | ||
| # GGUF-only by request: "needs a GPU" is wrong on a GPU host and nothing is broken. | ||
| # Without such a GPU it stays no_gpu: the Desktop offers the full install on no_torch. | ||
| CHAT_ONLY_REASON = "no_torch" |
There was a problem hiding this comment.
Reclassify no-torch hosts after inventory changes
When a Desktop --no-torch process starts without an eligible GPU and later gets a supported eGPU, this one-time branch leaves the reason as no_gpu. Although current_chat_only_verdict() refreshes no_gpu, absent torch yields build_reason = None, so it never promotes the host to no_torch; the reverse transition is also frozen because no_torch returns before consulting inventory and the sidebar does not poll that reason. Consequently Upgrade to full install stays hidden after attachment (or remains offered after detachment) until the backend restarts, so this classification needs to be reapplied by the inventory refresh path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this: GPU changes while the app runs are a documented known limit of this PR (picked up on the next start), and hot-plugging an eGPU into a running Desktop Chat only install is outside what this targets.
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
…er (unslothai#14861) On a Desktop Chat only install whose hardware can train, the greyed Train row's hover hint and the Export unavailable banner only described the problem. The way to fix it was a click on the row itself (unslothai#14593) or a trip to Settings. This PR puts a small **Install Training** button in both places, opening the same Upgrade to the full install dialog. ## What changes - **Train row hint:** on an upgradable install it now reads "Training is not installed. It needs at least 5 GB of disk space." with an Install Training button under it. The row itself still opens the dialog on click, as before. - **Export page:** the red Export unavailable banner gets the same button under its message. - Both buttons open the existing confirm dialog; nothing installs until Upgrade is pressed there. - Shown only where unslothai#14593 already offers the upgrade: a measured `no_torch` verdict, no blocking hint, and a Desktop that manages its backend. Web and CLI installs, hosts without a trainable GPU, Macs the MLX wheels skip and AMD hosts behind closed device nodes see exactly what they see today. ## Implementation - `NavRowDef` gains an optional `tooltipAction`, which `NavItem` renders as a button under the tooltip text. A row still checking its capability (spinner) never shows it. - The sidebar's `TooltipProvider` sets `disableHoverableContent`, so the pointer could never reach a button inside a nav tooltip: it closed as soon as the pointer left the row. `SidebarMenuButton` gets an `interactiveTooltip` prop that opts that one tooltip back into hoverable content; every other sidebar tooltip is unchanged. - The startup bundle budget rises by the measured growth: +424 B raw / +141 B transfer. ## Verification Both frontend builds were loaded in Chromium against the same real backend: a `--no-torch` install of this branch on a Linux host with NVIDIA GPUs, which reports `chat_only: true`, `no_torch`, no hint. A minimal stand-in for the Desktop shell's native commands was used, since the effect only exists inside Desktop and this host has no WebKit driver. | | main (`ee55c3c9a`) | this PR | |---|---|---| | Train row hint | text only | text plus Install Training button | | Pointer moved from the row onto the button | n/a | tooltip stays open, button clickable | | Button click | n/a | opens Upgrade to the full install | | Export unavailable banner | text only | text plus Install Training button | | Banner button, then Upgrade | n/a | dialog opens, managed repair starts | Same result on 3 of 3 runs. - Frontend: 13,688 tests, 0 failures. Typecheck, `i18n:check:strict`, build and `bundle:check` pass. - A new test pins both buttons and the hoverable opt-in; it fails on main. Not tested: a real macOS or Windows Desktop window, and keyboard-only access to the tooltip button (the row itself stays keyboard reachable and opens the same dialog). ## Screenshots BEFORE is main at `ee55c3c9a`, AFTER is this PR, both against the same Chat only backend. **Train row hint**  **Export unavailable banner** 
… on GPU-less Chat only installs (unslothai#16175) ## Problem On a host without a GPU, Studio greys out Train with "Training needs an NVIDIA or AMD GPU.", although unslothai#14717 added CPU training. - **Full install** (the default; the installers put CPU PyTorch on such a host): the verdict is `no_gpu`. Even past the gate, the training worker's `import unsloth` refuses with "Unsloth cannot find any torch accelerator? You need a GPU." - **Desktop Chat only install:** the verdict is also `no_gpu`, not `no_torch`, so Install Training (unslothai#14861) and the Settings upgrade row (unslothai#14593) are not offered. ## Cause Both gates predate CPU training. unslothai#14593 reports `no_torch` off Mac only when `_a_gpu_build_would_train_here()` finds a card, since a full install on a GPU-less host could not train then. unslothai#14717 kept Studio out of CPU training by setting `UNSLOTH_DISABLE_CPU_FALLBACK=1` in `main.py` and `run.py`, which the training worker inherits. unsloth-zoo#2162 has since made Studio's training worker run on the CPU backend, and 2026.10.11 ships both. ## Fix - `hardware.py`: `trains_on_cpu(reason)` is true for `no_gpu` with PyTorch installed and for `no_torch` without a usable GPU. `/api/health` reports it as `cpu_training`. `chat_only` stays true, so Chat, Export and Video are unchanged. - Every off-Mac `--no-torch` install reports `no_torch`, so Install Training is offered there too. - The training worker sets `UNSLOTH_FORCE_CPU=1` when `trains_on_cpu()` holds, before importing unsloth. Every other Studio process keeps the opt-out. - `/api/train/start` refuses vision and audio datasets, embedding, decision and drafter training on CPU with a 400, since the CPU backend trains text models with SFTTrainer only. - Frontend: Train, `/studio` and its shortcuts follow a new `isTrainUnavailable()` instead of `isChatOnly()`. The Train page notes that training runs on the CPU and, as on MLX, hides the drafter section and leaves a saved or imported drafter out of the request. On a GPU-less Chat only install the upgrade dialog and Settings row promise CPU training only, not export or video. ## Behavior boundaries - A host whose GPU this PyTorch cannot use keeps its repair message instead of falling back to CPU. - CPU training is on by default, as `import unsloth` has been since unslothai#14717. - A vision model with a text dataset is not refused up front; the CPU backend's own error surfaces at model load. ## Verification Live A/B on Linux with `CUDA_VISIBLE_DEVICES=""`, `trl-internal-testing/tiny-Qwen3ForCausalLM` and a 64-row JSONL, through `/api/train/start` with Studio defaults: | | main | this PR | |---|---|---| | `/api/health` | `chat_only`, `no_gpu` | `chat_only`, `no_gpu`, `cpu_training: true` | | LoRA, 6 steps | "Unsloth cannot find any torch accelerator? You need a GPU." | completes, adapter saved | | Full finetuning, 4 steps | not run | completes | | Image dataset | not run | 400 | New backend tests cover the verdicts, the health field, the start route refusals and the worker environment; they fail on main. Backend files touching these paths: 8,726 passed, with one failure that also fails on main. The full frontend suite has no failures beyond main's. Typecheck, i18n parity and the bundle budget pass, and lint has no new findings. Not tested: the Desktop Install Training flow end to end on a GPU-less host, Windows or macOS, and models larger than the tiny test model. ## Screenshots `main` (`4d28d72802`) and this PR, two isolated installs with every GPU hidden, fresh en-US browser profile. Sidebar with the Train row hovered: <img width="2424" height="846" alt="cpu_training_train_row" src="https://github.com/user-attachments/assets/5a954770-3bc7-4c83-ba28-fe0d1df87509" /> `/studio` opened directly. On `main` it redirects to Chat: <img width="4424" height="936" alt="cpu_training_train_page" src="https://github.com/user-attachments/assets/9bf247f3-76b5-4e8c-bcb7-a877086ae330" /> ### Before / after on a GPU-less host Two isolated installs (merge base `c510fc1ca` vs this PR), both launched with `CUDA_VISIBLE_DEVICES=""`, `/studio` opened directly. Before: the route redirects to Chat and Train is greyed out. After: the Train page stays open with the CPU training notice.  --------- Co-authored-by: Daniel Han <[email protected]>
Desktop users who chose Chat only (GGUF) (#14245) currently have to use Repair installation to upgrade. That action is buried under Danger zone, its wording assumes PyTorch is already installed, and Settings searches for "train", "pytorch" or "chat only" find nothing. After the upgrade, Train can remain disabled until the app restarts.
This PR adds Upgrade to full install to Settings, updates the Train and Export hints to point there, and refreshes hardware detection after the upgrade so Train can become available without another app restart. On an eligible install, clicking the greyed Train row also opens the same upgrade dialog.
What changes
Who gets the upgrade option
The option appears once hardware detection identifies a Chat only installation as
no_torch, provided Desktop manages the backend and the backend reports no blocking hint.no_gpuand keep the existing hardware requirement hint.Web and CLI installations, and Desktop connected to a backend started in a terminal, receive no upgrade action. Their existing
--no-torchadvice remains, except where the Mac requirement message applies. Automatic startup repair continues to preserve Chat only mode.Implementation
The button calls the existing
repairInstall(), which reruns the installer withUNSLOTH_NO_TORCH=0.The disabled Train issue came from retaining the previous backend's hardware result while the replacement backend was still detecting hardware. The frontend now marks that result stale after a backend replacement. Train shows its checking spinner, and polling continues until a new result arrives. If detection is deferred, the old reason is cleared so the completed upgrade is not offered again.
The startup bundle budget increases by the measured growth, mostly from the new English Settings strings.
Known limits
GPU eligibility does not reproduce the installer's full selection of PyTorch packages. Some machines can still receive the offer but end up with CPU PyTorch and disabled training: Van Gogh (gfx1033), Jetson before CUDA 13, NVIDIA drivers older than CUDA 11, or installations pinned to a CPU package index. The existing Train tooltip already directs these machines to Repair installation.
GPU changes made while the app is running are detected on the next start.
Verification
Windows 11 Desktop was compared on a Ryzen AI MAX+ 395 with Radeon 8060S using two debug builds: main at the merge base (
0391814917, frontend and backend), and that base plus this PR. Each used a fresh profile, a fresh Chat only install and an en-US WebView.Both upgraded successfully and returned
chat_only: false. On main, Train was still disabled after 60 seconds. With this PR, it showed the checking spinner and became enabled after 2 seconds.i18n:check:strict, build andbundle:checkpass. The full suite has 12 failures that also occur on main.Not tested live: CPU-only or iGPU-only machines, macOS Desktop or Linux Desktop.
Linux with an NVIDIA GPU, end to end through the installer the upgrade runs:
UNSLOTH_NO_TORCH=0 UNSLOTH_TORCH_UPGRADE=1)2.13.0+cu130, CUDA available/api/healthchat_only: true,no_torch, no hintchat_only: falseno_torch: true, marker presentno_torch: false, marker removedTrain row, both builds against the same backend with a Chat only verdict on a GPU host (
no_torch, no hint), in the Desktop shell: on main the row is disabled and a click does nothing; with this PR the row is enabled but greyed, a click opens the dialog, Cancel starts nothing, and Upgrade starts the managed repair. Same result on 3 of 3 runs.Screenshots
BEFORE is main at the merge base, AFTER is this PR.
Train hint
Settings > General
Settings search for "pytorch"
Repair installation on a Chat only install
Progress screen during the upgrade
Train once the app is back
Export page hint
Train row on a Chat only install
Clicking the greyed Train row