Repository navigation
[Bug] AMD NPU: chat titles run on the loaded NPU model and evict the chat's conversation cache, so the next turn re-prefills the whole conversation - #17532
Conversation
The NPU keeps one conversation cache, so a title request on it evicted the chat's prefill and the next turn re-prefilled the whole conversation. The heuristic title is used instead, for both auto titles and the row menu's refresh.
|
Measured on a real NPU: AMD Strix Halo (DevLab runner, Linux), FastFlowLM 1.0.12, Lemonade 2026.44.1, fork phase 5 On FastFlowLM 1.0.12 the title request didn't evict the chat's prompt cache. Both second turns hit it: 3.98 vs 4.01 s to first token on Qwen3.6-35B-A3B-NPU2, and 2.21 vs 2.28 s on Qwen3.5-9B-NPU2, against 11.6 and 5.5 s for the full first read. So this PR has no measurable speed effect on 1.0.12. It still keeps the title off the loaded NPU model, but the speed-up the title describes didn't show up on this build. |
[skip ci]
|
@codex review |
1 similar comment
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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: Didn't find any major issues. Another round soon, 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". |

With auto chat titles on, or when "Refresh title" is used from the chat row menu, the title request went to the active local checkpoint, including NPU models (
lemonade:ids). FastFlowLM on the NPU keeps one conversation cache (on qwen3.8, one conversation slot plus head-only slots), so the title request evicts the chat's cache and the next turn re-prefills the whole conversation, which takes minutes at NPU prefill speed on a long chat. It also ties up the single NPU while the title is generated.titleCheckpointnow returns no checkpoint when the active model is an NPU model, so both paths fall back to the existing heuristic title. A chat answered by an external connection still asks that connection.Tests
New case in
chat-title-refresh.test.ts(fails on main).npu/api.tsimportsauthFetchfrom@/features/auth/apisochat-title.tsstays loadable in the node test harness; thenpu-api.test.tsstub key follows.Tested on Windows 11, Ryzen 9 9950X + 2x R9700, no NPU: frontend typecheck and the 56 related test files (1010 pass). Not run on a Ryzen AI NPU.
Real-NPU measurement (FastFlowLM 1.0.12, Lemonade 2026.44.1, the shipped pins)
AMD Strix Halo NPU (XDNA2, Linux), Studio at this PR's merge base, temperature 0, a ~2,360-token first turn then a follow-up, 4 repeats per variant. Time to first streamed token of turn 2:
On qwen3.5-9b the first two repeats still hit the cache, but once FastFlowLM's conversation caches are full the title request evicts the chat and turn 2 reads the whole conversation again, exactly like the unrelated-chat control. qwen3.8-mtp reads the full conversation every turn regardless, so it is unaffected either way. The title request itself holds the NPU for 3.0 s (9B) and 11.3 s (27B).