Skip to content

Studio: show the AMD NPU by default again, with a clearer setup notice - #14524

Merged
oobabooga merged 8 commits into
mainfrom
studio-npu-default-on
Oct 21, 2026
Merged

oobabooga merged 8 commits into
mainfrom
studio-npu-default-on

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Since 2026.10.7 the NPU section is gone from the model picker and the Hub on every Ryzen AI machine, including installs that were already chatting on the NPU. #13797 put it behind UNSLOTH_STUDIO_ENABLE_NPU=1, so /api/npu/status reports supported: false on an XDNA2 NPU unless that variable is set, and nothing in the app says so.

This brings the NPU back by default and makes the first-run notice clearer.

Changes

Backend and CLI

  • An XDNA2 NPU is shown again with the variable unset. UNSLOTH_STUDIO_ENABLE_NPU=0 (or false, no, off) still hides it, and NPU loads, the runtime start and unsloth run / unsloth chat with an NPU id are refused with a message naming the variable.
  • XDNA1 stays unsupported, as before.

Setup notice (model picker NPU section and the Hub NPU list)

  • Before the NPU is enabled, the notice is a short card: "This PC has an AMD Ryzen AI NPU", one sentence saying the NPU runs its own builds of models such as Qwen and Gemma alongside the GPU models, and "One-time setup: downloads about 47 MB and checks the NPU driver." next to the Enable NPU button. The wording reads the same in the model picker and in the Hub.
  • Once enabled, the picker shows one line: "These models run on the AMD NPU, not on the GPU."
  • The runtime names are gone from the notice. The "Powered by FastFlowLM and Lemonade" credit line was already removed in Studio: improve AMD NPU discovery, CLI support, and chat feedback #13797 and stays removed.
  • Errors, the driver setup link, Try again and Start NPU runtime behave as before.

Testing

  • studio/backend/tests/test_npu_detect.py, test_npu_backend.py, test_npu_chat_route.py, test_flm_files.py and unsloth_cli/tests/test_npu_cli.py pass. The detection test now covers unset, empty, 1, 0, false and Off; on main the unset and empty cases fail, since main hides the NPU there.
  • test_export_npu_q4nx.py::test_missing_converter_deps_fail_before_installing fails on main too and is unrelated.
  • Frontend type check is clean and the NPU frontend tests pass.

Screenshots

Two isolated installs, main (ab26545) and this branch. This build host has no NPU, so both Studios were started with the backend's Linux PCI probe reporting a Strix Halo XDNA2 NPU; the gate, /api/npu/status and the frontend are each side's own code. Nothing was enabled or downloaded.

Model picker, Recommended tab, NPU section opened, with UNSLOTH_STUDIO_ENABLE_NPU unset. Main shows no NPU section at all; this branch shows it with the new card:

NPU section with the variable unset, before vs after

The same with UNSLOTH_STUDIO_ENABLE_NPU=1 on both sides, so main's notice is visible too. The runtime names are gone, and the card says what the NPU is for and what Enable does:

NPU setup notice, before vs after

@danielhanchen danielhanchen self-assigned this Oct 21, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-21T19:33:11.670091Z
We couldn’t complete this review. Comment @codex review to try again.
c2cee17 New commits
🔒 Security Review ⚠️ Failed 2026-10-21T14:24:07.164455Z
We couldn’t complete this review. Comment @codex security review to try again.
81b3e72 PR opened
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81b3e72e55

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

Comment on lines +19 to +22
{setUp ? (
<p className="text-muted-foreground">
These models run on the AMD NPU, separately from the GPU models below.
</p>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Render the ready-state notice in the Hub

The new ready-state copy can never appear in the Hub: NpuCatalogList.body() renders NpuSetupNotice only while catalog.ready is false, whereas this branch requires ready && status.runtime_installed. After setup succeeds, the Hub jumps directly to its spinner or model rows and omits the new NPU/GPU separation explanation; include the notice on the Hub's ready path as well.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main renders no NPU notice in the Hub once the runtime is ready either, so this is not a change from this PR; leaving the Hub's ready state as it is.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 378bfab71b

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

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 21, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 21, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 21, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 21, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 53ea70d266

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 53ea70d266

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

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 3010724076

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

@oobabooga

Copy link
Copy Markdown
Member

Here are some before/after live screenshots on the AMD Devlab runners with a real XDNA2 NPU, to document the changes.

UNSLOTH_STUDIO_ENABLE_NPU unset. On main, /api/npu/status reports supported: false, so the model picker has no NPU section. With this PR it shows the new setup card (collapsed by default):

pair_1_gate_picker

The same in the Hub, where NPU is now listed in the Format filter:

pair_2_gate_hub_menu

UNSLOTH_STUDIO_ENABLE_NPU=1 on both sides, so main's notice is visible too. Before setup, in the model picker and in the Hub NPU list:

pair_3_setup_picker

and

pair_4_setup_hub_list

After Enable NPU, which completed on both builds (driver check ready, Lemonade 2026.42.1, FastFlowLM 1.0.9), the picker shows the one-line notice above the live NPU model list:

pair_5_ready_picker

Other checks

  • Merging main into the branch had no conflicts, and none of the 18 main commits it brought in touch the NPU code, the frontend or the bundle budget.
  • On the merge commit, the NPU backend tests (detect, backend, chat route, FLM files: 190) and unsloth_cli/tests/test_npu_cli.py (29) pass.
  • CI on the mirror (CI: show the AMD NPU by default again (#14524 mirror) oobabooga/unsloth#400) at c2cee171be: 77 checks pass. (Python 3.13, a-k) has 2 failures: test_wired_into_the_auto_context_loop fails on main at 4a5a3e5828 too, and the mxfp8 peak test in test_diffusion_comfy_block.py measures diffusion code this PR does not touch.

I did not load or chat with an NPU model, and I did not test Windows.

@oobabooga
oobabooga merged commit 3f22b3d into main Oct 21, 2026
@oobabooga
oobabooga deleted the studio-npu-default-on branch October 21, 2026 21:26
danielhanchen added a commit that referenced this pull request Oct 21, 2026
…o its own build (#14571)

Main is over the startup bundle budget, so "Frontend build + bundle
sanity" fails for any PR built on it:

```
over the startup budget: transfer 2023.3 KB > 2023.3 KB
```

Exact bytes, one machine, Node 24, measured with the checker's own sums:

| build | raw | transfer | transfer budget |
|---|---|---|---|
| before #14508 (`94a8bfacb3^`) | 6,878,900 | 2,071,669 | 2,071,693 |
| `94a8bfacb3` (#14508) | 6,878,900 | 2,071,672 | 2,071,693 |
| before #14563 (`38d21245d0^`) | 6,879,325 | 2,071,834 | 2,071,816 |
| main `5ab80ffdb4` | 6,879,345 | 2,071,823 | 2,071,816 |

#14524 raised the transfer budget to exactly its own measured build
("transfer set to the measured build"), leaving zero headroom. Next to
the other frontend changes that landed around it, the startup set
compresses a few bytes larger (+18 B before #14563, +7 B now). Neither
PR added a large import; the limit simply had no room.

## Change

`transferBytes` is set to the measured main build + 189 B (2,072,012),
the same headroom used for earlier raises, with a comment recording the
measurement. `rawBytes` is unchanged: it is already 244 B above the
measured 6,879,345.

## Testing

- Main build at `5ab80ffdb4` with main's budget: `over the startup
budget`.
- Same build with this budget: `within budget (0.2 KB transfer, 0.2 KB
raw to spare)`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants