Repository navigation
Description
Unsloth Desktop on the NPU: FastFlowLM vs onebit
Same box (strixhalo, Ryzen AI MAX+ 395, XDNA 2), same front end, two NPU back ends behind Lemonade. Owner word 2026-11-21: test the shipped AMD path against ours through the same public front end. Source: AMD newsroom 2026-11-19 ("AMD and Unsloth Bring NPU Support to 100+ Agentic AI Apps") — "Enabled through integration with Lemonade and FastFlowLM (FLM)", which is exactly the seam this compares.
Arms (both ours to run, nobody else's product to judge):
| arm | chain | owner |
|---|---|---|
| A | Unsloth → Lemonade → FastFlowLM (the shipped path) | cl-flm |
| B | Unsloth → Lemonade → our engine (onebit recipe, 1bit serve --device npu) |
cl-npurt |
Method (per model both arms run, smallest first — Qwen3-0.6B first because FLM's Qwen3-0.6B-NPU2 is already on this box and our registry ships Qwen3-0.6B on the NPU): decode tok/s, prefill tok/s, first-token time at 3 prompt lengths (short / ~2k / ~8k), ≥ 4 interleaved rounds, ranges not means. Power during decode (NPU/package) if readable, else said so. Agent-app compatibility through Unsloth's own API: one tool-calling request (OpenAI tools schema), one streamed chat, one JSON-mode request — pass/fail with the error text. Greedy text agreement between arms on 5 fixed prompts, same model and quant where possible.
Box facts established so far (measured today, both lanes should correct anything wrong):
- The installed
lemondis stock 10.2.0 and has noonebitrecipe:strings /usr/bin/lemondgivesflm16 /llamacpp13 /npu82 hits andonebit0, and~/lemonade-1180,~/lemonade-3377-fixare empty directories. So arm B builds the fork atthird_party/lemonadeb0f39a7e withscripts/build-lemonade.sh ~/.cache/lemonade-pin, then runsLEMONADE_ONEBIT_BIN=<1bit> …/bin/lemond(docs/lemonade.md's own recipe). Arm A can use the stock lemond or the fork withLEMONADE_ONEBIT_BINunset — cl-flm to say which, and the version/sha recorded either way. - Unsloth Desktop's headless half is Studio, not the Tauri app:
Unsloth-Desktop-Ubuntu.deb(release v0.1.922-beta, 2026-11-20) shipsusr/bin/unsloth-studio, which panics without a display (Failed to initialize GTK) — but its own installer (unsloth.ai/install.sh --local --no-torch) creates$STUDIO_HOME/unsloth_studio/bin/unsloth, and that is the server entry the installer wires as--host … --port …. So no Xvfb; the comparison runs the API, which is what an agent app consumes anyway. - The API is what makes this testable at all: Unsloth speaks OpenAI
/v1/chat/completionsand Anthropic/v1/messageson one port, and can point at "your own remote OpenAI-compatible endpoint" — that endpoint is Lemonade.
What each arm records in this thread: versions and shas (Lemonade, FLM or 1bit, Unsloth, model dir + quant), the exact command line, cat /sys/module/amdxdna/srcversion per run, and the numbers in the table below. Any run inside npu-hold only; a new amdxdna IO_PAGE_FAULT/TDR stops that lane's runs and is reported here with the command.
| model | arm | decode tok/s (short / ~2k / ~8k) | prefill tok/s (~2k / ~8k) | TTFT short / 2k / 8k | rounds | srcversion | notes |
|---|---|---|---|---|---|---|---|
| Qwen3-0.6B | A (FLM 1.0.13) | 97.55 / 48.60 / 20.55 | 2148-2244 / 998-1459 | — | 4 | 5682285F370899D14A057FF | cl-flm, FLM's own log |
| Qwen3-0.6B | B (onebit) | 3.51-3.68 / 3.25-3.59 / 3.20-3.68 | ~190 cold / 1008-4384 hit | 0.99 / 4.11 / 9.38 cold | 4 | 5682285F370899D14A057FF | cl-npurt, per-op build (no private route) |
| Qwen3-0.6B | B (onebit, shipped dx) | 82.42-82.49 / 72.60-72.83 / 53.88-54.57 | 99-107 / 98.5 / 79.8 | — | 2 | 5682285F370899D14A057FF | cl-npurt, engine 8da5bca6 + dx add-on 890e478, 31 Oct dx kernels |
| Qwen3-1.7B | A (FLM 1.0.13) | 46.51 / 36.33 / 17.34 | 880-1443 / 742-1083 | — | 4 | 5682285F370899D14A057FF | cl-flm, same artifact both arms |
| Qwen3-1.7B | B (onebit, per-op) | 1.34-1.35 / 1.35-1.38 / 1.34-1.38 | ~30 cold / 496-1314 hit | 4.7 s (79 tok) | 2 | 5682285F370899D14A057FF | cl-npurt, FLM's Qwen3-1.7B-NPU2 container |
| Qwen3-1.7B | B (onebit, shipped dx) | 36.52-37.01 / 34.66-34.96 / 30.12-30.19 | 37-45 / 43.2 / 39.3 | — | 2 | 5682285F370899D14A057FF | cl-npurt, dx route, same container |
| Qwen3-4B | A (FLM 1.0.13) | 20.22-20.90 / 16.09-17.46 / 10.64-11.41 | — | — | 4 | 5682285F370899D14A057FF | cl-flm |
| Qwen3-4B | B (onebit, per-op) | 0.47-0.53 / 0.47-0.58 / 0.55-0.57 | ~6.5-11.5 cold / 228-785 hit | — | 2 | 5682285F370899D14A057FF | cl-npurt, FLM's Qwen3-4B-NPU2 container |
| Qwen3-4B | B (onebit, shipped dx) | 16.02-16.06 / 15.16 / 12.90-13.01 | 16.2-17.8 / 17.2 / 15.2-15.7 | 91.4 s at 1394 tok | 2 | 5682285F370899D14A057FF | cl-npurt, dx route, same container |
Headline as of the dx rebuild: arm B is 0.78-0.85x arm A on short prompts and 1.19-2.63x AHEAD of it from ~2k out, at all three sizes — the 6-43x deficit in the per-op rows was the build (no -DONEBIT_NPU_PRIVATE), not the engine. What stays red is prefill: 99/43/16 tok/s flat in prompt length, one position per launch (npu-kernels#75 / engine#3236).
Read every per-op arm-B row as "per-op forward, no private route in the build" — strings on the measured binary finds no dx code, only the -DONEBIT_NPU_PRIVATE refusals, so this is engine A's shipped route against engine B's fallback path (ross, NPU-SERVE-SPEED: ~65 % int8 rm M=16 kernel time + ~0.75 ms hw_context switch per launch; dx + a host lm_head fix reports 72.5/65.0/50.0/37.0 tok/s at 74/394/1394/2959 tokens against 3.71/3.22/2.59/2.28 here). Those post-fix numbers are not in this table yet: they get their own rows, measured with this issue's instrument, when a dx build exists.
Mechanism behind arm B's flat decode (both rungs): 113 host->NPU dispatches per token at ~2.2 ms each, wait ~95% of each launch, per-op forward; fix owned by lane ross (NPU-SERVE-SPEED). Latest full comparison: comment of 2026-11-21T18:3xZ.
Activity
bong-water-water-bong commentedon Nov 21, 2026
Before any numbers: the two arms do not run the same file, and it is the first thing to settle
Qwen3-0.6Bexists twice on this box — ours (~/models/npu/Qwen3-0.6B) and FastFlowLM's (~/.config/flm/models/Qwen3-0.6B-NPU2) — and they are different artifacts of the model, not the same checkpoint in two places:So the two packagings order (and possibly quantise) the tensors differently, and ours carries a
plan.jsonthe FLM directory does not have. The tokenizer is byte-identical, which is the good news: token IDs match, so a greedy token-for-token comparison between arms is meaningful.Why this matters before a single tok/s is recorded: if arm A and arm B read different blobs, then a decode-speed difference is confounded by the artifact, and no amount of interleaved rounds separates them. Three ways to handle it, and I would take (1) if FLM will accept it:
model.q4nx+config.json. For cl-flm: can FastFlowLM load~/models/npu/Qwen3-0.6B(it has the same four-ish files, plusplan.jsonand a differently-ordered blob), or does its loader require the order its own exporter wrote? That is the question this thread needs answered first.My side of (1): our engine takes a Q4NX directory (
model.q4nx+config.json+ tokenizer, andplan.jsonwhen present — docs/npu.md), so if FLM can read our directory, arm B can equally try FLM's directory by dropping aplan.jsonalongside it; I will report whether that loads or refuses, and the refusal text if it refuses.Nothing here changes the plan; it changes what the numbers will be allowed to claim.
bong-water-water-bong commentedon Nov 21, 2026
Arm B is live: Lemonade (our fork) →
1bit serve --device npu, and it settles the artifact question in the best wayChain verified end to end tonight on the NPU (
srcversion 5682285F370899D14A057FF, onenpu-holdticket, no amdxdna fault line):The artifact question I raised earlier is answered by how Lemonade resolves the model: the
onebitrecipe handed1bit serveFastFlowLM/Qwen3-0.6B-NPU2's own HF snapshot (~/.cache/huggingface/hub/models--FastFlowLM--Qwen3-0.6B-NPU2/snapshots/b5847992…), not our~/models/npu/Qwen3-0.6B. So arm B ran FastFlowLM's artifact through our engine — if arm A (cl-flm) loads the same HF repo, both arms run the identical files and the comparison is engine-vs-engine after all, with no need for either side to accept the other's directory. That is the control I asked for, delivered by Lemonade's own resolution.First look, and explicitly not the table numbers yet — one load, 4 interleaved rounds,
max_tokens=32, greedy:Load 6.0 s (plus a 6.2 s warm-up inside it). The wall time is flat across prompt lengths from round 2 on, which is what a prefill that is not the bottleneck looks like at these sizes.
What these are not:
32 / wallis a proxy that includes prefill, so "3.5 tok/s" understates decode and the 8k round-1 figure (1.74) is a cold-cache artifact. The honest numbers are the next step and I will not put the proxy in the table: decode rate from the slope of twomax_tokens(32 vs 128) at the same prompt, and TTFT from a streamed request (firstdata:chunk). Then the same three lengths, 4 rounds, ranges.For cl-flm: two things from this side would make the table comparable — (1) confirm arm A loads
FastFlowLM/Qwen3-0.6B-NPU2(same HF artifact) rather than a local copy, so we know both arms ran the same files; (2) the same two measurements (slope-based decode, streamed TTFT) if your harness can produce them, because wall/32 is not comparable between engines with different prefill paths.Provenance to record with the numbers: engine
2a821b55f6cb, Lemonade forkb0f39a7e9f9a, kernel set~/.cache/scratch-trel3/qwen06-rm-m16(8 ELFs:QKV_K1024_N4096,O_K2048_N1024,GU_K1024_N6144,D_K3072_N1024, plus_m16variants — another lane's artifacts, read-only, mtime Nov 13), checkpointFastFlowLM/Qwen3-0.6B-NPU2@b5847992,srcversion 5682285F370899D14A057FF.bong-water-water-bong commentedon Nov 21, 2026
Arm B's first honest numbers (slope-based decode + streamed TTFT), and the method note that goes with them
Qwen3-0.6B-NPU-1bitthrough our Lemonade fork →1bit serve --device npu, checkpointFastFlowLM/Qwen3-0.6B-NPU2@b5847992, kernel set~/.cache/scratch-trel3/qwen06-rm-m16, engine2a821b55f6cb,srcversion 5682285F370899D14A057FF, onenpu-holdticket, 0 amdxdna / IO_PAGE_FAULT / TDR lines.Why these are different from the first look I posted:
max_tokens / wallincludes prefill, so it understates decode and mixes the two costs. Decode here is the slope between two requests at the same prompt (max_tokens128 vs 32 — prefill cancels), and TTFT is a streamed request's first chunk. 4 interleaved rounds, three prompt lengths, greedy:Load 8.6 s on this run (6.0 s on the earlier one), of which a 6.2 s warm-up is inside the engine's own start.
What I will not claim from this: the ranges overlap at all three lengths and the 8k decode range is wide (2.83–5.22), so at 32→128 tokens the slope is noisy — a longer
max_tokenspair (e.g. 128 vs 512) would tighten it, and that is what the table should carry before any comparison with arm A. TTFT is flat-ish (0.8–2.1 s) and does not grow with prompt length, which is the surprising one and worth a second look: at 1366 prompt tokens a prefill that costs ~nothing would look like this, and the engine's log does say the warm-up covers token-invariant weights only.Method note for whoever repeats this: TTFT done by closing the SSE stream after the first chunk makes Lemonade log 11 ×
(StreamingProxy) Client disconnected during SSE stream. Those are my instrument, not the backend — no watchdog trip, no device line. Recorded here so a later log grep for "error" is not read as instability.bong-water-water-bong commentedon Nov 21, 2026
The chain has three shapes on this box, and the brief's one ("Studio → Lemonade → X") is not the default one
Traced through the installed Studio rather than the blog: Unsloth Studio 2026.11.9 (
unsloth 2026.11.9), self-contained under~/.cache/scratch-cl-npurt/unsloth/studio. What it actually does on Linux x64 for the NPU:direct_flm()(install_lemonade_prebuilt.py:86-90) returns True wheneverhost_asset_key()is notNone— i.e. onlinux-x64/windows-x64— and onlyUNSLOTH_NPU_LEMONADE=1putslemondback. So the shipped managed path isStudio →
flm_host.py→flm(FastFlowLM v1.0.13) → NPU,and
flm_host.pyis Studio's own Python reimplementation of "the slice of lemond's API Studio uses … Started with lemond's arguments" (backend/core/inference/flm_host.py:1-8). One class, two binaries:_server_for(binary)wraps whateverinstalled_lemond(root)resolves —flm_host.pywhen direct,lemondwhen not (npu_backend.py:468-472and:638-646;install_lemonade_prebuilt.py:115-134→:98-113).lemonade_prebuilt_pins.json) forfastflowlmv1.0.13linux-x64is asset sha2567c2ee388f23503f323d6c21beca8401e7ef675ce700a92f2c786ca6581322a72, which is byte-identical to the tarball cl-flm downloaded and recorded in their state today — so arm A's FLM is exactly the one Studio ships, no question about "the version Lemonade expects". The managed Lemonade pin, where used, is 2026.44.1 (lemonade-embeddable-2026.44.1-ubuntu-x64.tar.gz, sha25616f156a7…8e90).UNSLOTH_NPU_LEMONADE=1, Studio downloads and runs its own lemond 2026.44.1, andinstalled_lemond()refuses any other binary because it compares the install marker'ssha256against the pin — replacing it with our fork is not a supported seam (and forging the marker is not something I will do to a public app's install state). Unmanaged: thecustomprovider — "User-supplied OpenAI-compatible server",base_urleditable, streaming/vision/tool-calling alltrue(providers.py,customentry), andvalidate_provider_base_urlkeeps loopback valid on purpose ("Ollama, llama.cpp, vLLM and custom gateways rely on them",providers.py:1012-1030).Proposal for the table (what I will run unless someone objects): both arms through the same Studio path — Studio
customprovider → a lemond one of us runs on loopback → the backend. Arm A: stock lemond 2026.44.1 + FLM 1.0.13. Arm B: our fork's lemond +onebit+ the checkpoint we already agree on. Only the backend varies, the front end is identical, and the three agent-app checks (tool call, streamed chat, JSON mode) then exercise Studio's own OpenAI client rather than my curl. Separately, one descriptive row for what a Linux user actually gets today (Studio →flm_host→ FLM direct, no Lemonade) — recorded as the shipped path, with the note that it has no onebit equivalent and therefore cannot be arm B.Two questions for cl-flm, and the second is the one that makes the pair comparable:
UNSLOTH_NPU_LEMONADE=1, Studio's own lemond 2026.44.1) or a lemond you start on a loopback port?lemond --port 9137 --host 127.0.0.1withLEMONADE_ONEBIT_BINset, and it already loadsFastFlowLM/Qwen3-0.6B-NPU2@b5847992; if your arm A can load that same HF artifact through the same lemond shape, the comparison is engine-vs-engine with no artifact confound at all.Numbers on this side now: the 128-vs-512 slope pair and derived prefill are running under one
npu-holdticket,srcversion 5682285F370899D14A057FF, engine1bit serve -m …/models--FastFlowLM--Qwen3-0.6B-NPU2/snapshots/b5847992… --port 8002 --device npu --alias Qwen3-0.6B-NPU-1bit --ctx-size 32768behind our fork's lemond. Table goes up when the four rounds finish.bong-water-water-bong commentedon Nov 21, 2026
Arm B's table numbers, and the method change that produced them
Qwen3-0.6B-NPU-1bit= our fork's lemond →1bit serve --device npu→ our engine, checkpointFastFlowLM/Qwen3-0.6B-NPU2@b5847992(…/snapshots/b584799232c962f693e0e5be99606fc4eca6811e), kernel set~/.cache/scratch-trel3/qwen06-rm-m16, engine binary~/.local/share/1bit-npu-lane/1bit(commit2a821b55f6cb), lemondthird_party/lemonade b0f39a7e, command line1bit serve -m <snapshot> --port 8002 --device npu --alias Qwen3-0.6B-NPU-1bit --ctx-size 32768. Onenpu-holdticket (2150 s, exit 0),srcversion 5682285F370899D14A057FFat start and at end, 0IO_PAGE_FAULT/TDR/amdxdnalines in the log.Why the numbers are not a slope any more
The handover asked for a longer
max_tokenspair (128 vs 512) to tighten last night's noisy 8k range (2.83–5.22). While running it I found the premise was wrong: the decode rate is not constant within a prompt, so a two-point slope measures the ramp. Turn one of the first attempt: 32 tokens 12 s (2.67 tok/s), 128 tokens 59 s (2.17), 512 tokens 146 s (3.51) — a 2× spread at the same prompt, which is exactly the width of last night's ranges.1bit forward-servereports the two stages itself,timings {prompt_ms, predicted_ms}(app/forward_serve.cpp:957-959, "AMD's two stages, as milliseconds, and nothing derived from them"). So each request now yields its own rates:The 128 request is kept in every round as a witness, not as the table number.
Decode and first-token time, 4 interleaved rounds, greedy, ranges
All 12 rows produced
completion_tokens512 (and 128) except the ~2k 512 requests, which EOSed at 435 — said here rather than averaged in silently; its rate is computed over the 434 tokens it actually produced.Prefill, and the caveat that matters most in this table
The 8k rows'
prompt_msof 319–468 ms is not prefill: Lemonade's prefix cache had already seen the prompt — its own log says[prefix] slot=1 cached=1398 of 1399 reason=hit— so that is a cache-hit time. The only cold prefill evidence is round 1, before any prefix was cached, and it is in the telemetry lines:Two points are enough to separate the fixed cost from the marginal one: solving
t = c + n/ron 399/4.11 and 1399/9.38 gives r ≈ 190 tok/s and c ≈ 2.0 s. So on this box, warm-cache TTFT is 0.8–2.3 s, and a cold prefill is≈ 2.0 s + prompt_tokens / 190. I am reporting that model, not a "prefill tok/s" column that would have been four different cache-hit rates.Power
There is no NPU power sensor on this box:
/sys/class/accel/accel0exposes none, and neitheramd-sminorrocm-smiis installed. What is readable is the package rail,amdgpuhwmonPPT: peak 101–104 W inside every 512-token request at every prompt length, average 21–81 W across rounds. The average moves with the other lanes' GPU work, not with prompt length, so I am not presenting it as arm B's draw — only as the package ceiling while arm B decodes.What I am not claiming
predicted_ms, not in the kernel.Qwen3-0.6Bon the NPU through this engine with the M=16 decode family kernel set (decode family: 4 role(s) at M=16, 0 on M=128); a different kernel set is a different row.Scripts (
~/.cache/scratch-cl-npurt/armB-table.{py,sh}), raw logc3193-timings-run.log, engine log/tmp/lemond-armB-table.log— reproducible with onenpu-holdticket.bong-water-water-bong commentedon Nov 21, 2026
Arm B through Unsloth Studio's own API: three checks, and what "pass" honestly means for each
Chain: Studio 2026.11.9 (
--api-only) → its OpenAI-compatible/v1/chat/completions→ a savedcustomprovider on loopback → our fork's lemond →1bit serve --device npu→ our engine. Onenpu-holdticket (171 s), loadHTTP 200(recipe: onebit, checkpointFastFlowLM/Qwen3-0.6B-NPU2),srcversion 5682285F370899D14A057FFat start and end, 0 fault lines, provider deleted afterwards (204), no process left.How each request is addressed (this was the part that took three tries to get right, so it is written down): Studio's
/v1/modelslists only its managed/GGUF catalog, so acustomprovider's model is not addressable by id —{"model":"Qwen3-0.6B-NPU-1bit"}and"custom/Qwen3-0.6B-NPU-1bit"both answer400 No model loaded. Call POST /inference/load first.The OpenAI route is the same handler as/api/inference/chat/completions(routes/inference.py:33006, mounted at both prefixes,main.py:2243,2253) and it accepts the x-unsloth extensionsprovider_id+external_model(models/inference.py:3380-3402); with those set it routes to the provider'sbase_urlinstead of a local model. Proven before any device time by pointing the provider at a closed port:HTTP 200+ SSE{"error":{"message":"Failed to connect to custom: All connection attempts failed","type":"provider_error","provider":"custom"}}.stream:true)HTTP 200, 193 SSE frames,[DONE], 155 answer chars + 785 reasoning chars, 67.7 stoolsschema,tool_choice:auto)finish_reason:"tool_calls",tool_calls:[{"function":{"name":"get_weather","arguments":"{\"city\":\"Vienna\"}"},"id":"call_0","type":"function"}]— right function, right argument, 35.1 sresponse_format:{"type":"json_object"})HTTP 200,finish_reason:"stop", content{}in 1 completion token (275 ms predicted) —json.loadssucceeds, the object is emptyAnswer text of the streamed chat, verbatim: "A tensor is a mathematical object that generalizes vectors and scalars to describe physical quantities in a way that's consistent with the laws of physics."
Two findings a reviewer of the table should carry
Qwen3-0.6Bis a thinking model here, and the thinking arrives ondelta.reasoning_content, notdelta.content. Atmax_tokens:48the whole stream was reasoning and the client saw an empty answer; the same request at 256 gave 785 reasoning chars then 155 answer chars. Any tool that reads onlycontentwill report "empty reply" on a short budget — that is a client trap I hit myself, and it will hit an agent app the same way.{}— 1 token,finish_reason:"stop",reasoning_tokens: 0.response_formatis honoured in the sense that the output parses, but the model returns an empty object instead of the requested{"city": ...}. For arm A this is the row to compare: if FLM returns a populated object on the same request, this is a real arm-B gap, not a model quirk.What is still open on this issue
FastFlowLM/Qwen3-0.6B-NPU2@b5847992behind the same lemond shape, and the same three checks — same script, different providerbase_url, so the comparison is one line apart.bong-water-water-bong commentedon Nov 21, 2026
The 5-prompt greedy agreement set, arm B's half — and why the first two versions of it were wrong
Arm B is ready to be diffed. The protocol below is what I will hold arm A to, because two earlier versions of this test would have produced a flattering result rather than a true one:
max_tokens: 32e3b0c442…— the sha256 of"". This model spends its first 32 tokens inreasoning_content, so this "agreement test" would have compared five empty strings and passed.max_tokens: 256finish_reason: length, empty content) — so the comparison would have measured truncation, not agreement.max_tokens: 64+/no_thinkThe protocol (identical bytes for both arms — through the same lemond shape,
POST /v1/chat/completions):prompts, verbatim:
The capital of France is·List the first five prime numbers, comma-separated:·What is 17 * 23? Answer with the number only.·Translate 'good morning' into German.·Write exactly one sentence about the ocean.Arm B's answers (
Qwen3-0.6B-NPU-1bit, checkpointFastFlowLM/Qwen3-0.6B-NPU2@b5847992, kernel setqwen06-rm-m16, engine1bit serve --device npubehind our fork's lemond,srcversion 5682285F370899D14A057FF, 0 fault lines):The capital of France is **Paris**.359ff4337837754e/2,3,5,7,11d08c575cbcd690af17 × 23 = 391.f11889feedce2f4b"Guten Tag"d140fb647a21404cThe ocean is a vast, dynamic body of water that surrounds the Earth and plays a crucial role in shaping the planet's climate and ecosystems.22ecdcc41d0df559Three things to carry into the comparison, so a mismatch is not misread:
359ff4337837754ein both the 64-token and the 256-token run, i.e. the same bytes at two budgets. A differing hash from arm A is therefore a real difference, not sampling noise./(/2,3,5,7,11) is this template's formatting artifact, not a wrong answer. If arm A returns2,3,5,7,11without it, record it as a formatting difference and not an arithmetic disagreement — the five numbers are the same.17 × 23 = 391.is correct but not "the number only" as asked, and"Guten Tag"is a plausible-but-not-literal translation (Guten Morgen). Both are places where two engines on the same weights can legitimately diverge, and either divergence is worth more than the four rows where both will probably agree.For cl-flm: same five prompts, same
/no_think, samemax_tokens 64/temperature 0/top_p 1, on arm A behind a lemond you start yourself (so the engine is the only variable). Post the fivecontentstrings — I will diff them and record agreement per prompt, with p2's slash and p3/p4 noted as above. If FLM's template ignores/no_think, say so and give the budget you used: then the honest statement is "agreement under arm A's own no-think mechanism", not a like-for-like.bong-water-water-bong commentedon Nov 21, 2026
The cross-arm number that matters is not the model: arm B is 6–28× slower than arm A, and our decode is flat where FLM's falls
I am putting cl-flm's arm-A figures next to mine because the comparison is now possible, and because the shape of the difference points at something specific in our engine rather than at the model. Arm A's numbers are cl-flm's, from their lane state — they have not posted them to this issue yet, so they are marked as such and cl-flm should confirm or correct them here.
2.0 s + n/190)timings.predicted_ms(mine, posted above)Two different instruments, stated as such: arm A reads FLM's own log, arm B reads
prompt_ms/predicted_msfrom our engine's response. Neither is a client-side wall clock, so the gap is not an instrument artifact — but it is also not yet a like-for-like run (arm A ran FLM directly, arm B ran behind our lemond), and the artifacts may not be the same pack. What would close that: arm A behind a lemond cl-flm starts, onFastFlowLM/Qwen3-0.6B-NPU2@b5847992, with the same request shape as my five-prompt set.The part I would not skip: the shape of the two curves
That is the shape of a launch-bound decoder — a fixed number of host→device round-trips per token (one family launch per stage per layer, with the host between them), not a compute-bound one. 285 ms / 28 layers ≈ 10 ms per layer, which is the right order for an hwctx submit-and-wait, and wrong by two orders of magnitude for 0.6B of 4-bit weights.
Three candidate mechanisms, and the cheap test that separates them (none of these is a conclusion yet):
decode family: 4 role(s) at M=16, 0 on M=128): if tok/s scales with batch, the launches are the bound.lm head: on the host (default; NPU_HEAD_HOST=0 for the device), 25 tiles, 4 threads) → one run withNPU_HEAD_HOST=0; 6.3 M MACs should not cost 285 ms, but this is the only per-token host-side stage the log names.What I am not claiming: that arm A is "the truth" and arm B is broken — FLM's number is its own log for its own pack, and the artifacts are not proven identical. What I am claiming is narrower and, I think, harder to argue with: our decode rate does not move when the context grows 17×, so whatever costs 285 ms per token is not attention or KV. That is worth an owner decision on where the next NPU window for this lane should go, and I am asking cl-flm to post their row so the table stops resting on their state file.
bong-water-water-bong commentedon Nov 21, 2026
Where our 285 ms per token goes: 113 host→NPU dispatches, ~2.2 ms each (the engine's own profile, not a hypothesis)
One run, one ticket (
clNpurt-3193-prof, 16 s,srcversion 5682285F370899D14A057FF, 0 fault lines), the same stack as the table: lemond →1bit serve --device npu, kernel setqwen06-rm-m16,Qwen3-0.6B-NPU-1bit, 16 greedy tokens. Instrument:NPU_PROFILE=1 NPU_PROFILE_TOKEN=1, which the tree already carries (npu/forward/src/q4nx_forward.cpp:6825-6836).The dispatch count per token, from the engine's own counter — identical for every token:
The per-role launch table (ms, one window):
113 dispatches × ~2.2 ms ≈ 250 ms, against a measured 262 ms between tokens (3.8 tok/s) — the arithmetic closes, so this is the whole of our per-token cost, not a slice of it.
packis 0.00 ms andquant+lnchis 0.05–0.13 ms: the host side is not the problem;waitis, i.e. the device's own per-dispatch latency at these tile shapes (QKV M=16 K=1024 N=4096 is 67 M MACs — 2.2 ms for that is ~30 GFLOP/s, two orders below what this part does when fed properly).So the earlier "launch-bound" reading is now a measurement, and it explains the flat curve as well: 113 dispatches per token is a constant, independent of context, which is exactly why arm B's decode does not move from 79 to 1399 prompt tokens while FLM's falls with context.
What this says about the 15–28× gap, and what it does not
waitshare is ~95 % of the per-launch cost, so a fused program would pay it once instead of 113 times.HEADis 3.28 ms per token (M=1, on the host) — about 1.3 % of 262 ms.NPU_HEAD_HOST=0cannot move this number, and I will not spend a ticket on it.The decision I am making rather than asking for
My lane's next NPU window on this issue was going to be "batch M=16 to see if launches are the bound". The profile already answered it (they are, 113 of them), so I will not spend a window re-measuring batching. The open question is now a kernel-granularity one — how few dispatches can one decode token be made of at M=16 — which is npu-kernels work, not host-runtime work, and I would rather hand that number over than start it in my lane. ORCH: do you want this filed against npu-kernels (decode-side twin of #75), or kept here as arm B's mechanism note?
bong-water-water-bong commentedon Nov 21, 2026
Arm A (FastFlowLM behind the front end) — measured, and the front end can reuse the same harness. My part of the brief: the FLM install/version and the model list both arms can run.
What is installed (reproducibility, since Lemonade pins nothing)
Lemonade's FLM backend resolves the binary at runtime (
find_flm_executable(): config bin override → PATH → Lemonade's managed dir → else "not found");flm_version()shells out to it. So there is no version constant to match — the recorded sha is what makes arm A reproducible:v1.0.13(published 2026-11-13), assetfastflowlm_1.0.13_linux.tar.gz, 47,740,641 B, sha2567c2ee388f23503f323d6c21beca8401e7ef675ce700a92f2c786ca6581322a72flmlauncher sha25654232a857cabd46a9977597b9657b9d50b27b8313c10e9074c4f77b7c0327965;flm-realsha256e4321f5bff6f2145e9e140efbb10a19fb21ec63df210886c24bcf9ad32a8dbb2flm --version→FLM v1.0.13; the HRX build (HRX_fastflowlm_*) was deliberately not used — this comparison is the XDNA 2 / XRT pathflm validate --json→"ready": true,all_fw_ok: true, aie2p, 8 cols,enough_cols: true, kernel7.4.0-rc1-1bit, memlock infinity, driver5682285F370899D14A057FFModel list both arms can run
flm liston this box:qwen3:0.6b✅,qwen3:1.7b✅,qwen3:4b✅ (the 4B pack was pulled for this test, 3.1 GB,Qwen3-4B-NPU2), pluslfm3:1.7b✅,medgemma:4b✅,embed-gemma:300m✅ and thed3:*family. Note~/models/Qwen3-4B-Q4_K_M.ggufis not usable here: the GGUF belongs to the llama.cpp/HRX path, FLM's NPU route reads its own-NPU2pack.Numbers (Qwen3,
--pmode performance, 4 interleaved rounds, taken from FLM's own per-request log)Two readings worth carrying into the comparison: prefill is where the models separate (0.6B ≈ 2.2k tok/s at 2k vs 1.7B ≈ 0.9–1.4k), and decode at 8k converges to ~20 tok/s for both — the KV-bound regime does not care about model size. Every run:
npu-hold, its own ticket, driver recorded,amdxdna 446 → 446(no fault lines in any arm-A window).Agent-app compatibility (the part that matters for Unsloth)
toolsrequest gets prose back and notool_callsfield at all (raw: None). Recorded rather than argued — the same client, same run, passes JSON mode ({"ok": true}parsed) and streaming.--dump-streamprints the raw shape next run), not an FLM failure claimed on my side.For arm B
The harness is black-box HTTP only and takes a
--base/--model, so the onebit arm is measured by the same program with no changes:python3 unsloth_probe.py --base http://127.0.0.1:<port> --model <tag> --rounds 4 --out <file>It reports decode as
ctok/(wall − ttft)and prefill asptok/ttft(a first version divided by total wall time and produced a decode column that fell 20× with prompt length — that number is retracted here and is not in the table above).--from-flm-logreads FLM's own log lines when the server reports them, which is where these numbers come from.Not claimed: no 4B numbers yet, no Unsloth Desktop run (that is cl-npurt's arm), and arm A was measured through
flm servedirectly — attaching it behind the Lemonade/Unsloth front end may add its own overhead, which the first end-to-end run should quantify rather than assume.bong-water-water-bong commentedon Nov 21, 2026
Not the kernel set: four complete M=16 sets, three different
_m16hashes, all 2.8–3.7 tok/s — and the engine's own 0.34 ms figure is not reproducible by any of themBefore blaming the engine I had to rule out the cheapest explanation: arm B runs a kernel set another lane built (
qwen06-rm-m16, Nov 13), and the box has three more complete Qwen3-0.6B M=16 sets with three different_m16QKV ELF hashes. One ticket (clNpurt-3193-kernsets, 67 s,srcversion 5682285F370899D14A057FFat both ends, 0 fault lines, 4 loads + 4 requests), same engine, same model, same greedy request — onlyONEBIT_NPU_KERNELSchanged:_m16QKV sha256scratch-trel3/qwen06-rm-m16(what the table used)6d100333…/2,3,5,7,11scratch-cl-game/proof/after-t40ef061379…/2,3,5,7,11scratch-cl-flm/q06-kernels72bdee68…/2,3,5,7,11wt/cl-game/bin/npu-kernels-qwen3-0.6b-m16ef061379…/2,3,5,7,11Three things this settles:
after-t40one are within 6 % of each other; cl-flm's set is 25 % worse, not better. No set reproduces the ~0.34 ms per M=16 launch thatnpu/forward/include/q4nx_pack.h:70-77documents — every set lands at 1.5–4.2 ms, 5–12× the documented figure. That makes the 0.34 ms the thing to explain, and it is a kernel/npu-kernels question, not a runtime-selection one.decode family: 4 role(s) at M=16, 0 on M=128and 12init_elf … _m16.elf M=16lines. Decode really is the 16-row design; it is just not paying off as the header says it should./2,3,5,7,11, including the template's leading/). Whatever differs between these sets, it does not change the answer on this prompt.So the gap to arm A stands as measured — 113 dispatches/token × ~2.2 ms — with the mechanism now pinned to per-launch device time at M=16, reproducible across every kernel set on the box, and no host-side or kernel-selection fix available. That is the number I would hand npu-kernels (twin of npu-kernels#75), and it is where my lane's part of this issue ends: arm B's throughput, its agent-app checks, its agreement half and its mechanism are all measured here; what remains is arm A's row, which is cl-flm's to post.
bong-water-water-bong commentedon Nov 21, 2026
Handover to lane ross (NPU-SERVE-SPEED): the decode fix is yours; here is what is already measured so you do not re-run it
Per the orchestrator: ross owns the ~2.2 ms/dispatch root cause and the fix (fewer dispatches / chained submits / route). I keep arm B's measurement and agreement half and will not touch the decode path. Everything below is on the box today,
srcversion 5682285F370899D14A057FF, one ticket each, no fault lines.Already measured — do not spend a window re-deriving these:
NPU_PROFILE=1 NPU_PROFILE_TOKEN=1,[prof] token N: decode dispatches=113,decode/token=120.7), i.e. the per-op forward's 4 roles × 28 layers + the host head. Count is a design constant, not context-dependent — which is why arm B's decode stays flat (3.5/3.3/3.4 tok/s at 79/399/1399 prompt tokens) while FLM's falls (97/48/20).[prof]per-role table): QKV M=16 2.21, O 1.51, GU 2.90, D 1.77 ms/launch;pack0.00,quant+lnch0.04–0.08,wait2.1–2.9 of it. Host head (M=1) 3.28 ms = 1.3 % of the 262 ms token, soNPU_HEAD_HOST=0is not worth a ticket._m16QKV hashes → decode 3.72 / 3.52 / 2.81 / 3.50 tok/s, per-role launches 1.5–4.2 ms. The best set is the one already in use; cl-flm's set is 25 % worse. None reproduces the ~0.34 ms per M=16 launch documented atnpu/forward/include/q4nx_pack.h:70-77— that documented figure is now the thing to explain.decode family: 4 role(s) at M=16, 0 on M=128and 12init_elf … _m16.elf M=16lines./2,3,5,7,11), so a decode-path change can be checked for text drift on that prompt.On your "why is the dx route not used" question, one concrete lead from the code, not from me measuring it: arm B's model is a model-generic container —
model.q4nx+config.json+tokenizer.json(+plan.json), exactly what our converter/packer emits and what we publish, and exactly what Lemonade'sonebitrecipe hands1bit serve -m <dir>. That container type is routed to the per-op forward on purpose (app/serve.cpp:3527-3562, engine#1129/#1740): a private route (dx) wants its own model directory, and--npu-optis refused on a model-generic container rather than silently ignored ("a W6 run asked for the fused route, got per-op, and produced identical numbers, which reads as 'no gain' rather than 'wrong route'"). Our serve log says it in one line:So the dispatch count is the per-op forward's own design (one launch per role per layer), and the dx route is not reachable from this container without either a dx-shaped model directory or changing what the per-op path does. That is the fork in the road your brief names, and it is now stated with the code line that causes it.
Artifacts (mine, reusable, no rebuild needed):
~/.cache/scratch-cl-npurt/prof-decode.sh(profile + per-token dispatch table),kernelset-compare.sh(four-set comparison), logsc3193-prof-run.log,c3193-kernelsets.log,c3193-timings-run.log(the 12-row table). Arm B's model isFastFlowLM/Qwen3-0.6B-NPU2@b5847992; the stack is our fork's lemond (third_party/lemonade b0f39a7e) →1bit serve --device npu.What is still mine and still owed here: arm A's row (cl-flm has the numbers, has not posted them) and the 5-prompt agreement diff once they do. Ping me if a decode-path change needs a before/after on this same table — that is a measurement I will run.
bong-water-water-bong commentedon Nov 21, 2026
Arm A 4B added, and my 1.7B "stream failure" is retracted — it was my parser.
qwen3:4b(FLM 1.0.13,--pmode performance, 4 interleaved rounds, ownnpu-holdticket, driver5682285F370899D14A057FF, amdxdna 626 -> 626, no fault in my window):Streaming mystery resolved, and the correction is mine: FLM streams Qwen3 tokens as
choices[0].delta.reasoning_content, notdelta.content—--dump-streamprinted the raw chunk. My earlier 1.7B run used a parser that did not read that field, so "no chunks recovered" was my defect; with the fix, 4B reportsstreaming: true. The 1.7B agent-check row should therefore be re-taken, not read as an FLM fault.Agent checks on 4B: tool_calling false, streaming true, json_mode false — so tool calling now fails on every arm-A model measured (0.6B, 4B), while JSON mode is model-dependent (pass 0.6B, fail 4B).
One caveat before the 4B row is read as kernel behaviour: its prefill is lower than 0.6B's, which is consistent with the 4B preferring reasoning output (
reasoning_contentcarries the first tokens) rather than with a prefill property — that needs one explicit run with reasoning off before anyone compares it to arm B.bong-water-water-bong commentedon Nov 21, 2026
Arm A final rows: 1.7B re-taken, and my 4B "reasoning" caveat is withdrawn by measurement.
One 40-min
npu-holdticket, two runs, amdxdna 626 -> 626 in both (no fault lines in my windows), driver5682285F370899D14A057FF.delta.reasoning_content): decode medians 46.51 / 36.33 / 17.34 tok/s at short / ~2k / ~8k,streaming: true,tool_calling: false,json_mode: false. This replaces the earlier row that read as a stream failure — that was my parser.think: false: 20.22 / 16.09 / 10.64 against 20.90 / 17.46 / 11.41 with reasoning on. The shift is inside the run-to-run spread, so reasoning output was not inflating the 4B figure — the 4B is simply slower at every length, and the caveat I put under that row is withdrawn.Final arm A (decode tok/s median, FLM 1.0.13,
--pmode performance, 4 interleaved rounds, numbers from FLM's own per-request log):Agent-app, all three models: tool calling fails everywhere (no
tool_callsin the reply, prose instead); JSON mode passes only on 0.6B; streaming works everywhere once the client readsreasoning_content. Arm A is complete for this test as far as the FLM side goes; what remains is arm B (same harness,--base) and the end-to-end run through the Unsloth front end, where any added overhead is the front end's to show rather than assumed.bong-water-water-bong commentedon Nov 21, 2026
The comparison, both arms, three sizes — arm A is 6–34× faster at decode, and arm B is the only one that can call a tool
Arm A is complete (cl-flm's final rows above), arm B now has the 1.7B rung measured the same way as 0.6B. Both sides report server-side rates, not client walls: arm A from FLM's own per-request log (
--pmode performance), arm B from the response'stimings {prompt_ms, predicted_ms}.Decode, tok/s (A over B, and the ratio)
Arm B's 1.7B artifact is FastFlowLM's own
Qwen3-1.7B-NPU2container (model.q4nx+config.json+tokenizer.json), the same bytes arm A's FLM reads, with the row-major M=16 kernel setq17rm-kernels; serve logdecode family: 4 role(s) at M=16, 0 on M=128. Two rounds × 3 lengths,srcversion 5682285F370899D14A057FFat both ends, 0 fault lines.The shape that explains the gap, at both rungs
wait≈ 95 % of each launch, on the per-op forward (NPU_PROFILE=1run, and four kernel sets reproduce it). A constant dispatch count cannot grow with context, which is exactly the flat curve. Lane ross now owns the fix; the dispatch count is the per-op forward's design, and dx is unreachable from a model-generic container (app/serve.cpp:3527-3562, engine#1129/npu-pack: the 1.9 .fconst tail head carves exactly (V/64 tiles) but decodes to nothing -- tied and untied packs, same signature #1740).Prefill
t ≈ 2.0 s + n/190 tok/s(cold), 1008–4384 (prefix-cache hit)Arm B's prefill at 1.7B is the worse half of its own result: ~30 tok/s cold against arm A's ~1000, and it improves 16–40× on a prefix-cache hit — which is the honest reading of "second request is fast": it is the cache, not the engine.
Agent apps — the row where the slow arm wins
delta.reasoning_content)tools)tool_callsfinish_reason:"tool_calls",get_weather{"city":"Vienna"},id:"call_0"response_format){}in 1 tokenThrough Unsloth Studio's own
/v1/chat/completions(acustomprovider on loopback → our lemond → our engine), not just my curl.Agreement set — arm B's half at both rungs, ready to diff
1.7B,
/no_think,max_tokens 64, greedy:The capital of France is **Paris**.359ff4337837754e2, 3, 5, 7, 11428cb33a87274278391a934c244755c66aeGuten Morgen.20d05c5530687ea5The ocean covers more than 70% of the Earth's surface and is home to diverse ecosystems and marine life.d0bc9f37d062b0a9Two things worth noticing, and one warning:
359ff433…) — same template, same answer across model sizes. So agreement must be judged per rung, never pooled: identical hashes across sizes are not evidence of engine equality./, p3 answers391(the number only, as asked — 0.6B wrote17 × 23 = 391.), p4 gives the literalGuten Morgen.where 0.6B saidGuten Tag.--baseis the like-for-like instrument — point it athttp://127.0.0.1:9137while arm B serves (I will hold a ticket and tell you the window), or run the five prompts above on arm A and post the fivecontentstrings. Either way the diff is one command on my side.What I am still not claiming
Arm B has no 4B row; the two instruments differ (FLM's log vs our
timings) even though both are server-side; and the decode gap is now a known defect with an owner (ross), not a property of the model or the artifact — which is the useful thing to carry: on identical bytes, the same model runs 27× faster on FLM, and the reason is 113 dispatches of ~2.2 ms, not anything about Qwen3.14 remaining items
bong-water-water-bong commentedon Nov 22, 2026
Ruled out the last thing I can check from the host side: the 1.7B set's metadata and file structure are uniform with the two shapes that answer correctly
I cannot debug a kernel from here, but I can remove the cheap hypotheses before handing it over. Comparing all three shape dirs of the 31 Oct set (
7eababb187cf1408):1024x3072x16x82048x6144x16x82560x9728x32x8layer1.elfFour hypotheses this kills:
layer1.elffiles are distinct from each other and from the 0.6B/4B ones (unique sha256 per file, sizes forming a monotone band between the other two shapes), so it is a real 1.7B generation, not a 0.6B build dropped in.65,97,2081,2113,2145) × (plain,np) — with one ELF per group, and the 1.7B set has all ten.layout.jsonfor 1.7B declares H=2048, IM=6144, NH=16, NKV=8, HD=128 — exactly Qwen3-1.7B — and itsIMPequalsIMlike the 0.6B's does (only the 4B pads its intermediate, to 10240). So "wrong padding" is not the 1.7B-specific difference.PER/TPC/KTcounts being off by one relative to role count: the three shapes have 5 / 6 / 7 design classes for 4 / 4 / 4 roles respectively, i.e. the count grows with model size in the same way at each rung, so 1.7B's 6 is not anomalous.What that leaves, stated as the boundary of my evidence: the difference is inside the 1.7B ELF content (a tiling or descriptor bug in that generation) or in how the host drives that particular shape — and the host side is shared with the two shapes that answer correctly, which is why I keep pointing at the former. Reproducer is one command (
List the first five prime numbers, comma-separated: /no_think, greedy →3, 5, 7, 11, 13, 5/5), and I will run the same five repeats against any regenerated 1.7B set in a single ticket.bong-water-water-bong commentedon Nov 22, 2026
One measurement caveat for this comparison, found while re-censusing the runtimes on the box (device-free): the Unsloth Studio chain runs a ROCr build that exists nowhere else here, so a cross-chain number is not on the same runtime as
1bit serve.Why it matters here three ways:
1.21.1-3309c6114ais new — it is in theuvcache and in Unsloth Studio's ownsite-packages, i.e. on thearm this issue's chain runs (Studio → Lemonade → FLM/1bit). It appeared in neither the 11-03 count (3 builds) nor
the 11-21 count (5 builds), and the previous census in
FACTS-hip-compat.md§3.5/§0.3 is now updated with it.symbol-wise 1.21 → 1.22 adds five
hsa_*entry points the driver never resolves and 1.21 adds none over 1.22, andthe flat-kit/
RPATHdifference is a packaging change, not a code path. The 6–34× decode difference measured herestands on its own mechanism (the ~2.2 ms/dispatch
wait), not on which ROCr is loaded.srcversion, which this issue already asks for. A number from Studio and anumber from
1bit serveare two runtimes apart; a number from a hand-launchedloom-serveis a third (1.18.0,the distro copy — the one that cannot even create a queue through the pinned driver).
Method note so nobody repeats my first attempt:
sha256sum -Lis not asha256sumoption, and it fails silentlyin a
while readpipeline — the first pass produced empty digests and I only noticed because six distinct "hashes"turned out to be the size column. Identity here is the
ROCR BUILD IDstring; the digest confirms it.bong-water-water-bong commentedon Nov 22, 2026
The 1.7B wrong answer is not a kernel defect at all: the private route renders a different prompt — a
#963-class defect, still live on the path Lemonade drivesI went looking for a way to separate "the dx kernels are wrong" from "the host drives them wrongly", and the answer was one request per route on the same container:
The same request produces a five-token-shorter prompt on the private route. That is a prompt-construction difference, and it is visible without a device — the hand-rolled renderer in
app/unified.cpp:155reproduces the dx count exactly:Why this is a defect and not a preference
app/unified.cpp:155is a second, hand-rolled ChatML renderer.app/npu_template.h— the file that exists for exactly this — states the rule in its header:The per-op forward honours that (it renders the container's template, or the built-in qwen3 one when the container declares none — this container's
config.jsonhas nochat_template). The private route path inunified.cppdoes not: it renders ChatML and never consults the template machinery. So a#963-class defect is still live on the very path Lemonade'sonebitrecipe drives for NPU serving.What this changes about my earlier reports
unified.cpp, and it is not shape-specific — 1.7B is just the model that is least robust to a 5-token prompt difference. 0.6B and 4B answering correctly is luck, not evidence of health.unified.cppto use the template renderer, then re-run the five-prompt set once on the device.dx), and the per-op ones through the template path — a confound I did not know about when I reported the p2 difference. Thep2divergence is this defect's symptom, not an engine difference.The fix I would propose (host-side, my lane)
Render the container's template in
unified.cppthe wayforward_servedoes — same renderer (npu_template.h), same built-in qwen3 fallback when the container declares none, and the same refusal instead of a silent ChatML fallback when a declared template cannot be rendered. That is a larger change than the constraint refusal and touches the same handler, so I would want it as its own PR after the current one lands rather than stapled on. It is also exactly the kind of thing a device-free golden test can pin:tests/npu_template_test.cppalready byte-compares renders against Jinja2, so the new arm is "the private route's prompt equals the per-op route's prompt for the same request".bong-water-water-bong commentedon Nov 22, 2026
Exact cause, pinned to five tokens: the container's template emits an empty system turn and the private route's hand-rolled ChatML does not
Rendering this container's own template (
tests/data/templates/qwen3_flm.json, the FLM Qwen3 template) for the exact request I sent gives 27 tokens, byte-identical to what the per-op route reported — and the diff againstunified.cpp's ChatML is two lines:So the whole 1.7B "wrong answer" is: the private route serves the prompt without the empty system turn the model's own template always emits, and
2falls out of "the first five primes". Five tokens —<|im_start|>,system,\n,<|im_end|>,\n— and the tokeniser agrees to the token:unified.cpp:155→ what dx is served)3, 5, 7, 11, 13enable_thinking=True(what per-op renders)2, 3, 5, 7, 11enable_thinking=FalseReproduce the render without a device (
jinja2+ the repo's golden template + the container'stokenizer.json) — no engine, no NPU:The fix, and the arm that pins it
unified.cppmust render the container's template throughapp/npu_template.h— the same rendererforward_serveuses, with the same built-in qwen3 fallback when the container declares none (this one declares none, so the FLM golden template is the right expected value for the test) and the same refusal rather than a ChatML fallback when a declared template cannot be rendered. The arm is device-free and exact:That is a better gate than "the answers agree": it names the defect even when the answer happens to survive (0.6B and 4B both answer correctly through the wrong prompt, which is exactly why this survived until a 1.7B run).
I am not stapling this onto the constraint-refusal change: it is a different component in the same handler, it is the
#963fix arriving on the path Lemonade drives, and it deserves its own diff with that golden arm. Recorded here so the next session starts at the render, not at the kernels.bong-water-water-bong commentedon Nov 22, 2026
State for this issue, one screen, so the release decision does not depend on reading the thread.
Arm A (FastFlowLM behind the front end) — measured, on this box, tonight. FLM 1.0.13 at
~/.cache/lemonade/bin/flm/npu/(the dir Lemonade's resolver finds; PATH untouched) with tarball/flm/flm-realsha256s recorded;flm validate --json→"ready": trueon driver5682285F370899D14A057FF. Numbers from FLM's own per-request log,--pmode performance, 4 interleaved rounds:Agent-app, all three models: tool calling fails (prose, no
tool_calls— cross-posted to #3248, which would refuse instead of lying; the results table should read arm A lies by omission / arm B names the refusal, not "both fail"), JSON mode passes only on 0.6B, streaming fine everywhere once the client readsdelta.reasoning_content(that mis-read is what made me retract a row).Arm B: not started — it needs the front end up (cl-npurt). When it is, arm B is one command:
tools/unsloth_probe.py --base http://127.0.0.1:<port> --model <tag> --rounds 4 --out armB.json, same JSON shape out of both arms.PR for the release: engine#3270 — undrafted, CI fully green (
build13m26s, CodeQL, five Analyze rows, pr_agent, reviewer),mergeable_state: clean, localpre-pr-checks --base gh/main16 green / 4 skipped / 0 cannot-tell. Two new files and oneadd_python_testline; no existing behaviour touched, so it is safe to carry in c34 and it does not close this issue — the comparison still has to be run.bong-water-water-bong commentedon Nov 22, 2026
Update on the 1.21.1 I flagged an hour ago — it is worse than "a third version": that build cannot create a queue, so anything that resolves it registers no device at all.
nm -Don every runtime in the census, for the one symbol the loader resolves by name (a miss is a hardNOT_FOUND, not "unsupported" — it is why the distro's 1.18.0 never registers HRX0):And it is not a spelling difference: the 1.21.1 file has 0 occurrences of the string and 0 dynamic symbols of that
name — it exports
hsa_queue_createandhsa_soft_queue_create, i.e. it is missing thehsa_amd_*call the driverasks for. So a process resolving Studio's own runtime is in the same class as the distro copy, not one version behind
the pin: HRX initialisation fails (
NOT_FOUND; symbol 'hsa_amd_queue_create' not found in library) and the backendregisters no devices.
Why that matters for this comparison rather than for the model: if any arm is launched by Studio's own launcher (as
opposed to a
1bit servechild with the pin'sLD_LIBRARY_PATH), the failure it shows is a device failure with aruntime message — which reads like "the NPU/GPU path does not work" rather than "this process loaded the wrong
libhsa". Worth one grep of the arm's log for
hsa_amd_queue_create/hrx_gpu_initializebefore any number from thatchain is compared, and worth recording the runtime build id per run next to
srcversion, since 1.21.0, 1.21.1 and1.22.0 are all on this box and only two of the three can register a device.
Recorded in
FACTS-hip-compat.md§3.5 with the per-build table (and the release-relevant half: the c34 images carrythe pin's
430d3d8f, so the stick's runtime is not the one with the missing symbol).bong-water-water-bong commentedon Nov 22, 2026
A flaky ctest row is now on main, and I have the measurement (found while verifying #3280, which landed as
08de37b17):tools/unsloth_probe.py's self-test spawnstools/sse_stub.pyon a derived fixed port —so two runs that overlap collide, and the probe then reports the symptom, not the cause:
Who overlaps: two lanes running the pre-PR gate or
ctestat once (this box does that constantly), a parallelctest -jif a second row ever drives the stub, and — the case I hit — a stub that outlives its parent for a moment between two runs a second apart.Connection refusedis what the probe sees; nothing in the output says "the port was taken".The fix is small and belongs with the fixture: let the stub bind
":0"and print the port it got on its first line, with the probe reading that line back (it already spawns the stub as a subprocess, so this is onereadline()), or keep the derived port and retry onEADDRINUSEwithSO_REUSEADDR. The first is what I would do — it removes the class rather than the instance, and it is the same lesson as the cache-hit kernel set today: a fixed port in a shared box is a latent flake, and the failure it produces is always read as something else.Not filing a separate issue and not opening a PR: engine is at six open (one non-draft, five drafts), so a test-fixture PR waits for the queue, and this note is what a c35 pick-up needs.
npu: the private route renders the container's template, not ChatML (…
npu: tools that are only offered are dropped, not refused (engine#328…
bong-water-water-bong commentedon Nov 22, 2026
Arm A and arm B behind one lemond, same files, same request bytes, on the c35 appliance
The first run that matches the issue's design: one lemond process. Only the recipe changes between arms.
/opt/1bit-package/bin/lemond(2026.49.0~1.4bd453a0), a second instance of mine on127.0.0.1:13410with its own cache and config under/data/dev/cl-flm. The box's lemond on :13300 and the proxy on :13305 were not touched.qwen3-0.6b-FLM(recipeflm) → FastFlowLM 1.0.13 (flm.prefer_system: true; tarball sha2567c2ee388…2a72,flm-reale4321f5b…). Note that this lemond pins FLM v1.0.11; 1.0.13 is the version Unsloth Studio pins.Qwen3-0.6B-NPU-1bit(recipeonebit) →/opt/1bit-package/1bit/1bit serve --device npu --ctx-size 32768, engine31a7a523be0c(c35 package), env as/opt/1bit-package/lemond-onebitsets it.FastFlowLM/Qwen3-0.6B-NPU2@b5847992, withmodel.q4nxsha256db8dec4d…a667in both places. This is an engine-vs-engine comparison with no artifact confound.srcversion F87D0BDF248067862F83BA3(new on this appliance; the earlier rows in the table were on5682285F). Every window was underbox-hold npuwith 0 amdxdna fault lines before and after.armB-table.pyverbatim (same prompts, a 128-token witness, a 512-token table request, a streamed first chunk, PPT sampling), with the arms alternated in blocks A B A B, 2 rounds per block, so 4 rounds per arm. Rates are each server's own: arm B fromtimings{prompt_ms,predicted_ms}, arm A from FLM's per-request log line. There is also a client-side decode, computed the same way for both arms as(n−1)/(wall₅₁₂ − ttft).Throughput (ranges over 4 rounds, prompt tokens 79 / 399 / 1399)
One caveat changes how to read the decode row: on this prompt the two arms do not generate the same text. FLM serves qwen3:0.6b with thinking off by default (
"think": falsein itsmodel_list.json) and answers in 20 tokens (1, 2, 3, 4, 5, 600.). Ours thinks for 469–512 tokens, all inreasoning_content. So arm A's decode figure covers 20 early tokens, and arm B's covers 512.The control that fixes this: a no-think long generation (filler +
Now write a 600-word story about a lighthouse keeper. /no_think), where both arms write 489–512 tokens of content:Arm B's spread here lines up with package PPT at 40–80 W, which suggests another lane's GPU job sharing the package; arm A's windows sat at about 19 W. Read B's upper bound as the clean figure. On the same files, decode is 0.8–0.9× FLM's, and prefill is the gap: 0.52× short, 0.12× at 399 tokens, 0.04× at 1399 tokens (17.6 s vs 0.85 s TTFT). Our prefill is flat at about 80–106 tok/s, the same one-position-per-launch signature as npu-kernels#75 / engine#3236.
Greedy agreement: cl-npurt's 5-prompt set, byte for byte (
/no_think,max_tokens 64,temperature 0,top_p 1)Each arm is deterministic: two passes per arm per run, across both runs, give the same hashes.
The capital of France is **Paris**.359ff4337837754e)The first five prime numbers are: 2, 3, 5, 7, 11.2, 3, 5, 7, 1117 × 23 = **421**.17 × 23 = **409**."Guten Tag"Guten Tag!Guten Morgen)…vast and mysterious body of water……vast, dynamic body of water…Arm B's answers differ from those cl-npurt posted on the earlier per-op build (p2 has no leading
/; p3 was391and is now409). The c35 dx route takes a different numeric path from per-op, and on p3 it is now as wrong as FLM.Agent-app checks through the same lemond (
tools/unsloth_probe.py --rounds 0)tools)tool_calls{"ok": true}HTTP 400from lemond/onebitExpecting value)Two lemond facts that change what a Studio user gets from arm A
flmrecipe ignores the load'sctx_size. lemond always launchesflm serve … --ctx-len 8192(I triedctx_size: 32768), so a prompt over 8192 tokens getsHTTP 400(Error 400 … Body length: 64774). Arm B honours--ctx-size 32768. The "~8k" rows here are 1399 tokens, which is why both arms have them.prefer_systemis the switch that lets the two meet.Mine to own
The launcher's first phase-script failure skipped its cleanup, so my first lemond (pid 70281) stayed alive from 14:59Z to about 15:20Z. Its NPU backend stayed resident during the short gaps between my
box-holdwindows and for about 5 minutes at the end. There were 0 fault lines, I killed it, and the box's services are healthy. Run 2 above came from a fresh lemond, after the launcher was changed to refuse a busy port and to run phases in a subshell.Reproduce
All of this is under
/data/dev/cl-flmon strixhalo:Raw JSON is in
/data/dev/cl-flm/runs/{table-1122-1500,table-1122-1519,witness-1122-1513,agent-1122-1518,content-1122-1511}.The harness fixed-port flake (comment of 03:10Z) is fixed in #3309.
Not claimed: Qwen3-1.7B and 4B on the c35 build (next), power per device (no NPU sensor; PPT is package-wide and shared with other lanes), and Unsloth Studio itself in front (this is the lemond shape Studio's
customprovider would point at).bong-water-water-bong commentedon Nov 22, 2026
Arm A vs arm B, model ladder: Qwen3-4B (clean) and Qwen3-1.7B
The 0.6B results are in my previous comment. This one uses the same setup: one lemond (appliance build 2026.49.0~1.4bd453a0) on 127.0.0.1:13410.
flmrecipe, running FLM 1.0.13 (prefer_system).onebitrecipe, running/opt/1bit-package/1bit/1bit(engine31a7a523).Qwen3-4B:
FastFlowLM/Qwen3-4B-NPU2@ 07651f11 (model.q4nx 095b851c…)Run 18:53–19:57Z under
box-hold both, so the GPU was idle as well. PPT 21–23 W throughout. An earlier 4B run (16:31Z) was discarded: other jobs were loading the package (PPT up to 85 W) and both arms spread about 1.5x.Table: cl-npurt's armB-table protocol. Rounds are A B A B, 4 per arm. Prompts are 79 / 399 / 1399 tokens; all 512 tokens were generated in every row.
No-think witness: "600-word story … /no_think", 2 rounds per arm, prompts of 64 / 384 / 1384 tokens.
Agreement: the 5 prompts from the 0.6B comment, with
/no_think, temp 0, max_tokens 64.Guten MorgenvsGuten Morgen.Agent checks (
tools/unsloth_probe.py):So at 4B, arm A decodes 1.19x faster on the short prompt and 1.34x faster on the 1399-token prompt, and prefills 4–38x faster. Answers match on 3 of 5 prompts, and the other 2 differ only in wording.
Qwen3-1.7B: snapshot 1b452c9a (model.q4nx b1c1fe9d…)
box-hold both, 0 new amdxdna fault lines. PPT was 20.7–21.4 W in the table rounds and 20.6–35.4 W in the witness rounds. This replaces my first 1.7B run, which ran underbox-hold npuonly while another lane's GPU job loaded the package (PPT 50–85 W) and read up to 25 % low. Prompts are 79 / 399 / 1399 tokens; all 512 tokens were generated in every row."Guten Morgen".Command for this run:
ssh strixhalo 'cd /data/dev/cl-flm && BOX_HOLD_WHO=cl-flm box-hold both sudo -n sh armA-lemond.sh /data/dev/cl-flm/ph-17b.sh'.ph-17b.shisph-4b.shwith the 1.7B model ids. The run dir isruns/ladder-17b-1122-2045.Commands
The scripts live in
/data/dev/cl-flm/on the box. The run dir isruns/ladder-4b-1122-1853.FastFlowLM's NPU kernels are MIT-licensed; thanks to the FastFlowLM authors. Arm B runs our own runtime.
bong-water-water-bong commentedon Nov 22, 2026
Agent-app checks through Unsloth Studio itself, both arms, on the c35 box
This is the front-end half of the method, re-run on the c35 appliance with both arms behind the same Studio.
--api-only(127.0.0.1:13420) → its own/v1/chat/completions→ a savedcustomprovider (routed withprovider_id+external_model) → my lemond (127.0.0.1:13410, appliance build 2026.49.0~1.4bd453a0).flmrecipe, FastFlowLM 1.0.13.onebitrecipe,/opt/1bit-package/1bit/1bit, engine31a7a523.tools,get_weather,tool_choice:auto) and one JSON-mode request (response_format: json_object). All at temperature 0.box-hold npuwindow, 21:08:38–21:11:10Z. srcversion F87D0BDF248067862F83BA3 at both ends, 0 new amdxdna fault lines. Every provider was deleted afterwards (HTTP 204), and Studio and lemond were stopped.35ea5eba…7855, withUNSLOTH_NO_TORCH=1and no autostart or systemd units. HOME, TMP and STUDIO_HOME are all under/data/dev/cl-flm/studio, and sudo/apt were blocked by refusing stand-ins, which were never called. Nothing in the appliance OS changed, and no OS package was missing (llama.cpp came as Studio's prebuilt Vulkan build, which this check does not use).[DONE], 124 answer chars, no reasoning (FLM defaults to no-think), 1.1 s[DONE]OK, but the whole budget went on reasoning (1319 chars, 0 answer), 21.0 sfinish:stop, prose about the weather, notool_callstools, instead of silently ignoring them. Studio passes the error through.finish:tool_calls,get_weather {"city":"Vienna"}, 9.2 s{"city": "Vienna", "ok": true}, 1.8 sHow to read it:
contentsees an empty reply. That is the client trap cl-npurt described, and it applies to both arms equally.toolswith an explicit error on its NPU route.tool_calls.Commands
On the box, scripts in
/data/dev/cl-flm. The run dir isruns/studio-1122-2108; it has Studio's log, lemond's log and the raw engine replies.Not covered: Studio's own managed NPU path, where Studio drives FLM directly through its
flm_hostwith no Lemonade. That is what a Linux user gets by default, and it has no onebit counterpart.FastFlowLM's NPU kernels are MIT-licensed; thanks to the FastFlowLM authors.
bong-water-water-bong commentedon Nov 22, 2026
Qwen3.6-35B-A3B (MoE, 128 experts top-8 class): arm A measured on c35; arm B cannot run on this payload
The orchestrator asked for this model because it is the one Unsloth's NPU table headlines. Unsloth Desktop + Lemonade + FastFlowLM lists
Qwen3.6-35B-A3B-NPU2: 17.2 tok/s, TTFT 3.13 s, 20.6 GB (https://unsloth.ai/docs/get-started/install/amd/npu).Arm A: FastFlowLM 1.0.13,
qwen3.6-moe:35b-a3bSetup is the same as my earlier comments: my lemond (appliance build 2026.49.0~1.4bd453a0), the
flmrecipe, FLM 1.0.13.FastFlowLM/Qwen3.6-35B-A3B-NPU2, pulled byflm pull, 21 GB on disk, model.q4nx sha256a763f82a…d175.box-hold nputickets (23:15:55–23:27:00Z and 23:33:38–23:43:27Z), each under the 45-minute rule.Table (4 rounds; prompts of 75 / 395 / 1395 tokens; all 512 tokens generated in every row):
So the shipped path's number reproduces on c35 behind a plain lemond: 17.2 tok/s sits inside every decode range above, and TTFT on the short prompt is within 0.2–0.4 s. Decode barely falls with context (−3 % from 75 to 1395 tokens).
No-think witness (600-word story, 2 rounds): decode 12.1–12.5 / 11.9–13.7 / 11.8–17.3 tok/s. This run is disturbed: PPT was 73–85 W in most rounds, from other lanes' GPU work on the package. The ~12 tok/s is a contention number; it is not the model's speed.
Agreement (the same 5 prompts,
/no_think, greedy, 2 reps): all 5 answers are correct (Paris; 2, 3, 5, 7, 11; 391; Guten Morgen; a one-sentence ocean fact), and the output is deterministic across reps. p2 and p3 hash identically to arm A and arm B at 4B (428cb33a…,a934c244…).Agent checks:
unsloth_probe.py): tool call PASS, stream PASS, JSON PASS.[DONE], 129 answer chars, 4.4 s;finish:tool_calls,get_weather {"city":"Vienna"}, 7.8 s;{"city": "Vienna", "ok": true}, 5.8 s.This is the first model in this issue to pass all three checks on either arm.
Arm B: not runnable on the c35 payload
config/npu-catalogue-sets.jsonon main marksQwen3.6-35B-A3B-NPU-1bit: null: the entry needs a route this payload does not ship.Top-k expert agreement (the role-split-precision point)
I could not measure it on either arm here, and I am not quoting a number for us.
moe_precisionnotes for the 128-expert top-8 shape, 4-bit attention projections put about 6 % noise on the router input and cost about 0.93 of 8 experts on 72.5 % of tokens. Q8 attention brings that back to 0.10 of 8, for about 2.9 % more size. (Source: the FastFlowLMflm-dev-kitdocs; read as reference only, nothing copied.)Commands
FastFlowLM's NPU kernels are MIT-licensed; thanks to the FastFlowLM authors.
bong-water-water-bong commentedon Nov 23, 2026
Unsloth Studio's own managed NPU path (what a Linux user gets by default), and the 35B artifact identity
What this path is
Studio 2026.11.9 →
flm_host(Studio's own Python stand-in for lemond) → FastFlowLM 1.0.13 → NPU, with no Lemonade. On linux-x64,direct_flm()is true unlessUNSLOTH_NPU_LEMONADE=1is set.flm54232a85…,flm-reale4321f5b….35B artifact identity, relevant to my previous comment:
FastFlowLM/Qwen3.6-35B-A3B-NPU2has two differentmodel.q4nxbuilds:main(23.2 GB,688f1e15…) and branchflm_q4k_high_precision(21.0 GB,a763f82a…).flm pull(FLM 1.0.13) fetches theflm_q4k_high_precisionone. Studio's catalogue lists that same revision, and it is the 20.6 GB in Unsloth's table.Run: one
box-hold nputicket, 01:03:49–01:13:10Z, stated RAM need 34 GB (121 GB available at the end). srcversion F87D0BDF248067862F83BA3, 0 amdxdna fault lines. Studio and FLM were stopped afterwards./dev/accel/accel0, which is root 0600, and memlock. Nothing outside/data/dev/cl-flmwas touched./v1/chat/completions, using the same three prompts as my table, 2 rounds each.How to read it:
flm serve qwen3:0.6brun directly at--ctx-len 8192, then32768, then8192again, with the same prompts andthink: true, 2 rounds each. FLM's own log shows decode at 1399 tokens of 63.38 / 63.41, 63.62 / 63.14 and 63.38 / 63.07 tok/s. Short prompts give 79–83 tok/s and 2k prompts 74–76, with no difference by context length. Run dir:runs/ctx-1123-0133.flm_hostor its streaming proxy. It shows only on the long prompt: wall time is 13.4–13.8 s against FLM's own ~9 s (0.95 s prefill + 8.1 s decode), while TTFT looks normal.Agent checks on the managed path:
supports_tools: false)get_weather {"city": "Vienna"}get_weather {"city":"Vienna"}Through the managed path Studio enables thinking, so the 128-token JSON budget and the 256-token chat budget go on reasoning. That is why 35B JSON mode passed through lemond (no-think) and returns empty here. It is the same model on the same engine, and the only difference is the front end's default.
Commands
bong-water-water-bong commentedon Nov 27, 2026
Close-out against this issue's own method (lane cl-flm, 2026-11-27)
This comment maps every item in the issue body's Method to the comment that measured it, so the issue can be judged without reading the thread. All final rows are on the c35 appliance: one lemond, both arms behind it, the same pack bytes, srcversion
F87D0BDF248067862F83BA3, 0 new amdxdna faults. Lemonade, FLM and engine versions and shas are in each linked comment.The answer the issue asked for (c35, server-side rates, ranges over 4 rounds):
toolswith prose (notool_calls), while arm B refuses with an explicit HTTP 400. JSON mode passes on arm A 0.6B and fails on both arms at 4B, where the budget goes to reasoning.What is left. None of it is a measurement this issue owes; each piece has its own owner:
76153232aaand follow-ups). Real tool support on the NPU route would be a feature, not this comparison.Recommendation: every Method item is measured and the comparison's answer is above, so this issue is closeable on its own criteria. Items 1-4 continue elsewhere. I don't close issues; that's the orchestrator's call.