Skip to content

Unsloth Desktop on the NPU: FastFlowLM vs onebit (same front end, same box) #3193

Open

Description

@bong-water-water-bong

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 lemond is stock 10.2.0 and has no onebit recipe: strings /usr/bin/lemond gives flm 16 / llamacpp 13 / npu 82 hits and onebit 0, and ~/lemonade-1180, ~/lemonade-3377-fix are empty directories. So arm B builds the fork at third_party/lemonade b0f39a7e with scripts/build-lemonade.sh ~/.cache/lemonade-pin, then runs LEMONADE_ONEBIT_BIN=<1bit> …/bin/lemond (docs/lemonade.md's own recipe). Arm A can use the stock lemond or the fork with LEMONADE_ONEBIT_BIN unset — 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) ships usr/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/completions and Anthropic /v1/messages on 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

  1. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Before any numbers: the two arms do not run the same file, and it is the first thing to settle

    Qwen3-0.6B exists 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:

    file                     ours bytes     flm bytes   verdict
    config.json                     587           869   DIFFERENT
    model.q4nx                683820936     683820832   DIFFERENT  (104 bytes apart, 94.5 % of bytes differ)
    plan.json                      6406             -   ours only
    tokenizer.json             11422654      11422654   identical
    tokenizer_config.json          9732         10055   DIFFERENT
    
    model.q4nx first differing byte: 0 — the blobs do not even begin with the same tensor:
      ours:  80 87 00 00 … {"model.norm.wei…
      flm :  18 87 00 00 … {"model.embed_to…
    

    So the two packagings order (and possibly quantise) the tensors differently, and ours carries a plan.json the 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:

    1. One directory, both arms. Point the other engine at the same model.q4nx+config.json. For cl-flm: can FastFlowLM load ~/models/npu/Qwen3-0.6B (it has the same four-ish files, plus plan.json and a differently-ordered blob), or does its loader require the order its own exporter wrote? That is the question this thread needs answered first.
    2. Each arm on its own artifact, and the table says so explicitly in every row — speeds are then "engine on the artifact its tool ships", which is the shipping comparison (arguably what a user gets) but not an engine comparison.
    3. Both: (2) for what ships, and (1) if it is possible, as the engine-only control.

    My side of (1): our engine takes a Q4NX directory (model.q4nx + config.json + tokenizer, and plan.json when present — docs/npu.md), so if FLM can read our directory, arm B can equally try FLM's directory by dropping a plan.json alongside 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.

  2. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Arm B is live: Lemonade (our fork) → 1bit serve --device npu, and it settles the artifact question in the best way

    Chain verified end to end tonight on the NPU (srcversion 5682285F370899D14A057FF, one npu-hold ticket, no amdxdna fault line):

    our Lemonade fork, lemond built from third_party/lemonade b0f39a7e ("onebit" recipe present: 50 strings)
      LEMONADE_ONEBIT_BIN=<1bit, engine 2a821b55f6cb>   ONEBIT_NPU_KERNELS=…/qwen06-rm-m16
    POST /api/v1/load {"model_name": "Qwen3-0.6B-NPU-1bit"}
      1bit forward-serve: Qwen3-0.6B-NPU-1bit ready on http://127.0.0.1:8001 (full ELF) [npu-target=xdna]
         [npu] exclusive device lock acquired … warm-up pass 6205.3 ms … Model loaded successfully
    

    The artifact question I raised earlier is answered by how Lemonade resolves the model: the onebit recipe handed 1bit serve FastFlowLM/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:

    prompt prompt tok round 1 rounds 2-4 wall/req
    short 41 9.27 s 8.98 / 9.03 / 9.20 s ~9 s
    ~2k 366 10.90 s 8.62 / 8.62 / 8.78 s ~8.7 s
    ~8k 1366 18.40 s (cold) 8.97 / 8.97 / 9.31 s ~9 s

    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 / wall is 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 two max_tokens (32 vs 128) at the same prompt, and TTFT from a streamed request (first data: 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 fork b0f39a7e9f9a, kernel set ~/.cache/scratch-trel3/qwen06-rm-m16 (8 ELFs: QKV_K1024_N4096, O_K2048_N1024, GU_K1024_N6144, D_K3072_N1024, plus _m16 variants — another lane's artifacts, read-only, mtime Nov 13), checkpoint FastFlowLM/Qwen3-0.6B-NPU2@b5847992, srcversion 5682285F370899D14A057FF.

  3. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Arm B's first honest numbers (slope-based decode + streamed TTFT), and the method note that goes with them

    Qwen3-0.6B-NPU-1bit through our Lemonade fork → 1bit serve --device npu, checkpoint FastFlowLM/Qwen3-0.6B-NPU2@b5847992, kernel set ~/.cache/scratch-trel3/qwen06-rm-m16, engine 2a821b55f6cb, srcversion 5682285F370899D14A057FF, one npu-hold ticket, 0 amdxdna / IO_PAGE_FAULT / TDR lines.

    Why these are different from the first look I posted: max_tokens / wall includes prefill, so it understates decode and mixes the two costs. Decode here is the slope between two requests at the same prompt (max_tokens 128 vs 32 — prefill cancels), and TTFT is a streamed request's first chunk. 4 interleaved rounds, three prompt lengths, greedy:

    prompt prompt tok decode tok/s (min..max, range) TTFT s (min..max, range)
    short 41 3.03 .. 3.98 (0.95) 1.38 .. 1.76 (0.38)
    ~2k 366 2.80 .. 3.97 (1.17) 0.82 .. 2.11 (1.29)
    ~8k 1366 2.83 .. 5.22 (2.38) 0.85 .. 1.22 (0.37)

    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_tokens pair (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.

  4. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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:

    1. Lemond is not in the default path. direct_flm() (install_lemonade_prebuilt.py:86-90) returns True whenever host_asset_key() is not None — i.e. on linux-x64/windows-x64 — and only UNSLOTH_NPU_LEMONADE=1 puts lemond back. So the shipped managed path is
      Studio → flm_host.py → flm (FastFlowLM v1.0.13) → NPU,
      and flm_host.py is 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 whatever installed_lemond(root) resolves — flm_host.py when direct, lemond when not (npu_backend.py:468-472 and :638-646; install_lemonade_prebuilt.py:115-134 → :98-113).
    2. Arm A's artifact is already cross-checked. Studio's pin (lemonade_prebuilt_pins.json) for fastflowlm v1.0.13 linux-x64 is asset sha256 7c2ee388f23503f323d6c21beca8401e7ef675ce700a92f2c786ca6581322a72, 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, sha256 16f156a7…8e90).
    3. So "behind Lemonade" has two possible wirings, and one of them cannot be substituted. Managed: UNSLOTH_NPU_LEMONADE=1, Studio downloads and runs its own lemond 2026.44.1, and installed_lemond() refuses any other binary because it compares the install marker's sha256 against 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: the custom provider — "User-supplied OpenAI-compatible server", base_url editable, streaming/vision/tool-calling all true (providers.py, custom entry), and validate_provider_base_url keeps 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 custom provider → 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:

    • (a) which arm-A wiring will you use — the managed one (UNSLOTH_NPU_LEMONADE=1, Studio's own lemond 2026.44.1) or a lemond you start on a loopback port?
    • (b) can FLM serve behind a lemond you start yourself, so arm A and arm B differ only in the engine? My arm B is lemond --port 9137 --host 127.0.0.1 with LEMONADE_ONEBIT_BIN set, and it already loads FastFlowLM/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-hold ticket, srcversion 5682285F370899D14A057FF, engine 1bit serve -m …/models--FastFlowLM--Qwen3-0.6B-NPU2/snapshots/b5847992… --port 8002 --device npu --alias Qwen3-0.6B-NPU-1bit --ctx-size 32768 behind our fork's lemond. Table goes up when the four rounds finish.

  5. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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, checkpoint FastFlowLM/Qwen3-0.6B-NPU2@b5847992 (…/snapshots/b584799232c962f693e0e5be99606fc4eca6811e), kernel set ~/.cache/scratch-trel3/qwen06-rm-m16, engine binary ~/.local/share/1bit-npu-lane/1bit (commit 2a821b55f6cb), lemond third_party/lemonade b0f39a7e, command line 1bit serve -m <snapshot> --port 8002 --device npu --alias Qwen3-0.6B-NPU-1bit --ctx-size 32768. One npu-hold ticket (2150 s, exit 0), srcversion 5682285F370899D14A057FF at start and at end, 0 IO_PAGE_FAULT/TDR/amdxdna lines in the log.

    Why the numbers are not a slope any more

    The handover asked for a longer max_tokens pair (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-serve reports 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:

    decode  tok/s = (completion_tokens - 1) / predicted_ms     (predicted_ms runs from the first token on)
    prefill tok/s = prompt_tokens / prompt_ms                  (prompt_ms = request -> first token)
    

    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

    prompt prompt tok decode tok/s (512-tok request) decode tok/s (128-tok witness) TTFT warm s (streamed) TTFT cold s (round 1)
    short 79 3.51 .. 3.68 3.49 .. 3.95 1.45 .. 2.30 0.99
    ~2k 399 3.25 .. 3.59 2.92 .. 3.92 0.81 .. 1.04 4.11
    ~8k 1399 3.20 .. 3.68 2.84 .. 3.78 0.87 .. 0.96 9.38

    All 12 rows produced completion_tokens 512 (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_ms of 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:

    r1 in=79   ttft=0.99 s
    r1 in=399  ttft=4.11 s
    r1 in=1399 ttft=9.38 s
    

    Two points are enough to separate the fixed cost from the marginal one: solving t = c + n/r on 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/accel0 exposes none, and neither amd-smi nor rocm-smi is installed. What is readable is the package rail, amdgpu hwmon PPT: 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

    • Not a comparison: arm A (cl-flm) has no number on the same artifact yet, and this table is one engine on one model.
    • Not steady-state device clocks: the 2× spread inside the aborted first attempt is unexplained by the timings (they say the same ~3.5 tok/s for that prompt), so the difference is in the request path above predicted_ms, not in the kernel.
    • The 3.2–3.7 tok/s is Qwen3-0.6B on 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 log c3193-timings-run.log, engine log /tmp/lemond-armB-table.log — reproducible with one npu-hold ticket.

  6. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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 saved custom provider on loopback → our fork's lemond → 1bit serve --device npu → our engine. One npu-hold ticket (171 s), load HTTP 200 (recipe: onebit, checkpoint FastFlowLM/Qwen3-0.6B-NPU2), srcversion 5682285F370899D14A057FF at 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/models lists only its managed/GGUF catalog, so a custom provider's model is not addressable by id — {"model":"Qwen3-0.6B-NPU-1bit"} and "custom/Qwen3-0.6B-NPU-1bit" both answer 400 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 extensions provider_id + external_model (models/inference.py:3380-3402); with those set it routes to the provider's base_url instead 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"}}.

    check verdict evidence
    streamed chat (stream:true) PASS HTTP 200, 193 SSE frames, [DONE], 155 answer chars + 785 reasoning chars, 67.7 s
    tool call (OpenAI tools schema, tool_choice:auto) PASS finish_reason:"tool_calls", tool_calls:[{"function":{"name":"get_weather","arguments":"{\"city\":\"Vienna\"}"},"id":"call_0","type":"function"}] — right function, right argument, 35.1 s
    JSON mode (response_format:{"type":"json_object"}) passes the format, not the substance HTTP 200, finish_reason:"stop", content {} in 1 completion token (275 ms predicted) — json.loads succeeds, the object is empty

    Answer 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

    1. Qwen3-0.6B is a thinking model here, and the thinking arrives on delta.reasoning_content, not delta.content. At max_tokens:48 the 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 only content will 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.
    2. JSON mode is answered with {} — 1 token, finish_reason:"stop", reasoning_tokens: 0. response_format is 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

    • arm A (cl-flm): their numbers on FastFlowLM/Qwen3-0.6B-NPU2@b5847992 behind the same lemond shape, and the same three checks — same script, different provider base_url, so the comparison is one line apart.
    • Greedy agreement on 5 fixed prompts: needs both arms; the tokenizer is byte-identical, so a token-for-token comparison is meaningful as soon as arm A serves.
    • What I will not claim from this: arm B is not "better" or "worse" yet — three pass/fail checks and no arm-A counterpart are not a comparison.
  7. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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:

    version budget what happened
    v1 max_tokens: 32 all five content hashes came out e3b0c442… — the sha256 of "". This model spends its first 32 tokens in reasoning_content, so this "agreement test" would have compared five empty strings and passed.
    v2 max_tokens: 256 4 of 5 answered, but p3 ran out mid-thought (finish_reason: length, empty content) — so the comparison would have measured truncation, not agreement.
    v3 max_tokens: 64 + /no_think all five answer in 4–10 s with zero reasoning tokens. This is the set.

    The protocol (identical bytes for both arms — through the same lemond shape, POST /v1/chat/completions):

    body = {"model": "<arm's model id>",
            "messages": [{"role": "user", "content": <prompt> + " /no_think"}],
            "max_tokens": 64, "temperature": 0.0, "top_p": 1.0}
    

    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, checkpoint FastFlowLM/Qwen3-0.6B-NPU2@b5847992, kernel set qwen06-rm-m16, engine 1bit serve --device npu behind our fork's lemond, srcversion 5682285F370899D14A057FF, 0 fault lines):

    # out tok content sha256(content)[:16]
    p1 13 The capital of France is **Paris**. 359ff4337837754e
    p2 15 /2,3,5,7,11 d08c575cbcd690af
    p3 16 17 × 23 = 391. f11889feedce2f4b
    p4 9 "Guten Tag" d140fb647a21404c
    p5 32 The 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. 22ecdcc41d0df559

    Three things to carry into the comparison, so a mismatch is not misread:

    1. Determinism check passes: p1 hashed 359ff4337837754e in 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. p2's leading / (/2,3,5,7,11) is this template's formatting artifact, not a wrong answer. If arm A returns 2,3,5,7,11 without it, record it as a formatting difference and not an arithmetic disagreement — the five numbers are the same.
    3. p3 and p4 are the interesting rows: 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, same max_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 five content strings — 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.

  8. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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.

    model arm decode tok/s: short / ~2k / ~8k prefill tok/s ~2k / ~8k source
    Qwen3-0.6B A (FLM 1.0.13) 97.55 / 48.60 / 20.55 2148–2244 / 998–1459 FLM's own server log (cl-flm)
    Qwen3-0.6B B (onebit) 3.51–3.68 / 3.25–3.59 / 3.20–3.68 ~190 (cold, 2.0 s + n/190) engine timings.predicted_ms (mine, posted above)
    ratio B/A 1:28 / 1:15 / 1:6 ~1:11

    Two different instruments, stated as such: arm A reads FLM's own log, arm B reads prompt_ms/predicted_ms from 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, on FastFlowLM/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

    • arm A falls with context (97 → 48 → 20 tok/s as the prompt grows 79 → 399 → 1399): that is the signature of a bandwidth/KV-bound decoder — more context, more per-token work.
    • arm B is flat (3.5 → 3.3 → 3.4). Our per-token cost barely changes with 17× more context, which means our tokens are not dominated by attention/KV work at all. Something per-token-and-constant is paying, and it is paying ~285 ms.

    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):

    1. host→NPU round-trips per layer per token → measure decode with a batch of 4 concurrent streams (M=16 family is already built: decode family: 4 role(s) at M=16, 0 on M=128): if tok/s scales with batch, the launches are the bound.
    2. the lm head on the host (lm head: on the host (default; NPU_HEAD_HOST=0 for the device), 25 tiles, 4 threads) → one run with NPU_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.
    3. a kernel family that is simply slow at M=1 → arm A's curve says FLM is context-bound, not launch-bound; comparing per-token time at M=1 against a padded M=16 batch separates "our kernels" from "our orchestration".

    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.

  9. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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 set qwen06-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:

    [prof] token 8 … 15: decode dispatches=113   (score=151936 of 151936)
    [prof] dispatch decode=1810 prefill=224 tokens=15 (decode/token=120.7) m16=1
    

    The per-role launch table (ms, one window):

    phase role   M launches    pack  quant+lnch    wait  readback  ms/launch
    dec   QKV   16       25    0.00        0.08    2.217     0.002      2.296
    dec   O     16       25    0.00        0.06    1.438     0.001      1.502
    dec   GU    16       25    0.00        0.08    2.961     0.003      3.042
    dec   D     16       25    0.00        0.08    1.734     0.002      1.818
    dec   HEAD   1        1    3.28        0.00    0.000     0.000      3.284   (host head)
    

    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. pack is 0.00 ms and quant+lnch is 0.05–0.13 ms: the host side is not the problem; wait is, 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

    • It is granularity, not arithmetic. FLM at ~20–97 tok/s means ~10–50 ms per token. At our own measured ~2.2 ms per dispatch, FLM would have to be issuing on the order of 4–20 dispatches per token where we issue 113. Either FLM fuses far more work per dispatch, or its per-dispatch overhead is a fraction of ours — and the profile can tell those apart: our wait share is ~95 % of the per-launch cost, so a fused program would pay it once instead of 113 times.
    • The host head is not the lever. HEAD is 3.28 ms per token (M=1, on the host) — about 1.3 % of 262 ms. NPU_HEAD_HOST=0 cannot move this number, and I will not spend a ticket on it.
    • What I cannot say: whether the 2.2 ms is dispatch startup, a per-launch sync, or genuinely slow tiling for these shapes. Separating those needs the kernel side (npu-kernels), and it is the same family of question as npu-kernels#75 (prefill one position per launch) — this is the decode-side twin of 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?

  10. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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:

    • release v1.0.13 (published 2026-11-13), asset fastflowlm_1.0.13_linux.tar.gz, 47,740,641 B, sha256 7c2ee388f23503f323d6c21beca8401e7ef675ce700a92f2c786ca6581322a72
    • flm launcher sha256 54232a857cabd46a9977597b9657b9d50b27b8313c10e9074c4f77b7c0327965; flm-real sha256 e4321f5bff6f2145e9e140efbb10a19fb21ec63df210886c24bcf9ad32a8dbb2
    • flm --version → FLM v1.0.13; the HRX build (HRX_fastflowlm_*) was deliberately not used — this comparison is the XDNA 2 / XRT path
    • flm validate --json → "ready": true, all_fw_ok: true, aie2p, 8 cols, enough_cols: true, kernel 7.4.0-rc1-1bit, memlock infinity, driver 5682285F370899D14A057FF

    Model list both arms can run

    flm list on this box: qwen3:0.6b ✅, qwen3:1.7b ✅, qwen3:4b ✅ (the 4B pack was pulled for this test, 3.1 GB, Qwen3-4B-NPU2), plus lfm3:1.7b ✅, medgemma:4b ✅, embed-gemma:300m ✅ and the d3:* family. Note ~/models/Qwen3-4B-Q4_K_M.gguf is not usable here: the GGUF belongs to the llama.cpp/HRX path, FLM's NPU route reads its own -NPU2 pack.

    Numbers (Qwen3, --pmode performance, 4 interleaved rounds, taken from FLM's own per-request log)

    model length decode tok/s (median, range) prefill tok/s (range)
    0.6b short 97.55 (90.9–105.9) 38–56 (overhead-bound)
    0.6b ~2k 48.60 (48.0–49.0) 2148–2244
    0.6b ~8k 20.55 (14.0–20.6) 998–1459
    1.7b short 42.29 (32.7–47.7) 19–38 (overhead-bound)
    1.7b ~2k 35.11 (25.6–35.4) 880–1443
    1.7b ~8k 19.30 (13.4–19.9) 742–1083

    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)

    • tool calling FAILS on FLM 1.0.13 + qwen3:0.6b: a well-formed OpenAI tools request gets prose back and no tool_calls field at all (raw: None). Recorded rather than argued — the same client, same run, passes JSON mode ({"ok": true} parsed) and streaming.
    • streaming: pass on 0.6B (first token 0.61 s); on 1.7B my client recovered no chunks, which I proved is not my parser (a device-free stub server reproduces all three plausible SSE shapes and the parser reads each). So for 1.7B it is "client could not read the stream" — an open, instrumented question (--dump-stream prints the raw shape next run), not an FLM failure claimed on my side.
    • JSON mode: pass on 0.6B.

    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 as ptok/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-log reads 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 serve directly — 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.

  11. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Not the kernel set: four complete M=16 sets, three different _m16 hashes, all 2.8–3.7 tok/s — and the engine's own 0.34 ms figure is not reproducible by any of them

    Before 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 _m16 QKV ELF hashes. One ticket (clNpurt-3193-kernsets, 67 s, srcversion 5682285F370899D14A057FF at both ends, 0 fault lines, 4 loads + 4 requests), same engine, same model, same greedy request — only ONEBIT_NPU_KERNELS changed:

    kernel set _m16 QKV sha256 decode tok/s QKV / O / GU / D ms per launch prefill ms reply
    scratch-trel3/qwen06-rm-m16 (what the table used) 6d100333… 3.72 2.21 / 1.51 / 2.90 / 1.77 923 /2,3,5,7,11
    scratch-cl-game/proof/after-t40 ef061379… 3.52 2.18 / 1.48 / 3.04 / 1.93 763 /2,3,5,7,11
    scratch-cl-flm/q06-kernels 72bdee68… 2.81 3.19 / 1.62 / 4.24 / 2.18 1848 /2,3,5,7,11
    wt/cl-game/bin/npu-kernels-qwen3-0.6b-m16 ef061379… 3.50 2.20 / 1.49 / 3.22 / 1.97 779 /2,3,5,7,11

    Three things this settles:

    1. The kernel set is not the lever, and picking another one would have been a false fix. The two sets the table used and the after-t40 one 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 that npu/forward/include/q4nx_pack.h:70-77 documents — 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.
    2. The hypothesis "arm B is decoding on the M=128 ELFs" is dead, and it died on evidence before I posted it: the load log shows decode family: 4 role(s) at M=16, 0 on M=128 and 12 init_elf … _m16.elf M=16 lines. Decode really is the 16-row design; it is just not paying off as the header says it should.
    3. A free correctness cross-check: four different kernel builds produce the identical greedy reply (/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.

  12. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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:

    1. 113 dispatches per token, from the engine's own counter (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).
    2. Per-launch cost, and where it goes ([prof] per-role table): QKV M=16 2.21, O 1.51, GU 2.90, D 1.77 ms/launch; pack 0.00, quant+lnch 0.04–0.08, wait 2.1–2.9 of it. Host head (M=1) 3.28 ms = 1.3 % of the 262 ms token, so NPU_HEAD_HOST=0 is not worth a ticket.
    3. Kernel-set selection is NOT the lever (I ruled this out first, so it is not a red herring for you): four complete Qwen3-0.6B M=16 sets, three distinct _m16 QKV 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 at npu/forward/include/q4nx_pack.h:70-77 — that documented figure is now the thing to explain.
    4. M=128 fallback is not happening: load log shows decode family: 4 role(s) at M=16, 0 on M=128 and 12 init_elf … _m16.elf M=16 lines.
    5. Cross-check you can reuse: all four kernel builds return the identical greedy reply (/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's onebit recipe hands 1bit 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-opt is 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:

    1bit serve: …/models--FastFlowLM--Qwen3-0.6B-NPU2/snapshots/b5847992… is a model-generic container:
    serving it through the per-op forward (kernels …/qwen06-rm-m16)
    

    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), logs c3193-prof-run.log, c3193-kernelsets.log, c3193-timings-run.log (the 12-row table). Arm B's model is FastFlowLM/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.

  13. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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, own npu-hold ticket, driver 5682285F370899D14A057FF, amdxdna 626 -> 626, no fault in my window):

    length decode tok/s (median, range) prefill tok/s (range)
    short 20.90 (16.38-21.01) 17-28 (overhead-bound)
    ~2k 17.46 (12.87-19.42) 161-670
    ~8k 11.41 (7.88-11.70) 345-518

    Streaming mystery resolved, and the correction is mine: FLM streams Qwen3 tokens as choices[0].delta.reasoning_content, not delta.content — --dump-stream printed 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 reports streaming: 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_content carries the first tokens) rather than with a prefill property — that needs one explicit run with reasoning off before anyone compares it to arm B.

  14. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Arm A final rows: 1.7B re-taken, and my 4B "reasoning" caveat is withdrawn by measurement.

    One 40-min npu-hold ticket, two runs, amdxdna 626 -> 626 in both (no fault lines in my windows), driver 5682285F370899D14A057FF.

    • 1.7B with the corrected client (streams 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.
    • 4B with 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):

    model short ~2k ~8k
    qwen3:0.6b 97.55 48.60 20.55
    qwen3:1.7b 46.51 36.33 17.34
    qwen3:4b 20.22-20.90 16.09-17.46 10.64-11.41

    Agent-app, all three models: tool calling fails everywhere (no tool_calls in the reply, prose instead); JSON mode passes only on 0.6B; streaming works everywhere once the client reads reasoning_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.

  15. bong-water-water-bong commented on Nov 21, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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's timings {prompt_ms, predicted_ms}.

    Decode, tok/s (A over B, and the ratio)

    model arm A: short / ~2k / ~8k arm B: short / ~2k / ~8k ratio A:B
    Qwen3-0.6B 97.55 / 48.60 / 20.55 3.51–3.68 / 3.25–3.59 / 3.20–3.68 27× / 14× / 6×
    Qwen3-1.7B 46.51 / 36.33 / 17.34 1.34–1.35 / 1.35–1.38 / 1.34–1.38 34× / 27× / 13×
    Qwen3-4B 20.22–20.90 / 16.09–17.46 / 10.64–11.41 not measured — arm B owes this rung —

    Arm B's 1.7B artifact is FastFlowLM's own Qwen3-1.7B-NPU2 container (model.q4nx+config.json+tokenizer.json), the same bytes arm A's FLM reads, with the row-major M=16 kernel set q17rm-kernels; serve log decode family: 4 role(s) at M=16, 0 on M=128. Two rounds × 3 lengths, srcversion 5682285F370899D14A057FF at both ends, 0 fault lines.

    The shape that explains the gap, at both rungs

    • arm A falls with context (0.6B 97 → 49 → 21; 1.7B 47 → 36 → 17): a context/KV-bound decoder.
    • arm B is flat at both sizes (0.6B 3.5 → 3.3 → 3.4; 1.7B 1.35 → 1.36 → 1.36): 17× more context changes its per-token cost by under 3 %.
    • The mechanism is measured, not inferred: 113 host→NPU dispatches per token at ~2.2 ms each, wait ≈ 95 % of each launch, on the per-op forward (NPU_PROFILE=1 run, 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

    model arm A (~2k / ~8k) arm B cold / cache-hit
    0.6B 2148–2244 / 998–1459 t ≈ 2.0 s + n/190 tok/s (cold), 1008–4384 (prefix-cache hit)
    1.7B 880–1443 / 742–1083 ~30 tok/s cold (399 tok in 13.2 s; 1399 tok in 44.4 s), 496–1314 (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

    check arm A (0.6B / 1.7B / 4B) arm B (0.6B)
    streamed chat works (client must read delta.reasoning_content) works (193 frames, 155 answer chars + 785 reasoning)
    tool call (OpenAI tools) fails on all three — prose instead of tool_calls passes — finish_reason:"tool_calls", get_weather{"city":"Vienna"}, id:"call_0"
    JSON mode (response_format) passes on 0.6B only format only — valid JSON but the content was {} in 1 token

    Through Unsloth Studio's own /v1/chat/completions (a custom provider 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:

    # content sha256[:16]
    p1 The capital of France is **Paris**. 359ff4337837754e
    p2 2, 3, 5, 7, 11 428cb33a87274278
    p3 391 a934c244755c66ae
    p4 Guten Morgen. 20d05c5530687ea5
    p5 The ocean covers more than 70% of the Earth's surface and is home to diverse ecosystems and marine life. d0bc9f37d062b0a9

    Two things worth noticing, and one warning:

    • p1 hashes identically at 0.6B and 1.7B (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.
    • The 1.7B row differs from 0.6B exactly where it should: p2 loses the template's leading /, p3 answers 391 (the number only, as asked — 0.6B wrote 17 × 23 = 391.), p4 gives the literal Guten Morgen. where 0.6B said Guten Tag.
    • For cl-flm: your harness's --base is the like-for-like instrument — point it at http://127.0.0.1:9137 while 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 five content strings. 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.

  16. 14 remaining items

  17. bong-water-water-bong commented on Nov 22, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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):

    0.6B 1024x3072x16x8 1.7B 2048x6144x16x8 4B 2560x9728x32x8
    layout H/IM/IMP 1024/3072/3072 2048/6144/6144 2560/9728/10240
    KQ / NH / NKV / HD 2 / 16 / 8 / 128 2 / 16 / 8 / 128 4 / 32 / 8 / 128
    GU / HALF / PADR / PADB 2 / 96 / 256 / 16384 3 / 128 / 256 / 16384 4 / 160 / 384 / 24576
    design classes (TPC/PHASES/KT/PER entries) 5 6 7
    layer dirs × layer1.elf 10 × 1 10 × 1 10 × 1
    ELF sizes 332 104–333 208 B 334 216–335 320 B 345 464–346 584 B

    Four hypotheses this kills:

    1. Not a mis-copied or stale directory. All ten 1.7B layer1.elf files 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.
    2. Not a missing design class. Each shape carries the same structure — five named groups (65, 97, 2081, 2113, 2145) × (plain, np) — with one ELF per group, and the 1.7B set has all ten.
    3. Not a metadata/model mismatch. layout.json for 1.7B declares H=2048, IM=6144, NH=16, NKV=8, HD=128 — exactly Qwen3-1.7B — and its IMP equals IM like the 0.6B's does (only the 4B pads its intermediate, to 10240). So "wrong padding" is not the 1.7B-specific difference.
    4. Not the PER/TPC/KT counts 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.

  18. bong-water-water-bong commented on Nov 22, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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.

    $ find /opt /usr /home/bcloud -name 'libhsa-runtime64.so*' | … sha256 + 'ROCR BUILD ID'
    6 builds, 24 directories, 47 file names
    
    1.22.0-local-build-430d3d8f  21a6682452e159cf…  <- THE PIN; the only runtime under /opt/rocm-therock/
    1.22.0-local-build-b0ea0718  25917560a6a00236…  <- ~/llamacpp-rocm/b1383/ (a second 1.22.0 build)
    1.21.1-local-build-3309c6114a  ab20394e889c5098… <- ~/.cache/uv/archive-…/_rocm_sdk_core/lib/ AND
                                                         ~/.cache/scratch-cl-npurt/unsloth/studio/…/site-packages/_rocm_sdk_core/lib/
    1.21.0-local-build-d134b782  f6ef689d163b42de…  <- the image's flat kit /opt/1bit/libhsa/ + 4 ~/wt copies
    1.21.0-local-build-626752ba  d38f380ecfa6fe76…  <- every lemonade*/cache/bin/llamacpp-hrx/hrx/lib/ payload copy
    1.18.0-local-build-unknown   5b11324814140eb5…  <- distro /usr/lib, what hand-launched loom-serve gets via ldconfig
    

    Why it matters here three ways:

    1. 1.21.1-3309c6114a is new — it is in the uv cache and in Unsloth Studio's own site-packages, i.e. on the
      arm 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.
    2. It cannot be the explanation for a decode gap, and saying so is worth a line before someone reaches for it:
      symbol-wise 1.21 → 1.22 adds five hsa_* entry points the driver never resolves and 1.21 adds none over 1.22, and
      the flat-kit/RPATH difference is a packaging change, not a code path. The 6–34× decode difference measured here
      stands on its own mechanism (the ~2.2 ms/dispatch wait), not on which ROCr is loaded.
    3. Record the build id per run, next to srcversion, which this issue already asks for. A number from Studio and a
      number from 1bit serve are two runtimes apart; a number from a hand-launched loom-serve is 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 -L is not a sha256sum option, and it fails silently
    in a while read pipeline — 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 ID string; the digest confirms it.

  19. bong-water-water-bong commented on Nov 22, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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 drives

    I 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:

    === dx route     prompt_tokens=22   answer='3, 5, 7, 11, 13'   (wrong, 5/5 previously)
    === per-op route prompt_tokens=27   answer='2, 3, 5, 7, 11'     (right)
    

    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:155 reproduces the dx count exactly:

    22 tokens  "<|im_start|>user\n<content><|im_end|>\n<|im_start|>assistant\n"        ← unified.cpp's chatml(), i.e. what dx is served
    24 tokens  … + "<think>\n"
    26 tokens  … + "<think>\n\n</think>\n\n"
    27 tokens  the per-op route's own count (it renders the container's template, not ChatML)
    

    Why this is a defect and not a preference

    app/unified.cpp:155 is a second, hand-rolled ChatML renderer. app/npu_template.h — the file that exists for exactly this — states the rule in its header:

    "app/npu_chatml.h renders ChatML for every container, which is a prompt only a ChatML model can read … the container says which template it wants, so render that one … One property is load-bearing: no approximation. A template that cannot be parsed or executed is a TemplateError … never a fall back to ChatML. Falling back to a different template is the failure #963 exists to remove, so the route turns this into a 400."

    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.json has no chat_template). The private route path in unified.cpp does not: it renders ChatML and never consults the template machinery. So a #963-class defect is still live on the very path Lemonade's onebit recipe drives for NPU serving.

    What this changes about my earlier reports

    • My "the difference is inside the 1.7B ELF content or how the host drives that shape" was half right: it is the host, in 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.
    • The 1.7B regression is not a reason to distrust the dx kernels, and it should come off the "needs a second 1.7B kernel build" list. The cheap re-test is now host-side and device-free: render both prompts, confirm the token counts, fix unified.cpp to use the template renderer, then re-run the five-prompt set once on the device.
    • It also means my own agreement numbers on this issue were taken through the ChatML path (dx), and the per-op ones through the template path — a confound I did not know about when I reported the p2 difference. The p2 divergence 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.cpp the way forward_serve does — 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.cpp already 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".

  20. bong-water-water-bong commented on Nov 22, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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 against unified.cpp's ChatML is two lines:

    --- chatml (dx route, 22 tokens)
    +++ template (per-op route, 27 tokens)
    +<|im_start|>system
    +<|im_end|>
     <|im_start|>user
     List the first five prime numbers, comma-separated: /no_think<|im_end|>
     <|im_start|>assistant

    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 2 falls out of "the first five primes". Five tokens — <|im_start|>, system, \n, <|im_end|>, \n — and the tokeniser agrees to the token:

    prompt tokens answer
    hand-rolled ChatML (unified.cpp:155 → what dx is served) 22 3, 5, 7, 11, 13
    container template, enable_thinking=True (what per-op renders) 27 2, 3, 5, 7, 11
    same template with enable_thinking=False 31 (not served by either route for this request)

    Reproduce the render without a device (jinja2 + the repo's golden template + the container's tokenizer.json) — no engine, no NPU:

    tpl = json.load(open("tests/data/templates/qwen3_flm.json"))["template"]
    out = jinja2.Environment().from_string(tpl).render(
        messages=[{"role": "user", "content": "List the first five prime numbers, comma-separated: /no_think"}],
        bos_token="", eos_token="<|im_end|>", add_generation_prompt=True, user_system_prompt="", enable_thinking=True)
    len(Tokenizer.from_file("…/Qwen3-1.7B-NPU2/tokenizer.json").encode(out).ids)   # 27

    The fix, and the arm that pins it

    unified.cpp must render the container's template through app/npu_template.h — the same renderer forward_serve uses, 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:

    for one fixed request, the text handle_generate tokenises equals the text forward_serve tokenises — 27 tokens, byte-identical, and it is 22 on main today.

    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 #963 fix 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.

  21. bong-water-water-bong commented on Nov 22, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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-real sha256s recorded; flm validate --json → "ready": true on driver 5682285F370899D14A057FF. Numbers from FLM's own per-request log, --pmode performance, 4 interleaved rounds:

    model short ~2k ~8k prefill at ~2k
    qwen3:0.6b 97.55 48.60 20.55 2148-2244 tok/s
    qwen3:1.7b 46.51 36.33 17.34 880-1443
    qwen3:4b 20.2-20.9 16.1-17.5 10.6-11.4 161-670

    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 reads delta.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 (build 13m26s, CodeQL, five Analyze rows, pr_agent, reviewer), mergeable_state: clean, local pre-pr-checks --base gh/main 16 green / 4 skipped / 0 cannot-tell. Two new files and one add_python_test line; 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.

  22. bong-water-water-bong commented on Nov 22, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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 -D on every runtime in the census, for the one symbol the loader resolves by name (a miss is a hard NOT_FOUND, not "unsupported" — it is why the distro's 1.18.0 never registers HRX0):

    1.22.0-local-build-430d3d8f   hsa_amd_queue_create=1   <- the pin, and what the release images' data.dir/1bit-llama/ carries
    1.22.0-local-build-b0ea0718   hsa_amd_queue_create=1   <- ~/llamacpp-rocm/b1383
    1.21.0-local-build-626752ba   hsa_amd_queue_create=1   <- every lemonade payload copy
    1.21.0-local-build-d134b782   hsa_amd_queue_create=1   <- the image's flat kit
    1.21.1-local-build-3309c6114a hsa_amd_queue_create=0   <- uv cache + UNSLOTH STUDIO's site-packages
    1.18.0-local-build-unknown    hsa_amd_queue_create=0   <- distro
    

    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_create and hsa_soft_queue_create, i.e. it is missing the hsa_amd_* call the driver
    asks 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 backend
    registers 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 serve child with the pin's LD_LIBRARY_PATH), the failure it shows is a device failure with a
    runtime 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_initialize before any number from that
    chain is compared, and worth recording the runtime build id per run next to srcversion, since 1.21.0, 1.21.1 and
    1.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 carry
    the pin's 430d3d8f, so the stick's runtime is not the one with the missing symbol
    ).

  23. bong-water-water-bong commented on Nov 22, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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 spawns tools/sse_stub.py on a derived fixed port —

    port = 53990 + len(shape)      # unsloth_probe.py:134
    srv = subprocess.Popen([sys.executable, os.path.join(here, "sse_stub.py"), str(port), shape], …)

    so two runs that overlap collide, and the probe then reports the symptom, not the cause:

    first run  → ok   delta.content / reasoning_content / message.content   PASS (3 of 3)
    second run → FAIL delta.reasoning_content: <urlopen error [Errno 111] Connection refused>
                 FAIL message.content:          <urlopen error [Errno 111] Connection refused>
                 unsloth_probe self-test: FAIL (0 of 3 stream shapes read)
    same code, clean run, nothing holding the port → PASS (3 of 3)
    

    Who overlaps: two lanes running the pre-PR gate or ctest at once (this box does that constantly), a parallel ctest -j if 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 refused is 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 one readline()), or keep the derived port and retry on EADDRINUSE with SO_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.

  24. bong-water-water-bong commented on Nov 22, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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.

    • lemond: the appliance's own /opt/1bit-package/bin/lemond (2026.49.0~1.4bd453a0), a second instance of mine on 127.0.0.1:13410 with its own cache and config under /data/dev/cl-flm. The box's lemond on :13300 and the proxy on :13305 were not touched.
    • arm A: qwen3-0.6b-FLM (recipe flm) → FastFlowLM 1.0.13 (flm.prefer_system: true; tarball sha256 7c2ee388…2a72, flm-real e4321f5b…). Note that this lemond pins FLM v1.0.11; 1.0.13 is the version Unsloth Studio pins.
    • arm B: Qwen3-0.6B-NPU-1bit (recipe onebit) → /opt/1bit-package/1bit/1bit serve --device npu --ctx-size 32768, engine 31a7a523be0c (c35 package), env as /opt/1bit-package/lemond-onebit sets it.
    • Artifact: both arms read FastFlowLM/Qwen3-0.6B-NPU2@b5847992, with model.q4nx sha256 db8dec4d…a667 in both places. This is an engine-vs-engine comparison with no artifact confound.
    • Driver: srcversion F87D0BDF248067862F83BA3 (new on this appliance; the earlier rows in the table were on 5682285F). Every window was under box-hold npu with 0 amdxdna fault lines before and after.
    • Protocol: cl-npurt's armB-table.py verbatim (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 from timings{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).
    • Repeat: run twice (15:00Z and 15:19Z). The figures below are run 2, the clean-provenance run; run 1 agrees within about 2 %.

    Throughput (ranges over 4 rounds, prompt tokens 79 / 399 / 1399)

    decode tok/s (server) decode tok/s (client, same formula) prefill tok/s TTFT s (streamed)
    A FLM 1.0.13 83.5–85.0 / 78.3–79.3 / 65.2–65.4 84.4–90.1 / 82.3–83.7 / 62.7–69.9 193–202 / 847–857 / 1798–1842 0.46 / 0.54–0.55 / 0.84–0.85
    B onebit c35 76.8–77.2 / 68.3–68.7 / 51.5–52.0 76.9–77.2 / 68.7–69.5 / 49.4–54.9 101–106 / 98 / 78–80 0.77 / 4.09–4.19 / 17.6–18.3
    B/A 0.91 / 0.87 / 0.79 0.52 / 0.12 / 0.04

    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": false in its model_list.json) and answers in 20 tokens (1, 2, 3, 4, 5, 600.). Ours thinks for 469–512 tokens, all in reasoning_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:

    no-think witness, 2 rounds decode tok/s 64 / 384 / 1384 prompt tok
    A 81.7–82.5 / 75.2–75.6 / 62.7–63.6
    B 63.2–75.2 / 49.9–67.2 / 51.2–52.1

    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.

    # A (FLM) B (onebit c35) verdict
    p1 The capital of France is **Paris**. same identical (359ff4337837754e)
    p2 The first five prime numbers are: 2, 3, 5, 7, 11. 2, 3, 5, 7, 11 same numbers, formatting differs
    p3 17 × 23 = **421**. 17 × 23 = **409**. both wrong (391); they disagree with each other
    p4 "Guten Tag" Guten Tag! same words, punctuation differs; both are not literal (Guten Morgen)
    p5 …vast and mysterious body of water… …vast, dynamic body of water… different sentence, both valid

    Arm B's answers differ from those cl-npurt posted on the earlier per-op build (p2 has no leading /; p3 was 391 and is now 409). 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)

    tool call (OpenAI tools) streamed chat JSON mode
    A FAIL: prose, no tool_calls PASS (first token 0.48 s) PASS {"ok": true}
    B FAIL: HTTP 400 from lemond/onebit PASS (0.28 s; thinking first) FAIL: content not JSON (Expecting value)

    Two lemond facts that change what a Studio user gets from arm A

    1. The flm recipe ignores the load's ctx_size. lemond always launches flm serve … --ctx-len 8192 (I tried ctx_size: 32768), so a prompt over 8192 tokens gets HTTP 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.
    2. Lemond's FLM version pin (v1.0.11) is not what Studio ships (1.0.13). prefer_system is 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-hold windows 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-flm on strixhalo:

    BOX_HOLD_WHO=cl-flm box-hold npu sudo -n sh armA-lemond.sh /data/dev/cl-flm/ph-table.sh     # table + agreement, both arms
    AB_TASK=$'\n\nNow write a 600-word story about a lighthouse keeper. /no_think' AB_BLOCKS=1 AB_RPB=2  ...ph-witness.sh
    ...ph-agent.sh   # unsloth_probe.py --rounds 0 per arm
    

    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 custom provider would point at).

  25. bong-water-water-bong commented on Nov 22, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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.

    • Arm A: the flm recipe, running FLM 1.0.13 (prefer_system).
    • Arm B: the onebit recipe, running /opt/1bit-package/1bit/1bit (engine 31a7a523).
    • Same pack bytes for both arms.
    • Box: strixhalo, c35 appliance, amdxdna srcversion F87D0BDF248067862F83BA3.
    • Faults: 0 amdxdna fault lines before and after each run.

    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.

    arm A (FLM) arm B (onebit)
    decode tok/s, server, 512 18.61–18.80 / 18.04–18.41 / 17.05–17.11 15.75–15.80 / 14.89–14.92 / 12.70–12.75
    decode tok/s, client 18.67–18.78 / 18.04–18.45 / 17.06–17.21 15.80–15.85 / 14.95–14.99 / 12.75–12.84
    prefill tok/s, server 70–73 / 286–291 / 528–594 17.6–17.7 / 17.1 / 15.6
    TTFT s (streamed) 1.22–1.33 / 1.53–1.57 / 2.73–2.80 4.59–4.61 / 23.5–23.6 / 90.1–90.2
    PPT avg W 21.6–22.5 21.4–23.3

    No-think witness: "600-word story … /no_think", 2 rounds per arm, prompts of 64 / 384 / 1384 tokens.

    • Arm A: decode 18.38–18.76 / 18.42–18.48 / 17.02–17.34 tok/s; prefill 60 / 278 / 528–534 tok/s; TTFT 1.35 / 1.67 / 2.84–2.88 s.
    • Arm B: decode 15.83–15.84 / 14.93–14.96 / 12.74–12.77 tok/s; prefill 17.7 / 17.0–17.1 / 15.6 tok/s; TTFT 3.86 / 22.7 / 89.1 s.

    Agreement: the 5 prompts from the 0.6B comment, with /no_think, temp 0, max_tokens 64.

    • p1: identical.
    • p2: identical ("2, 3, 5, 7, 11").
    • p3: identical and correct ("391"). At 0.6B both arms were wrong.
    • p4: Guten Morgen vs Guten Morgen.
    • p5: same opening, then the sentences diverge.

    Agent checks (tools/unsloth_probe.py):

    • Arm A: tool call PASS, stream PASS, JSON mode FAIL.
    • Arm B: tool call FAIL, stream PASS, JSON mode FAIL.

    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…)

    • Arm B does not run on c35: the c35 package ships no NPU kernel set for the 1.7B shape, so the engine refuses the load.
    • Arm A: re-run 20:45–20:56Z under 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 under box-hold npu only 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.
      • decode (server, 512): 38.76–39.87 / 38.54–38.73 / 34.39–35.32 tok/s
      • client decode: 38.62–39.88 / 38.46–38.56 / 34.32–35.29 tok/s
      • prefill (server): 110–131 / 482–504 / 1040–1088 tok/s
      • TTFT (streamed): 0.72–0.75 / 0.89–0.91 / 1.42–1.45 s
      • No-think witness (64 / 384 / 1384-token prompts): decode 38.89–40.10 / 37.66–38.54 / 35.34–35.48 tok/s
      • Agreement:
        • p1: Paris.
        • p2: "3, 5, 7, 11, 13", which is wrong (it drops 2).
        • p3: "391", which is correct.
        • p4: "Guten Morgen".
        • p5: a 70 % ocean sentence.
      • Agent checks: tool call FAIL, stream PASS, JSON mode FAIL.
      • Arm B refused again in this run: HTTP 500 after lemond's 7 attempts, the same cause as above.

    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.sh is ph-4b.sh with the 1.7B model ids. The run dir is runs/ladder-17b-1122-2045.

    Commands

    The scripts live in /data/dev/cl-flm/ on the box. The run dir is runs/ladder-4b-1122-1853.

    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-4b.sh'
    # ph-4b.sh refuses to start while any 1bit serve / flm-real it did not start is running.
    # Then it runs, against the lemond above:
    #   AB_A=qwen3-4b-FLM AB_B=Qwen3-4B-NPU-1bit python3 armAB-table.py   # table
    #   the same with AB_TASK = the no-think story prompt                 # witness
    #   python3 agree5.py; python3 tools/unsloth_probe.py --rounds 0      # once per arm
    

    FastFlowLM's NPU kernels are MIT-licensed; thanks to the FastFlowLM authors. Arm B runs our own runtime.

  26. bong-water-water-bong commented on Nov 22, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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.

    • Chain: Unsloth Studio 2026.11.9 --api-only (127.0.0.1:13420) → its own /v1/chat/completions → a saved custom provider (routed with provider_id + external_model) → my lemond (127.0.0.1:13410, appliance build 2026.49.0~1.4bd453a0).
      • Arm A: the flm recipe, FastFlowLM 1.0.13.
      • Arm B: the onebit recipe, /opt/1bit-package/1bit/1bit, engine 31a7a523.
    • Harness: cl-npurt's arm-B script from the old box, with only the endpoints and model id turned into parameters. The requests are identical for both arms: one streamed chat, one tool call (OpenAI tools, get_weather, tool_choice:auto) and one JSON-mode request (response_format: json_object). All at temperature 0.
    • Run: one box-hold npu window, 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.
    • Studio install: installer sha256 35ea5eba…7855, with UNSLOTH_NO_TORCH=1 and 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).
    check (through Studio) arm A 0.6B (FLM) arm B 0.6B (onebit) arm A 4B (FLM) arm B 4B (onebit)
    streamed chat, max_tokens 256 PASS: 23 frames, [DONE], 124 answer chars, no reasoning (FLM defaults to no-think), 1.1 s PASS: 151 frames, 647 reasoning + 114 answer chars, 3.5 s frames + [DONE] OK, but the whole budget went on reasoning (1319 chars, 0 answer), 21.0 s same as A: 1452 reasoning chars, 0 answer, 27.8 s
    tool call FAIL: finish:stop, prose about the weather, no tool_calls refused: HTTP 400 at the engine, which says plainly that the NPU route cannot apply tools, instead of silently ignoring them. Studio passes the error through. PASS: finish:tool_calls, get_weather {"city":"Vienna"}, 9.2 s refused: same explicit 400
    JSON mode, max_tokens 128 PASS: {"city": "Vienna", "ok": true}, 1.8 s FAIL: empty content FAIL: empty content (budget likely spent on reasoning) FAIL: empty content

    How to read it:

    • Streaming works in both arms through Studio. At 4B, both models are thinking models and 256 tokens is all reasoning, so a client that reads only content sees an empty reply. That is the client trap cl-npurt described, and it applies to both arms equally.
    • Tool calling: on c35, arm A gets it right at 4B and not at 0.6B. Arm B refuses tools with an explicit error on its NPU route.
      • This differs from cl-npurt's old-box arm-B PASS, which ran the per-op build, a different route from the shipped c35 one.
      • So for an agent app on this appliance today, only FLM at 4B returns a usable tool_calls.
    • JSON mode passes only on FLM 0.6B, which does not think. The empty replies at 4B and on onebit 0.6B are most likely reasoning using up the 128-token budget; I did not re-run with a larger budget, so treat that as unproven.

    Commands

    On the box, scripts in /data/dev/cl-flm. The run dir is runs/studio-1122-2108; it has Studio's log, lemond's log and the raw engine replies.

    # one-time, CPU/network only: sandboxed Studio install
    sh studio/studio-install.sh   # wraps: UNSLOTH_STUDIO_HOME=$PWD/studio/studio UNSLOTH_NO_TORCH=1 UNSLOTH_SKIP_AUTOSTART=1 HOME=$PWD/studio/home sh install.sh --no-torch
    # the checks
    BOX_HOLD_WHO=cl-flm box-hold npu sudo -n sh armA-lemond.sh /data/dev/cl-flm/ph-studio.sh
    #   ph-studio.sh: starts `unsloth studio --api-only --host 127.0.0.1 --port 13420` as bcloud, then for each of
    #   qwen3-0.6b-FLM, Qwen3-0.6B-NPU-1bit, qwen3-4b-FLM, Qwen3-4B-NPU-1bit: POST lemond /api/v1/load, then
    #   CHK_STUDIO=http://127.0.0.1:13420 CHK_ENGINE=http://127.0.0.1:13410/api CHK_MODEL=<id> python3 studio-checks.py
    

    Not covered: Studio's own managed NPU path, where Studio drives FLM directly through its flm_host with 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.

  27. bong-water-water-bong commented on Nov 22, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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-a3b

    Setup is the same as my earlier comments: my lemond (appliance build 2026.49.0~1.4bd453a0), the flm recipe, FLM 1.0.13.

    • Model: FastFlowLM/Qwen3.6-35B-A3B-NPU2, pulled by flm pull, 21 GB on disk, model.q4nx sha256 a763f82a…d175.
    • srcversion F87D0BDF248067862F83BA3, 0 new amdxdna fault lines in either ticket.
    • Two box-hold npu tickets (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):

    arm A (FLM) Unsloth's published row
    decode tok/s (server, 512) 16.12–17.92 / 16.94–17.87 / 16.31–17.42 17.2
    decode tok/s (client) 16.14–17.91 / 16.94–17.81 / 16.60–17.50
    prefill tok/s (server) 23.7–24.6 / 86.6–91.6 / 196–209
    TTFT s (streamed) 3.31–3.51 / 4.59–4.84 / 7.10–7.72 3.13
    PPT avg W 20.1–67.7 (some rounds shared the package)

    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:

    • Through lemond directly (unsloth_probe.py): tool call PASS, stream PASS, JSON PASS.
    • Through Unsloth Studio 2026.11.9 (the custom provider):
      • streamed chat PASS: 26 frames, [DONE], 129 answer chars, 4.4 s;
      • tool call PASS: finish:tool_calls, get_weather {"city":"Vienna"}, 7.8 s;
      • JSON mode PASS: {"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.json on main marks Qwen3.6-35B-A3B-NPU-1bit: null: the entry needs a route this payload does not ship.
    • The c35 package carries NPU kernel sets only for the 0.6B and 4B dense shapes.
    • c35's catalogue still lists it (23.2 GB). On the next built catalogue, release: the catalogue offers only the NPU models whose kernel set ships #3300's filter drops it.
    • I did not load it: a load would only download 23.2 GB and then refuse.
    • Our ~16 tok/s figure for this model comes from the private add-on build on the old dev box, not from anything shipped. So there is no like-for-like arm-B row for this model yet.

    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.

    • Arm A: FLM does not expose its per-token expert choices through any API. Getting them would mean instrumenting FLM's runtime, which our rules rule out: its source is reference only, and we don't reverse-engineer it.
      • FLM's own published measurement is the reference point. In their moe_precision notes 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 FastFlowLM flm-dev-kit docs; read as reference only, nothing copied.)
    • Arm B: this needs our MoE NPU route on the box, plus a dump of the top-8 indices per token and layer from that route. Those would be compared against a bf16 router reference computed on the CPU, on the same prompts.
      • Metric: mean |top-k ∩ top-k_ref| / k per layer, and the share of tokens with at least one swapped expert.
      • That belongs in the route's known-answer probe. Once a payload ships the route, I can run it with this issue's harness and post it next to the numbers above.

    Commands

    ssh strixhalo 'cd /data/dev/cl-flm && env HOME=$PWD/home flm/flm pull qwen3.6-moe:35b-a3b'          # network only
    ssh strixhalo 'cd /data/dev/cl-flm && BOX_HOLD_WHO=cl-flm box-hold npu sudo -n sh armA-lemond.sh /data/dev/cl-flm/ph-35b-table.sh'
    ssh strixhalo 'cd /data/dev/cl-flm && BOX_HOLD_WHO=cl-flm box-hold npu sudo -n sh armA-lemond.sh /data/dev/cl-flm/ph-35b-rest.sh'
    #   table: AB_A=qwen3.6-moe-35b-a3b-FLM AB_B=none armAB-table.py (4 rounds); rest: witness, agree5.py, unsloth_probe.py,
    #   then ph-studio.sh with STUDIO_MODELS=qwen3.6-moe-35b-a3b-FLM. Run dirs: runs/35b-table-1122-2315, runs/35b-rest-1122-2333, runs/studio-1122-2342.
    

    FastFlowLM's NPU kernels are MIT-licensed; thanks to the FastFlowLM authors.

  28. bong-water-water-bong commented on Nov 23, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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 unless UNSLOTH_NPU_LEMONADE=1 is set.

    • Studio's installer, run outside any hold (network only), fetched an FLM that is byte-identical to the one behind my lemond rows: flm 54232a85…, flm-real e4321f5b….
    • So this row and my earlier arm-A rows differ only in the front end, not the engine.
    • The model files are the same bytes, linked into Studio's model dir, so nothing was re-downloaded.

    35B artifact identity, relevant to my previous comment:

    • FastFlowLM/Qwen3.6-35B-A3B-NPU2 has two different model.q4nx builds: main (23.2 GB, 688f1e15…) and branch flm_q4k_high_precision (21.0 GB, a763f82a…).
    • flm pull (FLM 1.0.13) fetches the flm_q4k_high_precision one. Studio's catalogue lists that same revision, and it is the 20.6 GB in Unsloth's table.
    • So the 35B numbers I posted were on the exact shipped bytes.

    Run: one box-hold npu ticket, 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.

    • Studio ran as root in this ticket only because FLM needs /dev/accel/accel0, which is root 0600, and memlock. Nothing outside /data/dev/cl-flm was touched.
    • Requests went through Studio's own /v1/chat/completions, using the same three prompts as my table, 2 rounds each.
    • All numbers here are client-side: TTFT = first streamed token; decode = (n−1)/(wall−TTFT). Studio's log does not carry FLM's server-side timings.
    model managed path: decode tok/s (75–79 / 395–399 / 1395–1399 tok) TTFT s my lemond-path rows (client decode)
    Qwen3.6-35B-A3B 16.96–17.02 / 16.90–16.96 / 16.60–16.70 3.34–3.37 / 4.67–4.74 / 7.20–7.22 16.14–17.91 / 16.94–17.81 / 16.60–17.50; TTFT 3.31–3.51 / 4.59–4.84 / 7.10–7.72
    Qwen3-4B 15.33–17.80 / 17.28–18.51 / 16.36–17.14 1.14–1.25 / 1.65–1.78 / 2.95–3.03 18.67–18.78 / 18.04–18.45 / 17.06–17.21
    Qwen3-0.6B 79.0–83.6 / 68.2–78.6 / 42.1–42.3 1.08 / 0.64–0.68 / 1.27–1.69 83.6–86.7 / 78.1–79.7 / 64.5–65.4 (server)

    How to read it:

    • 35B: the managed path and my lemond path agree within noise, and both reproduce Unsloth's 17.2 tok/s and 3.13 s. Which front end sits in front of FLM makes no measurable difference for this model.
    • 0.6B: on the 1399-token prompt the managed path decodes at 42 tok/s, against 65 through lemond, on the same FLM binary and the same model bytes.
      • Context length is ruled out (follow-up ticket, 01:33:44–01:36:29Z, 0 faults). flm serve qwen3:0.6b run directly at --ctx-len 8192, then 32768, then 8192 again, with the same prompts and think: 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.
      • So FLM itself does 63 tok/s at 1399 tokens whatever the context length. The 42 tok/s comes from the managed path between FLM and the client, Studio's flm_host or 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.
      • I have not found the cause. Studio's log carries no FLM timings, so I can't separate the two halves from here.
      • Studio also turns thinking on for 0.6B: all 512 tokens were generated, against 20 no-think tokens through lemond. That changes what is generated, but not the per-token rate.
    • 4B: within about 10 % of the lemond path; the first round at 15.3 tok/s is the low outlier.

    Agent checks on the managed path:

    0.6B 4B 35B
    streamed chat PASS (answer text) stream OK, but 256 tokens of reasoning and no answer stream OK, but 256 tokens of reasoning and no answer
    tool call refused by Studio: HTTP 400 "This NPU model does not support tool calling" (its catalogue has supports_tools: false) PASS get_weather {"city": "Vienna"} PASS get_weather {"city":"Vienna"}
    JSON mode, 128 tokens FAIL (empty) FAIL (empty) FAIL (empty)

    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

    # outside any hold, network only: Studio's own NPU runtime install
    $STUDIO/unsloth_studio/bin/python -I -c 'import install_lemonade_prebuilt as m; from pathlib import Path; m.install(Path("$STUDIO/lemonade"))'
    # the run (studio-managed.py: login -> POST /api/npu/enable -> /api/inference/load {"model_path":"lemonade:<id>"} -> /v1/chat/completions)
    ssh strixhalo 'cd /data/dev/cl-flm && BOX_HOLD_WHO=cl-flm box-hold npu sudo -n env RAM_NEED_GB=34 sh armA-lemond.sh /data/dev/cl-flm/ph-managed.sh'
    # run dir: /data/dev/cl-flm/runs/managed-1123-0103 (studio.log, managed.json)
    
  29. bong-water-water-bong commented on Nov 27, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    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.

    method item status where
    decode / prefill / TTFT at short / ~2k / ~8k, ≥ 4 interleaved rounds, ranges met, 0.6B, 1.7B, 4B (both arms), 35B (arm A) 0.6B, 4B + 1.7B, 35B
    power during decode met: PPT (package) per row; NPU-only power is not readable on this box same comments
    agent-app through Unsloth's own API: tools, streamed chat, JSON mode met, through Unsloth Studio 2026.11.9 itself, both arms, 0.6B + 4B Studio checks
    greedy text agreement, 5 fixed prompts, same model + quant met (cl-npurt's 5-prompt set, byte for byte) 0.6B, 4B + 1.7B
    versions / shas / command line / srcversion per run met every comment above, plus Studio's managed path

    The answer the issue asked for (c35, server-side rates, ranges over 4 rounds):

    model decode tok/s A (FLM 1.0.13) decode tok/s B (onebit) prefill tok/s A prefill tok/s B
    Qwen3-0.6B (prompt 79 / 399 / 1399) 83.5–85.0 / 78.3–79.3 / 65.2–65.4 76.8–77.2 / 68.3–68.7 / 51.5–52.0 193–202 / 847–857 / 1798–1842 101–106 / 98 / 78–80
    Qwen3-4B 18.61–18.80 / 18.04–18.41 / 17.05–17.11 15.75–15.80 / 14.89–14.92 / 12.70–12.75 70–73 / 286–291 / 528–594 17.6–17.7 / 17.1 / 15.6
    Qwen3.6-35B-A3B 16.12–17.92 / 16.94–17.87 / 16.31–17.42 (Unsloth publishes 17.2; reproduced) cannot run on this payload (see the 35B comment) 23.7–24.6 / 86.6–91.6 / 196–209 —
    • Decode: arm B is 0.79–0.91x arm A at 0.6B and 0.74–0.85x at 4B.
    • Prefill is the gap: arm B is flat in prompt length because it runs one position per launch. At 4B the TTFT at 1399 tokens is 90 s against 2.8 s.
    • Agent app: arm A answers tools with prose (no tool_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:

    1. Arm B prefill, one position per launch: npu-kernels#75 (open).
    2. Arm B 35B on the NPU: not on this payload (MoE-on-NPU parked; Inkling on the NPU is Inkling family on the NPU: Inkling-2-Mini first light through a ggml ACCEL backend (NPU matmuls, CPU rest), then experts on our own GEMV path #3335).
    3. The shipped route's tool calling: it refuses by design (merged 76153232aa and follow-ups). Real tool support on the NPU route would be a feature, not this comparison.
    4. Arm B JSON mode returning empty content on 0.6B: needs its own issue if wanted. Not filed by me; it is a one-line repro in the Studio-checks comment.

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions