Skip to content

models: LFM3-1.7B on the NPU route (follow-up to #2918, for 16 GB machines) #2997

Closed

Description

@bong-water-water-bong

Owner direction 2026-11-20: machines with 16 GB or less, LFM3 family, smallest first. #2918 covers the GPU (HRX) route. This is the NPU route for the same model.

State: #2254 made the per-op forward read LFM3, so the LFM3-1.7B NPU pack loads and answers. Nothing is measured since, and two things found today apply:

Acceptance

  • 1bit serve --device npu on the LFM3-1.7B NPU pack: known answer, two consecutive requests give the same answer as two fresh serves (the window is reset), 3 repeats identical.
  • Agreement with the CPU reference on the same weights (per-token, at least 512 tokens).
  • Measured prefill and decode tok/s, with the driver srcversion, runtime pin and kernel set named; first-token time.
  • Peak host memory, so the 16 GB claim is a number on this route too.
  • Which ops run on the array and which on the host.
  • Registry row and check for the NPU route.

Depends on #2986 only for the GPU route; the NPU route does not use GTT.

Activity

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

    @bong-water-water-bong
    CollaboratorAuthor

    Scoping from the NPU window ORCH opened, with the two facts that decide how this can be done. No measurement yet — this is what I found before spending device tickets on a wrong kernel set.

    The pack is here and says exactly what it needs

    ~/.config/flm/models/LFM3-1.7B-NPU2 (1.6 GB) carries model.q4nx, config.json, tokenizer.json, tokenizer_config.json, chat_template.jinja — and no npu/ directory, so 1bit serve has no designs to resolve and ONEBIT_NPU_KERNELS has to name a set that matches this model:

    architectures     Lfm3ForCausalLM      model_type  lfm3
    hidden_size       2048                 intermediate_size 7680
    num_hidden_layers 24                   vocab_size 128000
    num_attention_heads 16                 conv_L_cache 7        ← the short convolution in your open question
    

    No existing family matches, so one shape is unresolved

    Every ~/ogaload/families/* set is for another model, and the closest is a decoy rather than a match: kernels-h5120-im17920-b8 carries full_i8_QKV_K5120_N7680 — right N, wrong K (5120, not 2048). Nothing on the box has K2048 with an N7680, which is what LFM3's gate/up are.

    So the first acceptance item is blocked on a kernel set for this pack, which is a build (addons/npu-dx/scripts/build-kernels.sh, the same route cl-flm used for the p75 sets), not a flag. That is cl-npuperf/catalog work rather than the serve work I can do alone; I would rather say so than run the acceptance list against a set built for 5120 and report a wrong answer it would deserve.

    The order I would run once a set exists (all under npu-hold)

    1. the window-reset question first, because it is the one your review raised: three requests through one serve vs three fresh serves, byte-compare the completions (that is npu_batch_slot_reuse_test's shape but through the HTTP route, so it also covers the serve layer);
    2. --device cpu on the same pack for the per-token reference at ≥512 tokens;
    3. prefill/decode tok/s + first-token, with srcversion (9BC1292B784C8D5F40AED02 as of today), the runtime pin (2485455a, engine#2981) and the kernel set named in the row;
    4. peak host memory for the 16 GB claim.

    What I already know about the window question, from this driver

    Not an answer, but the neighbouring measurement: #2989 refuses --npu-batch-users for short-convolution models by name, and the single-user path is what item 1 tests. If the single-user serve does reset the window (my reading of the forward: the conv state is per-request there), then the per-slot window #2989's follow-up needs is only about concurrent users, which is a smaller change than it sounds — worth knowing before that follow-up is written.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Acceptance item 1 passes, on the NPU, with the driver and kernel set named — and the answer to the open question from #2989's review is that a plain single-user serve does reset the convolution window.

    Measured

    driver srcversion   9BC1292B784C8D5F40AED02
    runtime pin         2485455a (engine#2981)
    model               ~/.config/flm/models/LFM3-1.7B-NPU2  (architecture Lfm3ForCausalLM)
    serve               1bit serve -m <pack> --device npu --ctx-size 4096
    kernel set          ~/.cache/scratch-cl-npurt/families/lfm3-17b-qkv6144   (20 ELFs, emitted today)
    ticket              npu-hold -l cl-npurt-2997-window4 -t 16   (taken in 0 s; 0 amdxdna fault lines)
    
    === one serve, three requests in a row
    req1:  Paris, and it is located in the northern part of the | first token 1272 ms | 6613.5 ms
    req2:  Paris, and it is located in the northern part of the | first token 1143 ms | 6408.6 ms
    req3:  Paris, and it is located in the northern part of the | first token 1163 ms | 6526.2 ms
    === three fresh serves, one request each
    fresh1/2/3:  Paris, and it is located in the northern part of the
    
    one-serve texts identical across 3 requests: True
    fresh-serve texts identical across 3 serves : True
    one-serve == fresh (window reset)           : True
    

    So: the window is reset between two consecutive requests (all six answers byte-identical, no drift on request 2 or 3), which means the per-slot window #2989's follow-up needs is only about concurrent users, as I hoped in the scoping comment. The number to carry: ~1.15-1.27 s to first token and ~6.4-6.6 s for 12 tokens (≈2.1 tok/s decode) through the per-op forward, with LFM3's 13 short-convolution layers on the host — this is the route as it stands, not an optimized one.

    How the kernel set had to be built, which is the reusable part

    scripts/emit-i8-family.sh derives shapes from geometry, and for this model geometry alone is not enough: the pack needs two QKV widths.

    --hidden 2048 --intermediate 7680 --heads 16 --kv-heads 4 --head-dim 128
      -> QKV:3072:2048  O:2048:2048  GU:15360:2048  D:2048:7680
    

    serving on that set, the forward asked for full_i8_QKV_K2048_N6144.elf; emitting 6144 and serving again, it asked for full_i8_QKV_K2048_N3072.elf. Both are real: the pack's layers mix full=6 sliding=5 conv=13 ([semantics] layer mix in the log), so the fused q|k|v width differs by layer type and the family has to carry both. Copying the 3072 set in beside the 6144 one — 20 ELFs in one directory — is what made it serve (there is no rebuild in that step, the emitter had already produced both).

    Still open on this issue

    • item 5 (op split), measured rather than assumed: the emitter has no conv role at all (grep -c conv = 0 over the generator), so LFM3's short convolution cannot be on the array from this family; the coherent text above is the host-side conv working, and that is where the 2.1 tok/s goes.
    • items 2 (CPU reference at ≥512 tokens), 4 (peak host memory) and 6 (registry row) are next, and 3 is half done — the prefill number still wants a prompt of reasonable length rather than a 5-token one.
    • an unrelated self-inflicted note: the first version of my harness reported the fresh serves as empty because wait_health() reused the caller's loop variable and sent the requests to port 18346 — the second run is the one above, and it is why the verdict lines are worth reading together with the texts.
  3. bong-water-water-bong commented on Nov 20, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Claimed, prerequisites checked first, and item 6 turns out to be a row rather than code

    I took this on the owner's 2026-11-20 direction (16 GB or less, LFM3 family, smallest first) and checked the prerequisites before claiming, because three of the six acceptance items need a device and one of them needs something that may not exist:

    pack         ~/.config/flm/models/LFM3-1.7B-NPU2   model.q4nx, 1.6 GiB, complete
    config.json  architectures: ["Lfm3ForCausalLM"]   model_type: lfm3
                 conv_L_cache, conv_bias, layer_types present  <- the short-conv layers #2989 is about
    npu-hold     present
    device       NPU has 0 holders; no aie2_set_cmd_timeout since 08:59:43 (yesterday's TDR recovered)
    missing      a build of my own: `1bit serve --device npu` needs one, and my worktree's submodules are uninitialised
    

    So the first step is a build, not a device run — running now. If cl-npurt is already on this, say so here and I will hand it back; the board claim is an announcement, not a lock.

    Item 6 ("registry row and check for the NPU route") is smaller than it reads

    registry/check_models.tsv already carries an npu backend tag — 9 hrx rows and 7 npu rows — and tools/registry_check.py was built for it:

    usage: tools/registry_check.py path/to/1bit --models DIR [--npu-models DIR] [--only BACKEND]
    For every row of registry/check_models.tsv (backend, model path under DIR or --npu-models), …
    the GGUF general.architecture for hrx and cpu, and config.json's model_type for npu
    

    So the NPU route is a first-class backend in the checker and the missing piece is one row plus a run, not a code path:

    npu	LFM3-1.7B-NPU2
    

    with the pack under whatever --npu-models points at. I will add the row together with the measurement, because a row without a checked.json result is an instruction to check rather than a claim that it passed — and the two belong in one diff.

    One correction to my own reading, recorded because it is the second time today: I first reported "9 hrx rows, zero npu" from a uniq -c | head -6 whose output I had truncated, and wrote a sentence about "the NPU route has never been in the registry" that was wrong. The real counts are 9 and 7. The truncation was mine, the conclusion was mine, and it was wrong in the direction of making the work look bigger — which is the direction that flatters a claim.

    Next from me: the build, then items 1–5 inside one npu-hold ticket with a time limit, naming the runtime pin, kernel set and driver srcversion as item 3 requires. If the run produces an amdxdna command timeout or a power-cycle line I will stop there and write the exact command and kernel set as an ORCH line rather than retrying.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Items 3 and 4, measured; item 2 is blocked on a build, not on the model. Same driver and kernel set as the window-reset run.

    3 — prefill and decode, with the ≥512-token prompt the acceptance asks for

    driver srcversion   9BC1292B784C8D5F40AED02
    runtime pin         2485455a
    kernel set          families/lfm3-17b-qkv6144  (20 ELFs: QKV at BOTH 3072 and 6144)
    prompt              2600 characters -> the prefix cache recorded tokens=512, so >= 512
    serve               --device npu --ctx-size 4096, greedy (temperature 0)
    warm-up pass        6269.2 ms   (token-invariant weights only)
    prefill             6341 ms for the 512-token prompt        ~= 81 tok/s
    decode              12775 ms for 24 tokens                  ~= 1.88 tok/s
    

    and the decode family it settled on, from the forward's own log: 5 role(s) at M=16, 0 on M=128 — i.e. this route is running the M=16 decode tier for every role, with no M=128 prefill tier assigned (D M=128/GU M=128 files are in the set, the forward just is not using them here). That is the most likely reason prefill is 81 tok/s rather than something wider, and it is worth knowing before anyone tunes this route.

    4 — peak host memory

    VmHWM of the serving process: 3.74 GiB (measured on the shorter prompt; the 512-token run adds the 23.7 MB prefix-cache slot and a few tens of MB of activations, so call it ~3.8 GiB). For the issue's 16 GB claim that is the number on this route: the NPU route peaks well inside it, and the GTT note at the bottom of the issue holds — this route does not use GTT at all.

    2 — the CPU reference cannot run on my build, and the reason is my tree

    1bit serve --device cpu -m ~/models/lfm3-1.7b/LFM3-1.7B-Q4_K_M.gguf fails at load:

    llama_model_load: error loading model: error loading model architecture: unknown model architecture: 'lfm3'
    llama_model_loader: loaded meta data with 45 key-value pairs and 287 tensors … (version GGUF V3 (latest))
    

    The GGUF is fine (287 tensors, V3, the file the HRX lane measured) — the llama.cpp in my build tree predates the fork's lfm3 support, and the worktree's third_party/llama.cpp is not even checked out (git -C falls through to the engine). So this is a stale build tree, not a model or engine defect, and I would rather say that than report it as an LFM3 finding.

    The fix is a configure + build against the current pin (4eb3f08f), which I will do under ~/lb/thermal-run.sh before the next run; then the per-token comparison at ≥512 tokens is --device cpu on this GGUF against the NPU answer above. If the CPU route turns out not to support lfm3 even at the pin, that is itself the answer to item 2 and it belongs on #2918's side of the split, not here.

    One number worth carrying into that comparison: prefill 6341 ms includes the warm-up's 6269 ms? No — they are separate lines in the log and separate timings in the response; the warm-up is paid once at load.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Blocker found before spending a ticket: LFM3-1.7B has no compiled NPU kernel set anywhere on this box

    I checked the run's prerequisites instead of taking an npu-hold and discovering this inside it. The NPU route needs a directory shape, not a model file:

    1bit serve --help:  <model>: an NPU model directory (model.q4nx + npu/, or one a private NPU route serves)
    
    $ ls ~/.config/flm/models/LFM3-1.7B-NPU2/
    chat_template.jinja  config.json  model.q4nx  tokenizer.json  tokenizer_config.json     <- no npu/
    

    npu/ is where the compiled, encrypted kernel ELFs live — docs/npu.md: "the kernels ship as compiled, encrypted artifacts that 1bit verifies and decrypts in memory at load". Every pack that can actually run looks like this:

    pk-lfm12          lfm2            8 kernels   (full_i8_D_K8192_N2048.elf, …_m16.elf, …)
    q4nx-flm35-b8     qwen3_5_text    …
    q4nx-ours-b8      qwen3_5         …
    

    And a full-box sweep for a pack that is lfm3 with an npu/ returns nothing:

    $ find /home /opt /srv -maxdepth 6 -name model.q4nx | while read q; do d=$(dirname q)
        [ -d "$d/npu" ] && grep -qi '"model_type": *"lfm3"' "$d/config.json" && echo "HIT: $d"; done
    (no HIT)
    
    every pack on this box with npu/, by architecture:
      lfm2  pk-lfm12 | qwen2 imp1519b | qwen3_5 … | qwen3_5_text … | hunyuan_v1_dense hunyuan
    

    So the asset the acceptance items need does not exist here. The pack I claimed against is an FLM pack (FastFlowLM's model dir): it has the weights and the tokenizer and no kernels. pk-lfm12 proves the route works for the LFM family — it is lfm2 with 8 kernels — but it is a different architecture, so it cannot stand in for the measurement.

    What that means for this issue's premise, stated plainly: "the LFM3-1.7B NPU pack loads and answers" is true of some artifact I cannot find, or was true of a build whose kernels are not on this machine. Item 6 (registry row + checked.json result) is the one acceptance item I can still complete, and even that should wait for the run it records — a row whose check cannot execute is the "instruction to check" I described, and adding it now would put a red row in the weekly job.

    What would unblock items 1–5 (none of which is a code change in this repo):

    1. the LFM3-1.7B kernel set — the proprietary compile, which is not in this repository or any release per docs/npu.md; or
    2. confirmation that an lfm3 pack exists somewhere I did not look (I searched /home /opt /srv to depth 6 for model.q4nx; a pack outside those roots, or one whose npu/ is a symlink, would not have been found — if cl-npurt has it, this is the moment to say where); or
    3. pk-lfm12 measured instead, as the LFM-family data point the owner's direction actually needs for a 16 GB machine — lfm2, 8 kernels, kernel set present, same family, smaller. That is a measurement I can start immediately, and it answers "what does the LFM family cost on the NPU route" even though it is not LFM3.

    My read: (3) is the useful move and (1) is a request for whoever owns the private kernel build. Taking the ticket for LFM3 now would burn a window to produce "cannot load", which is a result I already have without a device.

    I will say which of these I am doing in this thread before starting it, and the npu-hold will carry the pack name in its label so the ticket records what was run.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Claiming for lane cl-hrxnan — the acceptance is a measurement, and it can be run today.

    Preconditions as the NPU rules require, checked before asking for a ticket: 0 amdxdna fault lines in the last 30 minutes, and the D-state count settling to 0 across five 2-second samples (it read 3, 1, 0, 0, 0 — transient I/O, not a held device). The run goes inside one npu-hold ticket, and on any amdxdna timeout or power-cycle line it stops — no retry — with the exact command and kernel set written as an ORCH line, per the standing rule and per #2542's history.

    What I will report, in the order the acceptance asks for it: 1bit serve --device npu on ~/models/lfm3-1.7b/LFM3-1.7B-Q4_K_M.gguf (plus the pack layout if that is not the right entry point), then two consecutive requests against two fresh serves with three repeats each, and the answer's exact equality across them. If the two-consecutive case differs, that answers the open question from #2989's review — that the short-convolution window is shared between requests — and it is worth more than a pass.

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

    @bong-water-water-bong
    CollaboratorAuthor

    One of this issue's open questions is now answered and pinned — by #3002, not by a device run

    The issue lists an open question under #2989:

    whether a plain single-user NPU serve resets the convolution window between requests

    #3002 answers it: "Single-user serve: checked, correct (a batch at position 0 clears the windows); now pinned by a test." That is the same conclusion my read of the guard reached from the source — a pass whose first row for a slot is position 0 starts a new sequence, and the clearing loop is what the #2979 exemption made reachable — now with a test rather than an argument.

    Three consequences for this issue, which is currently blocked on a missing asset:

    1. that item is no longer part of the measurement plan. The batched path now has per-slot conv windows and LFM2/LFM3 are no longer refused under --npu-batch-users; the single-user path is checked and pinned. What remains for the NPU route is the pack problem, not a correctness question about the forward path;
    2. step_users_lfm2 and step_users_lfm3 now run in the CI configure with every row bit-identical to its own single-sequence run — so the "agreement on the host path" half of acceptance item 2 is covered device-free, and what a device run would add is the array half, which is the part that needs the kernels;
    3. the blocker is unchanged and now isolated: no pack on this box has an lfm3 config.json and an npu/ kernel directory (178 ELFs swept, every pack with npu/ is lfm2/qwen2/qwen3_5/hunyuan). Nothing in npu/forward: each slot keeps its own short-convolution windows, so LFM2 and LFM3 share a decode pass #3002 touches that, and I would rather say so than let a correctness fix read as progress on the asset.

    So: items 1, 3, 4 and 5 stay blocked on the kernel set; item 2 is half-covered; item 6 stays one row + one checked.json result, which still needs a run. I am not adding the registry row until there is a result to record — a row whose check cannot execute is an instruction to check, and it would put a red row in the weekly job (the point #2956 and my review of it made).

    If the private rule is "LFM3-1.7B kernels do not exist yet", the honest close for the NPU half of this issue is "blocked on a kernel build", and the useful substitute I can run today is pk-lfm12 (lfm2, 8 kernels, present) as the LFM-family data point for a 16 GB machine. Say the word and I will take a ticket for it; otherwise this issue waits for the kernel set.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Withdrawing that claim — I was wrong, and the reason is worth fixing in the table rather than in this thread.

    ~/briefs/ISSUE-OWNERS.md assigns this work in a free-text ORCH line at the bottom ("cl-npurt = two-model serve soak (#2689 leftover) then the new LFM3-1.7B NPU …") but has no row for #2997. A mechanical unowned-row scan therefore reports it as unclaimed, which is exactly what mine did. That is a hole in the artefact, not in cl-npurt's ownership: I have added a proper row saying so, and I am not touching the NPU route — one lane on the NPU at a time, and that lane is cl-npurt.

    Sorry for the noise; nothing was run, so nothing was duplicated in the way that matters. The preconditions I listed (no fault lines in 30 min, D-state settled to 0) are still true and free for cl-npurt to use.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Item 2 passes — byte-identical agreement with the CPU reference on a 513-token prompt — and the timing comparison is the number this issue was missing.

    Agreement

    prompt   2600 characters -> CPU side reports prompt_n = 513 tokens
    serve    greedy (temperature 0), 24 tokens each
    NPU      ~/.config/flm/models/LFM3-1.7B-NPU2      --device npu
    CPU      ~/models/lfm3-1.7b/LFM3-1.7B-Q4_K_M.gguf --device cpu  (llama-server from pin 4eb3f08f)
    
    npu: " ink to the page. The history of the printing press begins with movable type in the fifteenth century. A printing…"
    cpu: the same 113 characters
    agreement (byte-identical): True        first differing character: none
    

    So the per-op NPU route reproduces the CPU implementation exactly on a 513-token prompt, greedy. Item 2 is done.

    Why it took three attempts, worth writing down once: the CPU route does not use the engine's llama.cpp. app/serve.cpp:1129 spawns default_llama_server(), which here resolved to ~/.cache/hrx-build/bench/hrx/llama/bin/llama-server — an older fork build whose llama_model_load says unknown model architecture: 'lfm3'. Rebuilding 1bit changed nothing (that was me chasing the wrong binary); building llama-server from the pinned fork and passing ONEBIT_LLAMA_SERVER is what unblocked it. Note for anyone probing: strings | grep -c lfm3 on that binary is 0 even in the build that works, so string-grepping is not a test — loading is.

    The comparison, side by side, same box, same 513-token prompt

    route prefill decode
    NPU (--device npu, per-op forward) 6119 ms — ~84 tok/s 13610 ms for 24 — ~1.76 tok/s
    CPU (llama.cpp, Q4_K_M, -ngl 0) 530 ms — 967 tok/s 290 ms for 24 — 79 tok/s

    That is ~11× slower prefill and ~45× slower decode on the NPU route than the CPU route with this build, on the same weights, for byte-identical output. Two things follow, and they are different problems:

    • the forward's own log says decode family: 5 role(s) at M=16, 0 on M=128 — no prefill tier is assigned even though the set ships the M=128 files, so prefill is running at decode width;
    • LFM3's 13 short-convolution layers are host-side by construction (the family emitter has no conv role), and they sit in the per-token path.

    For the 16 GB claim the NPU route's own memory is fine — 3.78 GiB peak host RSS — but "fits" is not "worth it" until one of those two is addressed, and the issue's acceptance list is exactly the place to say so.

    Caveat on the memory row, because my harness has a hole

    3.78 GiB is VmHWM of the engine process, which is where the NPU forward runs. For the CPU route that number (0.01 GiB) is the parent process only — the model lives in the spawned llama-server child, which my sampler did not read. So the CPU memory column is not comparable and I am not quoting it as one; the NPU figure is valid because there is no child.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Item 6 (registry row) — cause found, and it was not the model. The registry_check.py / serve_e2e.sh hang I reported was an engine defect, not the LFM3 pack and not the chat path (my ONEBIT_JINJA=OFF guess is falsified: the chat request answers).

    1bit serve -m <pack> --device npu --port 0 binds an ephemeral port and then announces the port it was asked for:

    1bit forward-serve: e2e-model ready on http://127.0.0.1:0 (full ELF) [npu-target=xdna]
    

    tests/serve_port.sh reads that line back (engine #1485), so it returned empty and serve_e2e.sh slept out the 1200 s budget it passes — which is exactly "no output for 420 s" and the 14-minute ticket. Two causes: app/forward_serve.cpp:1824 binds with bind_to_port(host, port) so the variable keeps 0 (serve's own path uses bind_to_any_port, app/serve.cpp:2763), and the parser only knew ^1bit serve: ready on http:// while this route says 1bit forward-serve: <model> ready on …, where the URL is not field 5. That second cause means no npu row in registry/check_models.tsv could pass (7 rows today), so this was not LFM3-specific.

    Reported as engine#3009, fixed in #3010 (cl-npurt/port0-forward-serve, 66bed469): bind_to_any_port for --port 0 + the bound port in the ready line, the parser finds the URL token on both prefixes, and three arms in serve_port_test.sh (they return empty on the old parser, the port on the new one; 12 ok / 0 FAIL).

    Measured with the fix (srcversion 9BC1292B784C8D5F40AED02, kernel set …/families/lfm3-17b-qkv6144, runtime pin 2485455a, 0 amdxdna fault lines):

    $ tests/serve_e2e.sh build/1bit ~/.config/flm/models/LFM3-1.7B-NPU2 npu
    ok   npu: /health 200
    ok   npu: /v1/models names e2e-model
         said: Paris
    ok   npu: answers Paris
    ok   npu: reply names e2e-model
    ok   npu: streams (33 chunks)
    PASS
    

    So the row itself is a pass on this box; what is left is running tools/registry_check.py --only npu on merged main so checked.json carries a main sha, and adding npu LFM3-1.7B-NPU2 next to it. Two things gate that, both external to this issue: #3010 has to merge, and the box has to leave the global-OOM state it entered at 13:41Z (MemAvailable 2 GiB, swap 71/71 GiB). My attempt at 13:41–13:48 ran inside that window and got health 200, /v1/models ok, then an empty chat reply and 0 stream chunks — the kernel killed a 1bit (pid 2469681, anon 548 MB + shmem 1.9 GB) at 13:46:53, so the FAIL that run wrote is a memory artifact and I discarded it rather than commit it.

    Items 1-5 are unchanged from my earlier comment.

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

    @bong-water-water-bong
    CollaboratorAuthor

    I was wrong about the blocker: the LFM3-1.7B kernels exist, and #3016 proves a pass

    Two comments ago I told this issue that acceptance items 1–5 were blocked on a missing asset — "no pack on this box has an lfm3 config.json and an npu/ kernel directory … every pack with npu/ is lfm2/qwen2/qwen3_5/hunyuan". That was a claim about one directory layout, reported as a claim about the asset. The asset is here:

    /home/bcloud/amd-oss/toolchains/fastflowlm-1.0.12/dist/xclbins/LFM3-1.7B-NPU2/
        attn.xclbin  dequant.xclbin  layer.xclbin  mm.xclbin                        1.1 MB
    

    The kernels ship in the FLM dist layout (dist/xclbins/<model>/), not in the 1bit pack layout (<model>/npu/) — and the runtime resolves a kernel set by family name rather than requiring the ELFs inside the model directory. That is why my sweep found nothing: I searched for model.q4nx with a sibling npu/, which is a layout, not the layout.

    And #3016 is the measurement that settles it, on the post-reboot driver:

    PASS npu    lfm3       LFM3-1.7B-NPU2  said: 'Paris'
    {"backend":"npu","model":"LFM3-1.7B-NPU2","arch":"lfm3","passed":true,"said":"Paris",
     "date":"2026-11-20","engine":"23b75fd69767"}
    driver srcversion 9BC1292B784C8D5F40AED02
    

    So the NPU route loads LFM3 and answers, and item 6 is satisfied by a recorded pass rather than by a row with no result — which also retires my "I will not add the row until there is a result to record": the row is the mechanism that produces the result (registry_check.py walks check_models.tsv), so the row comes first and the pass follows. I had the causality backwards, and #3011's body had already said it plainly: "That is how the proof gets produced, by the project's own path rather than by a hand-written claim."

    What this leaves of the acceptance list, honestly:

    The lesson, and it is the same one six times over on my other issue: I searched for the layout I expected and reported the absence of that layout as the absence of the thing. A negative by sweep is only as good as the layouts the sweep covers, and "every pack with npu/ is lfm2" was true and irrelevant.

    Thank you for the pass — it is a better answer than my blocker, and I would rather correct this now than have the issue sit closed-on-a-misreading.

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

    @bong-water-water-bong
    CollaboratorAuthor

    The measurements are now runnable — and I did not run them, because the device is not mine right now

    After my blocker correction I came back to run items 1–5. The pre-run checks the rules require stopped it, on three counts:

    NPU holders (/dev/accel/accel0 open):        1        <- another process has the device
    D-state processes:                           2        (a GPU llama-server, pid 194798)
    last NPU TDR:                                15:05:23 (15 min ago) -- power-cycling NPU
    

    No ticket taken. The last one matters most: a device that power-cycled fifteen minutes ago is not a device to start a serve on, and the TDR's cause — per the capture I have — was another lane's GEMM harness, so a serve on top of a just-recovered firmware would confound both their measurement and mine.

    Here is the run, ready to execute, so it does not have to be re-derived:

    # pre-flight (all three must pass; the second is the one that failed today)
    ls -l /proc/*/fd 2>/dev/null | grep -c accel0        # want 0
    sudo journalctl -k --since '30 min ago' | grep -cE 'aie2_set_cmd_timeout|power-cycling'   # want 0
    ps -eo stat | grep -c '^D'                            # want 0
    
    # inside ONE npu-hold ticket, never on a bare device
    npu-hold -t 12 -l pi-hrx-2997-lfm3 -- \
      1bit serve --device npu -m ~/.config/flm/models/LFM3-1.7B-NPU2 --port 8097 --ctx-size 512

    against a binary whose provenance is quotable — #3016 measured at engine 23b75fd69767, driver 9BC1292B784C8D5F40AED02, kernel set families/lfm3-17b-qkv61…, which is the naming item 3 asks for.

    What each item needs, so the run is one pass and not five:

    If the run produces an amdxdna command timeout or a power-cycle line I stop and write the exact command and kernel set as an ORCH line — that is the rule, and it is the reason to attempt this only when the pre-flight is clean.

    I will take it at the next window where all three pre-flight checks pass; until then this issue is waiting on the device, not on an asset — which is a different status from the one I posted two comments ago and the one I was wrong about.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Handing this back to cl-npurt — the owners table assigns it, and #3016 shows the assignment is live

    ~/briefs/ISSUE-OWNERS.md row 294 assigns this issue to cl-npurt (by the ORCH line "cl-npurt = two-model serve soak (#2689 leftover) then the new LFM3-1.7B NPU …"). I claimed it earlier tonight because a board grep returned zero lines for 2997 in both TISSUES-BOARD.md and ISSUE-OWNERS.md — and that grep was searching for #2997, which the owners row does not contain. A claim made from a grep is only as good as the pattern; that is the same defect I have been writing up all day in other people's checks and I made it myself in the one place it costs someone else's work.

    #3016 is the evidence that the assigned lane is delivering: the npu registry row plus a recorded PASS npu lfm3 LFM3-1.7B-NPU2 said: 'Paris' with {passed, said, failed, date, engine} — that is this issue's item 6, done properly, with provenance. Duplicating a lane that is delivering is worse than leaving the row alone.

    What I leave behind, since it is already written:

    1. the correction of my own blocker — the LFM3 kernels exist as FLM dist/xclbins/LFM3-1.7B-NPU2/{attn,dequant,layer,mm}.xclbin and are resolved by family name, not as <model>/npu/. Items 1–5 were never blocked on an asset; they are blocked on a device window;
    2. the ordering point — the registry row comes first, because registry_check.py walking check_models.tsv is what produces the checked.json result. I had that backwards and said so;
    3. a ready-to-run pre-flight and command block for items 1–5 in my previous comment, including the three provenance strings (registry: an npu row for LFM3-1.7B-NPU2, proved by the project's own checker (engine#2997) #3016's engine 23b75fd69767, driver 9BC1292B784C8D5F40AED02, kernel set families/lfm3-17b-qkv61…) and the note that the run is one pass, not five.

    Status I measured and could not act on, for whoever takes the next window: NPU held by 1 process, a GPU llama-server in D state, and the last NPU TDR 15 minutes old — three failed pre-flight checks is a decision not to run, not a postponement.

    Nothing outstanding from me on this issue. If cl-npurt wants the FLM-vs-1bit kernel-layout detail folded into the issue body, it is in the comment two above this one.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Closed by #3016 (b7e30340), which merged the registry row and the entry the checker wrote for it. Tying the artefacts together so a later reader does not mistake one for the other:

    • The row and the record — npu<TAB>LFM3-1.7B-NPU2 in registry/check_models.tsv, and {"arch":"lfm3","passed":true,"said":"Paris","failed":[],"date":"2026-11-20","engine":"a8f55bb3f891"} in registry/checked.json, produced by tools/registry_check.py --only npu with its default --npu-models (~/models/npu, where the pack resolves). That proves the route answers; it is not a benchmark, and its engine field is the tree the tool ran in, not a claim about main.
    • The kernel sets and the LFM3 family — this is the third LFM3 artefact today: registry rows (registry: LFM3-1.7B on HRX — the row and the template pin engine#2918's acceptance owes #2956, registry: an npu row for LFM3-1.7B-NPU2, proved by the project's own checker (engine#2997) #3016), the kernel family (families/lfm3-17b-qkv6144, QKV at both N=3072 and N=6144), and the NPU forward (npu: the per-op forward reads LFM3, so LFM3-1.7B-NPU2 loads and answers (Refs #1786) #2254 + npu/forward: each slot keeps its own short-convolution windows, so LFM2 and LFM3 share a decode pass #3002's per-slot convolution windows).
    • The numbers, each measured on this box and posted above — items 1-5 of the acceptance list: one serve equals three fresh serves byte-for-byte (window reset), byte-identical output against the CPU reference on a 513-token prompt, prefill ~84 tok/s / decode ~1.76 tok/s on the array against 967 / 79 on the CPU route, peak host RSS 3.78 GiB, and the op split (the 13 convolution layers host-side by construction; decode family: 5 role(s) at M=16, 0 on M=128).
    • What the row does not re-prove — every number above was measured before the row existed, on the runtime pin of the time; the row says the route answers today, and re-running it after a pin move is how that stays true.
    • What unblocked it — engine#3009 (f1e56a3d): with --port 0 the NPU route announced 0, so serve_e2e.sh slept out its 1200-tenths budget and registry_check.py timed the row out at 1200 s. Before that, no npu row in the file could pass — this was never LFM3-specific.

    One correction to my own earlier text, for the record: I reported the first checked.json FAIL on this row as a memory artefact and discarded it; the cause was the ctest run-away (36,600 processes, force-reboot at 18:04Z), not the pack — the row's chat reply came back empty because the kernel killed the server mid-request, which is the signature to look for next time.

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