Repository navigation
Studio: Install Training button in the Train hint and the Export banner - #14861
Conversation
…rt banner On an upgradable Desktop Chat only install, the greyed Train row's hover hint and the Export unavailable banner now carry a small Install Training button that opens the existing Upgrade to the full install dialog. The sidebar tooltip provider disables hoverable content, so a tooltip holding a control opts back in.
|
@codex review |
1 similar comment
|
@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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a97c03295
ℹ️ 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".
| } | ||
| disabled={rowState.disabled} | ||
| tooltip={rowState.tooltip} | ||
| tooltipAction={rowState.pending ? undefined : row.tooltipAction} |
There was a problem hiding this comment.
Forward the install action to overflow Train rows
When a user unpins Train in Settings > Appearance, the row is rendered through overflowNavIds as a MoreMenuItem, but this new action is forwarded only to the inline NavItem. The overflow row therefore retains only a native text tooltip—now without the previous “Click to install” guidance—and never displays the promised Install Training button. Pass the action through the overflow rendering path as well, or otherwise preserve an explicit install affordance there.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d81ffaf: an unpinned Train item in the More menu keeps the click guidance in its title, and selecting it already opens the same dialog.
| <Button size="xs" onClick={tooltipAction.onClick}> | ||
| {tooltipAction.label} | ||
| </Button> |
There was a problem hiding this comment.
Move the install control into a focusable popup
When a keyboard user focuses the Train row and presses Tab toward this button, Radix Tooltip closes on the trigger's blur and unmounts its content before focus can reach the button. Setting disableHoverableContent to false only preserves the tooltip during pointer movement, so the newly advertised control remains mouse-only even though it is rendered as a focusable Button; use a popover/menu with managed focus or keep the action outside the tooltip.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this: the Train row itself is a focusable, enabled button, and Enter on it opens the same Install Training dialog, so keyboard users already have the action. The tooltip button is a pointer shortcut on top of that.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! 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 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]>
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 (#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
no_torchverdict, 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
NavRowDefgains an optionaltooltipAction, whichNavItemrenders as a button under the tooltip text. A row still checking its capability (spinner) never shows it.TooltipProvidersetsdisableHoverableContent, so the pointer could never reach a button inside a nav tooltip: it closed as soon as the pointer left the row.SidebarMenuButtongets aninteractiveTooltipprop that opts that one tooltip back into hoverable content; every other sidebar tooltip is unchanged.Verification
Both frontend builds were loaded in Chromium against the same real backend: a
--no-torchinstall of this branch on a Linux host with NVIDIA GPUs, which reportschat_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.ee55c3c9a)Same result on 3 of 3 runs.
i18n:check:strict, build andbundle:checkpass.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