Repository navigation
Description
The engine's story is device placement, not model count. We have concurrency evidence, but it is Sept-era, it lives outside this tree, and nothing at the current pin has been measured. This epic is the one demo config that proves the claim, measured, published as a table.
Numbers to beat (all already on record, none re-measured since):
| Arrangement | Result |
|---|---|
| Two concurrent NPU streams, disjoint array halves | ~100 % of single-stream speed each — the arrangement that scales |
| Four concurrent NPU streams, whole array each | all correct, but ~24 % per stream and aggregate ≈ single stream: the array serialises |
| N small engines resident | 17.1 GB peak each; N=4 safe with the other units up, N=8 trips the OOM killer on a 124 GB box |
HRX batching, N=8, aggregate tok/s (docs/releases.md) |
27B 50.7 (2.08x), Coder-30B 138.1 (1.64x), Qwen3.5-4B 194.3 (3.39x) |
So the two ceilings are different, and the demo must say which one it hits: compute-bound on the NPU past two streams (stacking contexts buys nothing), memory-bound on the number of 8B-class engines (4, not 8). Neither is "as many models as fit".
What to build
- Port the two-stream NPU decode. The two-concurrent-streams prototype (Sept, outside this tree) is the only thing that showed near-linear scaling on the NPU, and
npu/today has no expression of two resident streams sharing the array. Port it onto the current lane, or write down why it cannot be ported and what replaces it. Target: two streams each at ~single-stream speed on the current pin, >= 3 repeats. - Answer the router question before building one.
1bit serveis one model per process, so N models means N processes plus something fronting them. Does Lemonade's catalog keep a second model resident and route by model name, or does it reload on switch? One measured answer (the switch cost, and whether two stay resident) decides whether the router is free or new code. Do not build a proxy until that is answered. - One measured demo config at the current pin, published as a table with per-row instrument, repeats and timestamp: two small models on the NPU + a batched 27B on HRX + the embed unit, all answering at once under the 90 W cap. Report per-stream and aggregate tok/s, peak RSS/VRAM per resident model, and the memory arithmetic that makes the ceiling explicit.
- Hybrid as the second claim, not a capacity stunt. NPU prefill + HRX decode on the 27B (
docs/hybrid.md) is the differentiator nobody else ships, and it is-np 1with--parallel > 1refused today. State what it contributes to the demo (latency, not throughput) and what would have to change for it to be more.
Non-goals
- No "how many models fit" headline number beyond what the table measures; a spread shown, never a mean alone.
- Nothing about NPU kernel internals, sealed sets, or the own-runtime mechanism in any public artifact — this issue included.
- Does not change NPU: Qwen3.8-27B-NPU2 (FastFlowLM Q4NX, 17.1 GB) on the NPU route and as the hybrid prefill side #587, HRX: Qwen3.8-Flash-Next prefill is 287 tok/s on UD-IQ4_XS vs 1,679 for gufo on the same box (and 500-2,400 across published Strix Halo engines) #572 or HRX: Qwen3-4B --parallel 4 NaN logits on a never-used slot while another GPU job runs (CWSR off) #528; the prefill and NaN work keep their own sequencing.
Done when
A table at the current pin with provenance per row; a written answer on the router; a port verdict on the two-stream path (ported and measured, or refused with the reason); and an explicit statement of both ceilings so no reader infers more than was measured.
Activity
bong-water-water-bong commentedon Oct 27, 2026
Answering the two build items that had to be settled before writing anything (item 2) or porting anything (item 1), both now measured.
Item 2 — Lemonade router: two LLMs cannot be resident, so a routing proxy buys nothing
From the running server on
strixhalo(lemond 2026.42.1):~/.config/lemonade/config.jsonsays"max_loaded_models": 2, but that is across categories; theper-category cap is 1, so loading a second LLM evicts the first. Switch cost is a full reload — from
/home/bcloud/wt/autoopt-db/logs/lemond-102337.log, the same 27B (Qwen3.8-27B-UD-Q4_K_XL.gguf):llama_server: model loadedSo the answer to "does a second model stay resident and what does a switch cost" is no, and
6–11 s for a 27B. A name-routing proxy over two LLMs would serialise users through reloads; it is
not worth building. If we ever want two models live, the cap has to change in Lemonade, not in a proxy
in front of it.
Item 1 — two-stream NPU decode: refuse, with the reason quantified
The two-stream prototype is not in this tree, and the measurement that decided it is the decode cost
model we now have from #587: one token streams 24.3 GB of int8 weights at ~2.2 GB/s effective
DMA bandwidth. Splitting the array into two column halves does not add bandwidth — the September
prototype showed 2 streams at ~100% each only by giving each stream a disjoint half of the columns,
which halves per-stream weight reuse; four full-array streams measured ~24% each with no aggregate
gain (full-array execution is mutually exclusive). Porting it here would produce a demo that is
slower per stream and equal in aggregate on this box, which is the opposite of what a showcase should
show.
Item 4 — hybrid: latency claim only, and it loses
NPU prefill of the 27B is 5 tokens in 58.1 s (after #624). NPU-prefill + HRX-decode cannot beat HRX
decode on the iGPU at those numbers, so the hybrid is stated as a latency claim we measured and lost,
not as a demo.
What is left for the demo (item 3)
One measured config at the current pin: HRX batched decode at
-np 8on the 27B, instrumented with~/lb/*harness (wall clock +/proc/<pid>/statcpu_s + repeats + timestamp). Queued behind theowner's
llama-quantizejob on the box; every row will carry instrument, repeats and timestamp per therecord rule.
bong-water-water-bong commentedon Oct 28, 2026
Nothing in this epic can be answered from code, and I will not fake it from the logs — the epic explicitly asks for measured at the current pin, and every input row it cites is Sept-era or out-of-tree.
What the tree does have at the current pin, and where it falls short of the demo:
docs/npu-leaderboard.md:31-35has single-stream 27B Q4NX rows (prefill 58.14 sbatched chunk,decode 63.1 s/token,first token 145.7 s). Nothing measures two concurrent NPU streams on disjoint array halves or the N=8 OOM boundary at this pin — those are the two rows that decide the "device placement, not model count" claim, and both are in the issue's own table as Sept-era numbers.docs/npu-leaderboard.md:30givesQwen3-4B parallel=4, requests=60 -> 41.48 tok/s decode, i.e. one batching point, not theN=8aggregate rows (27B 50.7 / Coder-30B 138.1 / Qwen3.5-4B 194.3indocs/releases.md).Classification: needs GPU measurement (strixhalo NPU + GPU; this box is CPU-only and the
~/lbpass owns the GPU). Minimum set to close the epic, all on one boot, one pin: (1) 2 NPU streams on disjoint array halves, per-stream and aggregate tok/s; (2) the same with whole-array streams to show the serialisation is still there; (3) HRXN=8aggregate tok/s for the 27B / Coder-30B / Qwen3.5-4B trio; (4) one hybrid row: 27B NPU prefill + 27B HRX decode, end-to-end first-token and decode. Then the table in this issue can be rewritten withengine=<pin>on every row.bong-water-water-bong commentedon Oct 30, 2026
Restating the demo rows as measured in the 2026-10-29 pass, each stamped with the pin that produced it (full matrix and evidence in
showcase-612-findings.md).2-stream NPU. As shipped the second stream is not slow, it does not exist: it prints
[npu] waiting for the exclusive device lock (/tmp/1bit-npu-device.lock)...and never binds its port in 90 s (http=000), becauseapp/forward_serve.cpp:311-333takes an exclusiveflockfor the process's lifetime — 0% of solo. WithNPU_NO_DEVICE_LOCK=1both contexts come up: solo 6.31 / 6.23 s, concurrent 9.51 / 9.51 s → 65.7% of solo per stream, 1.31× aggregate (Qwen3-0.6B-Q4_K_M, max_tokens 8, temperature 0, 3 reps, rep 1 dropped as 13.45 s warm-up, build~/wt/npu-m16/build/1bit=a88ef00, not on main). The lock's own justification comment atapp/forward_serve.cpp:311-318— that the device "rejects the context request with EINVAL and the whole serve exits 1" — is contradicted by execution: with the lock bypassed the second context initialised cleanly (full ELF ok: uuid=326ce6cf-...) and served.Batched HRX.
-np 8measured 1.39× (86.96 → 121.27 tok/s aggregate, 15.27 per stream, 8/8 streams alive) on Qwen3-Coder-30B-A3B at engine3092596/ llama.cpp00f2a68de— not at the current pin; no build of5c2aee2exists on the box (git cat-file -t 5c2aee2→fatal: Not a valid object name 5c2aee2). The spread is the story: 93.05 / 94.78 / 101.12 / 121.27 tok/s across four N=8 sessions with the samen_slots = 8, i.e. ±14%; the on-record 138.1 tok/s (1.64×) was not reproduced.27B
--parallel. The row cannot be produced at all on any staged package: the route refuses it verbatim — "no multi-sequence gated delta-net on HRX".September rows. "2 streams ~100% each" does not hold — 65.7% each at best, and the prototype cannot be re-run (its model is gone, its halved xclbin pair is ABI-stale by its own header). N=4 and N=8 are unmeasured, as is the 17.1 GB / N=8 OOM boundary.
Next: a decision on the flock policy — publish 65%/1.31× with its caveats, or lift and scope the lock and port the disjoint-column-half schedule, which is a new serving mode and therefore an RFC per
CONTRIBUTING.md:47— plus a 27B-capable multi-sequence story before that row can exist.bench: HRX batched decode on Qwen3-Coder-30B-A3B at the current pin (…
bong-water-water-bong commentedon Oct 30, 2026
The demo, rebuilt at one pin, as four pull requests. Every row below names the build that produced it;
rows that could not be measured say so and say why, rather than carrying a September number forward.
Pin for the whole table: engine
origin/main38e29a2(2026-10-30), plus each row's own branch;HRX llama-server
40c4ccb76(thethird_party/llama.cpppin). Box: strixhalo, kernel7.3.0-rc4-1bit-perfopt+. GPU rows ran under~/.local/bin/gpu-hold -l "pi i612"; NPU work only when/tmp/1bit-npu-device.lockis free.--npu-streams 2)38e29a2+b78868c,-DONEBIT_NPU=ONtools/showcase-612-npu-streams.shexits 75 naming the holder1bit serve --parallel Non Qwen3-Coder-30B-A3B-Q4_K_M38e29a2+b78868c, llama.cpp40c4ccb76--parallel 262.96 (0.75x),491.11 (1.08x),8112.89 (1.34x); 5 reps, median, wall clock +usage.completion_tokens,n_predict=128, greedy38e29a2, llama.cpp40c4ccb76800cf6fera) are four orders of magnitude from that gate, so hybrid is a measured loss, not a demo38e29a2tools/showcase-612.sh rowslists the rows;npu-streams/hrx-batched 2 4 8/hybriddrive themThe flock decision this issue was waiting on
The issue ended on a choice: publish 65.7 % / 1.31x with its caveats, or lift and scope the exclusive
lock. Both: the lock is still exclusive by default, and
--npu-streams Nis the supported,opt-in way to run N serves on one device (N >= 2 takes a shared
flock, so the opted-in streamsco-exist while any exclusive holder — an unflagged serve, the ELF runner, another build — still keeps
them out). The hwctx accounting is now written down instead of being a comment that said "the device
exposes a single hardware context": it is 16 (
hwctx_limitin the amdxna npu4 tables), and whatactually limits N is that each stream packs its own copy of the weights and they share one DMA engine.
NPU_NO_DEVICE_LOCK=1stays as an unsupported escape hatch, not as a mode. RFC:https://github.com/orgs/1bit-MONSTER/engine/discussions/639.
What the numbers say about the September rows
lock bypassed, and that is the number to quote until row 1 above is measured on the opted-in path.
138.1 tok/s / 1.64xdoes not reproduce at this pin(
112.89 / 1.34x), and neither does the shape of the curve —--parallel 2is a loss (0.75x),because a two-row decode batch costs 29.0 ms/token per stream against 11.9 ms for one row. With
ONEBIT_HRX_DECODE_SPLIT=0the same--parallel 2server gives 57.59 from a 45 tok/s solo, so thevectorised decode-split path is the obvious suspect for why the second row does not pay; that is a
follow-up, not a claim.
described as a route we will demo.
Row 1 is the only row still open. It is one command the moment the device lock is free:
tools/showcase-612.sh npu-streams, and its table goes into #640.npu: cross-runtime lock protocol, the partition/hwctx note, two model…
docs(npu): the FLM parameter map in a model dir is not ours (engine#612)
bong-water-water-bong commentedon Oct 30, 2026
The device row: two NPU engines, two different models, both resident — measured
Run 2026-10-30 08:23–08:27 local (11:23–11:27Z), with the owner's Bonsai job paused and
/tmp/1bit-npu-device.lockfree. Binary built atb78868c(-DONEBIT_NPU=ON,/home/bcloud/wt/612-npu-build/1bit), tree at27ed2b9, engines38e29a2+ this branch. Kernels~/lb/lfm2-npu/kernels_m16(the full-ELF set for both models, checked file by file). Both serves ran--npu-streams 2and both logged[npu] shared device lock acquired (one of --npu-streams): no lockbypass, no
NPU_NO_DEVICE_LOCK, and nothing else held the device.Protocol: 8 greedy tokens per request (
temperature 0), 3 reps per arm, rep 1 dropped as warm-up,each model first measured alone with the other not even loaded, then both at once from fresh loads.
Instrument: wall clock per request, token count from the route's own
finish_reason == length(the NPU answer carries no
usageblock). Raw rows:~/lb/612-npu-streams-20261030T112326Z/rows.csv.Reps, per arm, in order: 0.6B alone 5.778 / 5.804 s; 4B alone 25.111 / 25.053 s; concurrent 0.6B
16.702 / 17.284 s and 4B 35.569 / 35.643 s. Both rounds' walls move by <3 %, so this is not noise.
What it proves, and what it does not
Proves: two instances of this runtime, on two different models, one device, both serving at the
same time through the supported opt-in path — the "all NPU models at once" shape the second engine
exists for, with no lock bypass and no eviction of anybody. It also proves the hwctx accounting in
docs/npu.md: 2 of the device's 16 contexts, each stream holding its own copy of its model's weights
(0.68 GB and 3.29 GB of
model.q4nx), both fitting.Does not prove throughput. Aggregate is 0.41x: running the two models one after the other is
2.4x better than running them together. The per-token times add up almost exactly (0.72 + 3.13 s solo
per token = 3.85 s; concurrent rounds take 4.45 s), which is what "two whole-array streams share one
DMA engine" looks like in numbers, plus ~16 % of handoff overhead on top. The small model loses most
(34 % of solo) because it is latency-bound rather than bandwidth-bound; the 4B keeps 70 % because its
token cost is dominated by its own 3.3 GB weight stream, which is bandwidth it would have spent anyway.
So co-residency buys availability, not throughput: each model keeps answering while the other is
loaded, instead of the 25–30 s reload the 4B costs. For a short answer, reloading is still cheaper than
sharing the device — that is the honest trade, and it is now written down in docs/npu.md.
The earlier 65.7 % / 1.31x figure (Qwen3-0.6B twice, lock bypassed, engine
a88ef00, 2026-10-29) is adifferent protocol — the same model twice, so both streams stream identical weights — and stays cited
as that, not as this row.
The NPU device lock was released at the end of the run (verified: no holder in
/proc/locks, no serveprocess left).
docs(npu): the measured row for two engines, two models (engine#612)
bong-water-water-bong commentedon Oct 30, 2026
The demo table, one pin per row
Every row names the build that produced it. Rows that could not be measured say so and say why — no
September number is carried forward without a label.
Box strixhalo, kernel
7.3.0-rc4-1bit-perfopt+, 32 threads, 124 GB, 2026-10-30.Engine pin
origin/main38e29a2(+ each row's own branch), llama.cpp pin40c4ccb76,NPU driver
hwctx_limit = 16(npu4), kernels~/lb/lfm2-npu/kernels_m16(full-ELF sets,checked file by file for both models).
Discipline GPU rows under
~/.local/bin/gpu-hold -l "pi i612" -t 20; NPU rows only while/tmp/1bit-npu-device.lockwas free (owner's job paused, GO window); nothing evicted, noNPU_NO_DEVICE_LOCKin the measured rows.--npu-streams 2)38e29a2+b78868c, treec2d01fd,-DONEBIT_NPU=ON, 8 greedy tokens, temp 0, 3 reps/arm, rep 1 dropped, wall clock +finish_reasontoken count~/lb/612-npu-streams-20261030T112326Z1bit serve --parallel N, Qwen3-Coder-30B-A3B-Q4_K_M38e29a2+b78868c, llama.cpp40c4ccb76,n_predict=128, greedy, 5 reps median, wall clock +usage.completion_tokens262.96 (0.75x),491.11 (1.08x),8112.89 (1.34x)~/lb/612-hrx-20261030T064957Z, leaderboard recordscoder30b-hrx-*38e29a2, llama.cpp40c4ccb76, HRX 30B, 307-token prompt, 8 greedy tokens, 3 requests800cf6fera), four orders of magnitude from that gate → measured loss, not a demo~/lb/612-hybrid-20261030T070440Z38e29a2tools/showcase-612.sh rowslists the rows;npu-streams/hrx-batched 2 4 8/hybriddrive themWhat the table says
0.41x aggregate — back-to-back is 2.4x faster than co-resident. Co-residency buys availability (each
model keeps answering instead of a 25–30 s reload), not speed. The arrangement that scaled in
September, disjoint array halves, needs its own kernel build and a partition id in the lock:
#656, which carries this table, the unverified
September claim and the smallest build plan (acceptance: aggregate > 1.0x with identical greedy output).
--parallel 2is a loss (0.75x),4isflat (1.08x),
8is 1.34x — the on-record138.1 tok/s / 1.64xdid not reproduce, while the2026-10-29 pass's
121.27 / 1.39xis close. Suspect (not claim): the vectorised decode-split pass stopspaying once a second row is in the batch — with
ONEBIT_HRX_DECODE_SPLIT=0the same--parallel 2server gives 57.59 tok/s from a 45 tok/s solo.
would have to beat the decoder's ~95 ms is 58 s per chunk.
0.41x with disjoint models (not "~100 % each"), and every batched HRX row is pinned.
Still unmeasured
bong-water-water-bong commentedon Oct 30, 2026
Follow-up filed: #656 — two resident engines need disjoint-array-half kernel sets
(per-engine column partition at ELF build time, partition id in the lock, the 0.41x whole-array table
above, the unverified September "~100 % each" claim, and the smallest build plan with an acceptance test
of aggregate > 1.0x and identical greedy output).
Splitting it that way keeps the promises honest: PR #640 delivers the mechanism (opt-in shared lock)
and states its measured cost (0.41x aggregate for two different models on whole-array sets), and the
arrangement this issue's own table calls "the one that scales" gets its own build, its own verification
path (bounds proof → small-shape CPU-vs-NPU checks → model) and its own number — or gets closed with that
number if the column split does not deliver it at this pin.
npu: the cleanup trap can kill the serves it started, and the docs qu…
bench: HRX batched decode on Qwen3-Coder-30B-A3B at the current pin (…
docs: what the hybrid route costs at this pin, and why its row is not…
npu: --npu-streams N, the opt-in second engine — mechanism and its me…
tools: one entry point for the engine#612 demo (#645)
bong-water-water-bong commentedon Oct 30, 2026
Correction to the
--parallel 8row in my table above (and to the merged #643 record): it iswithdrawn. Re-measured on an idle box (Tctl 44 °C at start, GPU token free, queue empty), 5 reps per arm,
~/lb/612-hrx-20261030T211252Z:--parallelllama-server's own per-slot
tgcounters inside one--parallel 8run walk14.99 15.12 14.34 12.10 7.09 6.78 5.70 5.64, then jump back to14.17for a fresh batch: the decoderate decays as the answers grow and recovers when the batch restarts, and it is not thermal — die
temperature 61–71 °C with iGPU
sclkswinging normally (694–2127 MHz, sampled every 2 s). So an 8-streamaggregate is a function of where in that decay it is sampled: 112.89 / 1.34x earlier today,
78.87 / 0.97x and 68.29 / 0.92x (6 reps) later.
What stands from the table:
--parallel 2is a loss (0.75x, two independent measurements on differentclock states) and
--parallel 4is flat (1.04–1.08x). The 8-stream row joins the September rows inthe "do not quote without the per-rep range" bucket, and the merged leaderboard record is deleted rather
than renumbered — PR #670.
Also worth knowing for anyone measuring on this box today:
/is at 98 %, 50 GB free, against a150 GB lane floor — it was 302 GB at 06:00Z. Nothing I ran wrote more than a few MB, but big jobs here
will trip on it.
bench: re-measured on an idle box -- parallel 2 and 4 hold, the 8-str…
docs(hybrid): NPU and GPU run at the same time, measured -- no hazard…
bong-water-water-bong commentedon Oct 31, 2026
Closing: all five items are merged, the last one today.
--npu-streams N, the opt-in second engine, and its measured cost (0.41× aggregate for two different models on whole-array kernel sets)#6403c2521222max_models.llm = 1, a second LLM evicts the first, switch cost 6–11 s for a 27B → no router, the cap has to change in Lemonade, not in a proxy#612comment 2026-10-27 (no code by design)--parallelon Qwen3-Coder-30B-A3B: solo 84.2; np2 0.75×, np4 1.04×, np8 withdrawn as non-stationary on re-measurement#64386a6979d8, corrected by#670da9d75f59#64476e3bbd49#6738994d6cf7tools/script + the pinned table#645369f687aaWhat is verified, in the issue's own terms. Every row in the demo table names the build that produced it, and
the rows that could not be measured say so and say why — that was the epic's actual requirement ("measured at the
current pin"), and it is met: the 2-stream device row exists (two different models resident, 34.1 % / 70.4 % of
solo, 0.41× aggregate), the batched-HRX rows are re-measured on an idle box with the 8-stream row withdrawn rather
than carried, and the hybrid and FCLK rows are answers rather than hopes. The September "~100 % each with disjoint
array halves" claim is not verified here and is not repeated.
What leaves with it. #656 (disjoint-array-half kernel sets) stays open as its own issue — it is the
throughput half the two-stream mechanism deliberately did not promise, and its acceptance (aggregate > 1.0× with
identical greedy output) is unchanged. The withdrawn 8-stream row stays withdrawn:
#670's re-measurement is therecord, and the decay it found (per-slot
tgfalling as an answer grows, recovering when the batch restarts) isworth remembering next time a batch number looks too good on this box.
No numbers from this epic were published as a benchmark claim; the table lives in the issue and in
tools/.