Repository navigation
Studio: cap Qwen3.8 NPU context at 8192 - #13525
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. |
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. |
|
pre-commit.ci run |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! 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". |
|
Reached Codex review convergence at oobabooga#363. |
The NPU catalog advertises 262,144 tokens for Qwen3.8-27B (
qwen3.8-mtp:27b, FastFlowLM 1.0.7). Loading it at 16,384 reports success and the NPU status says ready, but every reply then fails with "The NPU model stopped before finishing its reply." (HTTP 502 on the API) until the model is reloaded at 8,192 or less. Reproduced on Linux and Windows.Screenshots
Main vs this change on the Linux NPU runner, Qwen3.8 loaded at 16,384 from the model picker, then asked "What is 2 plus 2?". The context counter reads 16.4k on main and 8.2k here.
Root cause
max_context_windowfrom the checkpoint'sconfig.jsonmax_position_embeddings(read_flm_max_context_window), which is 262,144 for Qwen3.8. Lemonade main still does this.--ctx-lento the engine without checking it. Run directly,flm serveloads at 8192, while 8193 through 16384 all fail withattn_layout: max_len 16512 ... max_len is at most 16384 (MAX_L_LIMIT): any length above 8192 is rounded up past the engine's buffer limit (bisect).flm serveafter its server is up, so lemond and Studio report the model loaded.Fix
max_context_lengthwith a per-checkpoint table of FastFlowLM engine limits, currently{"qwen3.8-mtp:27b": 8192}.LemonadeNpuBackend.load()already clamps a requested context tomax_context_length, and the settings panel and load response read the same field, so a 16,384 request now loads at 8,192.contextLength: model.max_context_lengthinto the handoff, as the picker's NPU rows already do, so the settings panel opened from the Hub has the same bound. On main that panel is dismissed before it can be used (Studio: keep Hub Run settings open on a first Chat visit #13524), so this line shows only once that fix is in.Behavior that stays as on main:
load()already treats every NPU model.Testing
Live A/B on the Strix Halo NPU, Linux and Windows, main at 0f7bdbb against this change, each downloading the 18.1 GB model on a fresh runner and driven by Playwright (run, which also had #13524 applied):
POST /api/inference/loadat 16,384, then/v1/chat/completionsAt 8,192 the model also recalled a code from an 8,177-token prompt on both OSes (run).
test_npu_backend.pyandtest_npu_chat_route.py: 148 passed. The new catalog and load tests fail on main.