Repository navigation
Description
What happens
1bit serve -m <model dir> --device npu cannot start a model-generic Q4NX container, i.e. a directory with
model.q4nx + config.json + tokenizer.json + plan.json, even when the NPU kernels for that geometry are on disk. Measured on
the shipped c25 payload binary (~/wt/payload-c25/lemonade-onebit-rc-2026-11-05-c25/1bit/1bit, sha f373dc80…), one npu-hold
ticket per directory:
| directory | result |
|---|---|
~/models/npu/ZR1-1.5B-npu-q4km-q8 (published as 1bit-MONSTER/ZR1-1.5B-GGUF/npu-container-q8, 339 tensors, plan.json, 8 full ELFs built for its geometry) |
refused: 1bit serve: … is not an NPU model directory (the fast lane needs npu/), nothing ever served |
~/models/npu/Qwen3-0.6B |
accepted — 1bit unified: on the private route dx: dense Qwen3 on the dx kernels, one design per layer (…/npu/kernels/1024x3072x16x8), ready in 641 ms |
~/models/npu/bonsai2-27b-NPU |
refused, same message |
The same engine runs the refused container correctly through the per-op forward — `1bit forward-serve -m model.q4nx --kernels
` gives 4/5 byte-identical prompts against llama.cpp on the container's own weights (this lane's route row on merged main) — so the runtime is there; only `serve`'s dispatch cannot reach it. `plan.json`/`full_i8_*` ELFs are exactly what `tools/npu_plan.py` and the ELF path produce, so this is the shape any converter+paker of ours emits.Why, in the code
app/unified.cpp (npu_model_problem(), npu_model_kind()) accepts exactly two shapes:
- a private route —
npu/private_route.cpp'sknown()listsqwen3_5_moe("Qwen3.6-35B-A3B"), and a build-time addon can
register more (dx, which is why Qwen3-0.6B is accepted above); - the fast lane —
npu/lane.cpp:69-76reads a fixed kernel set (layer_ctx1.elf,layer_ctx2.elf,layer_ctx17.elf,
lmhead.elf,layer.pdi) and only servesqwen2/qwen3on those shape-specific kernels.
A model-generic container satisfies neither, so it is refused before the device is even opened. The GGUF branch of serve
(serve -m <gguf> --device npu) is the only path that ends in run_forward_serve, and a directory has no way to say "this is that
kind of model".
Consequence for the product path: Lemonade's onebit npu backend drives serve -m <dir>, so every model-generic container we
publish — ZR1-1.5B's (this lane's, 16 files) and bonsai2-27b-NPU — is invisible to it, while the hand-built fast-lane and
private-route models are not. That is also why an NPU scoreboard row for such a model reads "N/A": not the hardware, the dispatch.
Fix options
- A third kind in
npu_model_kind(). If the directory hasmodel.q4nx+config.json+tokenizer.jsonand NPU kernels
resolve (from<dir>/npu,ONEBIT_NPU_KERNELS, or a per-request option), run the in-process per-op forward — i.e. exactly what
the GGUF branch already runs after its repack. Purely additive: nothing that starts today changes behaviour, and it reuses the
path that npu: a GGUF repacked by the GGUF-on-NPU path is a container the per-op forward cannot consume (every request: 'forward step failed: dequant failed') #1097 just fixed for off-gridintermediate_size. - Require lane kernels in the container (the status quo for FastFlowLM packs). Not general: the lane kernels are
shape-specific per model family, so a converted model of another geometry can never satisfy them. - Docs-only: say in
docs/npu.mdthatserve -m <dir>is fast-lane/private-route only and that a model-generic container must
be served withforward-serve(or repacked from a GGUF), and accept that Lemonade'sonebit npubackend cannot serve them.
How to verify (no device needed to see the refusal)
cb=$(shopt -s nullglob; ls -d ~/models/npu/*/ | head -3); for d in $cb; do
~/wt/payload-c25/lemonade-onebit-rc-2026-11-05-c25/1bit/1bit serve -m "$d" --device npu -p 18190; done
Each is a fast refusal or a load, no ticket needed for the refusal path; a load wants npu-hold. Option 1's acceptance test is the
container above answering /v1/completions with token ids while served as a directory, with text matching the forward-serve
row that already exists.
Activity
bong-water-water-bong commentedon Nov 5, 2026
Acceptance criterion met, and it was met on a published container rather than a scratch dir:
~/models/npu/ZR1-1.5B-npu-q4km-q8(339 tensors, 28 layers, the eight full ELFs in~/models/npu/zr1-elfs), driver349FDC99, onenpu-holdticket per group, greedy 16 tokens on ids[151646,3639,5767,13228,321].55cfaf89: refused —is not an NPU model directory (the fast lane needs npu/); and it is refused the same way when the dir carries annpu/of the ELFs, sonpu/alone never helped and the dispatch really was the whole gap.8c53876: accepted,Model loaded: 339 tensors, 28 layers,ready (full ELF)in 2 s (ONEBIT_NPU_KERNELS) / 1 s (<dir>/npu, no env),/v1/completions200 in both arms.serve -m <dir>andforward-serve -m model.q4nx --kernels …returned byte-identical text (same 23 s for 16 tokens), in the same ticket. Full table and the two doc consequences are on the PR (comment 6665961608).For the NPU column that reads N/A for such a model (pi-supreme's board): the cell becomes servable once #1133 is in, and it needs nothing from the model repo — kernels resolve from
<container dir>/npuwith no env var. That is why this lane's publish target changed fromnpu-container-q8/kernels/tonpu-container-q8/npu/(~/models/npu/zr1-elfs/PUBLISH-READY.md; nothing uploaded, still the owner's word).