Repository navigation
Studio: improve AMD NPU discovery, CLI support, and chat feedback - #13797
Merged
Merged
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. |
Member
Author
|
Reached Codex review convergence at oobabooga#375. |
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Oct 15, 2026
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Oct 15, 2026
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Oct 15, 2026
# Conflicts: # unsloth_cli/commands/start.py # unsloth_cli/commands/studio.py
# Conflicts: # studio/backend/routes/inference.py # studio/backend/tests/test_openai_auto_switch.py
# Conflicts: # studio/backend/routes/inference.py
tsautier
pushed a commit
to tsautier/unsloth
that referenced
this pull request
Nov 6, 2026
…e NPU UI (unslothai#16834) AMD shipped a FastFlowLM fix that Studio users never got: Studio still pinned FastFlowLM v1.0.10 and Lemonade 2026.43.3, because the daily pin update workflow cannot open its pull request in this repository. This PR does four things. ## 1. Update the NPU runtime `studio/lemonade_prebuilt_pins.json`: | | Before | After | |---|---|---| | FastFlowLM | v1.0.10 | v1.0.12 | | Lemonade | 2026.43.3 | 2026.44.1 | Users get this with the next Studio release. Their first NPU use after updating upgrades the runtime in place, as on every pin change. Lemonade stops at 2026.44.1 on purpose. The newest release, 2026.45.3, ships a Linux `lemond` that needs glibc 2.43 and OpenSSL 3.2, so it does not start on Ubuntu 24.04 (glibc 2.39, OpenSSL 3.0). ## 2. Skip pin updates that need a newer glibc `scripts/update_lemonade_pins.py` is what the daily pin update workflow runs to propose new pins. It does not run on users' machines. - **Before:** it always proposed the latest release, so it was proposing Lemonade 2026.45.3, which would have broken NPU chat on Ubuntu 24.04. - **After:** it checks each newer release's Linux binaries and skips any that need a glibc newer than 2.39 (Ubuntu 24.04; FastFlowLM itself already needs 2.39). It proposes the newest release that passes and logs the skipped ones. Hash and size checks still run first, so a bad download is still an error rather than a skip. Run against main's pins, the script now produces exactly this PR's pins file. ## 3. Show the runtime versions in the UI A faint `FastFlowLM v1.0.12 · Lemonade v2026.44.1` line, shown once the NPU runtime is set up, under the NPU models in the Hub and in the chat model picker (screenshots in section 4). It reads the `versions` field `/api/npu/status` already returns. unslothai#13797 removed the "Powered by" line that used to carry these versions. <img width="3432" height="704" alt="pr16834_hub_npu_versions" src="https://raw.githubusercontent.com/oobabooga/unsloth/pr-media/pr/studio-npu-runtime-update/pr16834_hub_npu_versions-78bb5c851e58.png" /> ## 4. List GPU models before NPU models in the chat model picker - **Before:** on the Recommended tab, an NPU group sat at the top of the list, above the Unsloth models. - **After:** the list holds only GPU models. An always-visible "NPU models" footer below it opens the picker's NPU filter, which lists the NPU models with the setup card or the version line. The footer says how many NPU models there are, how many match a search, or "Set up the AMD NPU". The NPU group could not simply move below the Unsloth models: that list loads more models as it is scrolled, about 30 pages and 350 rows on this machine, so the group would sit around 11,000 px down. Search follows the same rule, so NPU matches no longer appear above the GPU results. The On Device tab already lists NPU models after the GPU groups and is unchanged. The Eject model button still floats over the bottom of the list, now just above the footer. <img width="2268" height="1166" alt="pr16834_picker_default" src="https://raw.githubusercontent.com/oobabooga/unsloth/pr-media/pr/studio-npu-runtime-update/pr16834_picker_default-4f10b8ec3a17.png" /> <img width="2268" height="1036" alt="pr16834_picker_npu_opened" src="https://raw.githubusercontent.com/oobabooga/unsloth/pr-media/pr/studio-npu-runtime-update/pr16834_picker_npu_opened-a1a560b307be.png" /> Screenshots: main (`0ab3f0773d`) vs this PR at `0e1f74712e` (`d26ae020a3` after a rebase that changed only a comment in the frontend), two fresh installs, English locale. This machine has no NPU, so `/api/npu/*` was mocked as a ready XDNA2 runtime reporting the versions the DevLab runs below reported. ## Verification - On the AMD DevLab Strix Halo machines, Windows 11 and Ubuntu 24.04, with a real NPU: I enabled the NPU with main's pins, switched to this PR's pins, and the first use upgraded the runtime in place to FastFlowLM v1.0.12 and Lemonade 2026.44.1. `qwen3-0.6b-FLM` then downloaded, loaded and answered a chat request correctly (74 and 81 tok/s). - On Linux Mint 22 (glibc 2.39), Lemonade 2026.44.1 installs and runs, while 2026.45.3 fails with `GLIBC_2.43 not found`. - `test_update_lemonade_pins.py`, `test_install_lemonade_prebuilt.py` and `test_npu_backend.py`: 93 passed. The new tests cover the glibc fallback, a release exactly at the limit, all releases too new, candidate tags, ELF-only scanning, and hash checks running before the glibc check. - Frontend: the NPU and picker node tests (43 passed), `npm run typecheck`, and eslint on the changed files. The full node suite has 17 failures in 14 files: the two that read the picker fail the same way with main's picker files, and the other 12 do not reference the picker or NPU code. - In a running Studio: the picker footer before and after NPU setup, the NPU filter it opens, and the Eject model button's position with a GGUF loaded. ## Not in this PR - The pin update workflow still cannot open its PR. That needs "Allow GitHub Actions to create and approve pull requests" under Settings > Actions > General, or a GitHub App token in `lemonade-pins-update.yml` (which would also run CI on its PRs). - `d3-edge-FLM`, a Decision model new in FastFlowLM 1.0.12, does not load on either DevLab machine (`flm serve d3:edge` exits about a second after it starts). It was not loadable before this PR either, since v1.0.10 does not have it. ## Maintainer follow-up - `scripts/update_lemonade_pins.py` now checks every system library the Linux build links against, not only glibc: a release is skipped if it needs a newer GLIBC, GLIBCXX, CXXABI or OPENSSL symbol version than Ubuntu 24.04 ships (2.39, 3.4.33, 1.3.15, 3.0.9). Lemonade 2026.45.3 needs both GLIBC 2.43 and OPENSSL 3.2.0, so the OpenSSL break alone would have shipped a `lemond` that cannot start, even if a later build fixed glibc. Run live against main's pins, the script still produces exactly this PR's pins file and logs `needs GLIBC 2.43 > 2.39, OPENSSL 3.2.0 > 3.0.9`. - Picker: clicking the "Set up the AMD NPU" footer while a search is active now still shows the setup card, instead of an empty NPU view. - Real NPU runs on the AMD CI Strix Halo machines (XDNA2), Linux and Windows 11: main's pins installed and answered; this PR's pins then upgraded the same install in place on first use to FastFlowLM 1.0.12 and Lemonade 2026.44.1. `qwen3-0.6b-FLM` gave the same greedy reply as before, at the same decode speed (Linux 67.9 vs 67.9 tok/s, Windows 65.6 vs 65.4 tok/s). Before (main) / after (this PR), chat model picker, `/api/npu/*` mocked as a ready XDNA2 runtime:   --------- Co-authored-by: Daniel Han <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chat on the AMD Ryzen AI NPU works once a user finds it. On a Strix Halo machine, though, the NPU section in the model picker would not open from its heading, the CLI could not use NPU models, and one common failure showed a blank reply. This fixes those gaps.
Changes
Chat
stopinstead oflength. API clients now getlengthtoo.CLI
unsloth run --model qwen3-0.6b-FLM(orlemonade:<id>) enables the NPU runtime, downloads the model, and serves it. Before, the id was parsed as a GGUF repo. For NPU models, the banner shows only the chat example.unsloth chat qwen3-0.6b-FLMchats through a running Studio. Without one, it says how to start it instead of crashing.unsloth startexplains that coding agents need a GGUF model instead of looking the id up on Hugging Face.API
/v1/messageswith an NPU model loaded explains that NPU models serve/v1/chat/completionsonly. Before, it said "No GGUF model loaded"."\n\n\n"as content.Limits
Screenshots
Model picker after clicking the "NPU" heading (two isolated installs, NPU responses mocked):
A reply whose reasoning fills a 2048-token context, on the Strix Halo machine:
Verification
On AMD Ryzen AI MAX+ 395 machines, main (A) and this branch (B) were installed from source on Linux and on Windows, and both ran the same steps:
/v1/messageswith NPU loadedunsloth run --model qwen3-0.6b-FLMunsloth chat qwen3-0.6b-FLMOn B, with switching on, requests the NPU model cannot serve were refused without unloading anything (Linux and Windows). On Linux, with a GGUF reply streaming on the iGPU, a request naming the NPU model waited for the reply to finish before loading.
New backend and CLI tests fail without these fixes. The related backend, CLI and frontend suites show no new failures, and the type check is clean.
Before / after (merge base 5e927b0 vs head f39640f)
Two isolated Studio installs, one per commit. The NPU API is mocked in the browser, as in the screenshots above.
Clicking the "NPU" heading text in the model picker. Before, the section stays folded. After, it opens:
The NPU section opened. The setup text is plainer, and the "Powered by FastFlowLM ... and Lemonade" line is gone. It is also gone from the Hub's NPU list:
Every collapsible section opens from its label, not only from the chevron. Here, "Other models" on the On Device tab:
Follow-up changes
active_kv_tokens.total_tokenscame up 3 short when thinking was off, because the empty think block counts four context tokens as one generated token, so the context-window notice did not show.UNSLOTH_STUDIO_ENABLE_NPU=1to use it. Without the flag, an XDNA2 NPU reportssupported: false, so the picker and Hub show no NPU section, and NPU loads, the runtime start, andunsloth run/unsloth chatwith an NPU id are refused with a message naming the flag. The screenshots above were taken with the NPU on.