OpenFlowLM-Next icon indicating copy to clipboard operation
OpenFlowLM-Next copied to clipboard

fix issues and bugs found by ArtLite eval

Open Cyronius opened this issue 1 month ago • 11 comments

github gist from user infocat on AMD discord. He's authored artlite, and has some great info and ideas we can use. https://github.com/artlite-project/artlite

The first task is to redo all of these comparisons. I thought we were exceeding flm numbers basically everywhere, but his results don't paint such a rosy picture. I'm not sure the version of OFLM used, either.


OpenFlowLM survey (2026-10-17)

OpenFlowLM (OFLM) is a FastFlowLM fork that replaces FLM's closed NPU kernels with open IRON / mlir-aie ones. This report gives OFLM's TTFT, prefill and decode speed, and memory at 1k, 2k, 4k, ... context on its open kernels, measured exactly as the FLM survey (../flm-survey/report.md) measured FLM, for the models that both OFLM's open engine and Artlite run. The plan and every fact about OFLM's code are in task.md, the harness is oflm_bench.py, the tables are generated by report.py, and the raw data is in results/<tag>/.

Setup

  • Machine: Ryzen AI MAX+ 395 (Strix Halo, NPU2), 121 GB RAM, AC power, platform profile performance. NPU power mode turbo, runtime PM on. Kernel 7.2.9, XRT 2.27.0, NPU firmware 1.1.2.65.
  • OFLM: Atomic-Germ/OpenFlowLM-Next at 99fe7e4 (2026-10-16), the build tree's build/src/oflm (Release, engine-only, version 0.1.0), run through oflm serve.
    • Kernel sets: src/xclbins/<model>/open_kernels, built with mlir-aie 1.4.2 and Peano 21.0.0.2026080301 from the same commit.
    • Every model is forced onto the open engine (OFLM_{LLAMA,QWEN3,QWEN35,QWEN36}_ENGINE=open). Each server log confirms it with <family> on the open kernels (<dir>).
    • Environment: OFLM_DISABLE_UPDATE_CHECK=1 and OMP_WAIT_POLICY=PASSIVE.
  • Models: the catalog's containers from oflm pull (Atomic-Germ/<name>-NPU2).
    • The dense ones and Qwen3.5-9B are FastFlowLM's files byte for byte.
    • Qwen3.8-27B is OFLM's own container.
    • Qwen3.6-35B-A3B was skipped for lack of disk space (user decision).
  • Requests, prompts, metrics, repetitions and stop rules: as in the FLM survey.
    • Streaming /v1/chat/completions, 128 greedy tokens, thinking off.
    • Paul Graham essay prompts of exactly N templated tokens, each with a nonce and a needle.
    • TTFT is measured to the first streamed token; prefill tok/s = N / TTFT; decode tok/s = (tokens − 1) / time from the first to the last token.
    • Up to 3 repetitions, median shown. A size is skipped when its run is predicted to take more than 5 minutes.
  • Context: each model runs at its native maximum, halved while the bf16 KV upper bound doesn't fit. Only the 27B needed that, and runs at 131072.

Findings

Speed

OFLM next to FLM (the FLM survey; same container unless noted) and Artlite (docs/data/artlite.json, the quant the charts pair with q4nx):

model TTFT 1k, s: OFLM / FLM / Artlite TTFT 4k, s: OFLM / FLM prefill tok/s 1k: OFLM / FLM / Artlite decode tok/s 1k: OFLM / FLM / Artlite decode tok/s 4k: OFLM / FLM largest N in 5 min: OFLM / FLM
qwen3:0.6b 2.33 / 0.88 / - 11.9 / 2.21 439 / 1166 / - 32.9 / 70.9 / - 13.1 / 46.0 8k / 32k
llama3.2:1b 7.16 / 0.70 / 0.11 (Q4_1) 80.8 / 1.87 143 / 1456 / 9344 36.0 / 57.1 / 64.7 19.4 / 50.1 4k / 64k
llama3.2:3b 15.3 / 1.62 / 0.30 (Q4_K_M) 176 / 5.52 67 / 631 / 3430 16.3 / 23.2 / 26.6 9.0 / 19.9 4k / 64k
llama3.1:8b 23.3 / 2.76 / 0.65 (Q4_K_M) 243 / 8.30 44 / 371 / 1579 8.50 / 10.8 / 11.9 5.35 / 9.91 4k / 32k
qwen3.5:9b 7.83 / - / - 29.6 / - 131 / - / - 7.00 / - / - 5.99 / - 16k / -
qwen3.8:27b 26.1 / 9.08 / 2.50 (Q4_K_M) 99.0 / 34.2 39 / 113 / 410 2.49 / 1.89 / 3.3 2.25 / 1.48 4k / 8k

The FLM figures for llama3.1:8b come from deepseek-r1:8b: the same shapes and the same 5.74 GB Q4_1 layout. For qwen3.8:27b, FLM ran its own container and always decodes with its MTP head (7 drafts per step), and its 8k is the model's limit there. OFLM runs a different container without MTP (task.md §0).

  • OFLM's open engine is slower than FLM's closed one on every model at every size. Decode at 1k is 1.3-2.2x slower. TTFT at 1k is 2.6-10x slower. The gaps widen with context: at 4k, decode is 1.9-3.5x slower and TTFT 2.9-43x (29-43x on the Llama models).
    • The one exception is Qwen3.8-27B decode. OFLM's plain decoding (2.49 tok/s) beats FLM's MTP decoding (1.89), because FLM's speculative cycle costs more than it commits.
    • The environment is not the cause (env_ab.py, env_ab.log, llama3.2:1b at 1k / 2k):
      • unsetting OMP_WAIT_POLICY changes nothing (< 1%);
      • OFLM_OPEN_QUIET=1, which removes the default per-token NaN / max-abs scan, gains 1.5-2.7%.
    • oflm bench agrees with the harness at 1k-8k for qwen3:0.6b and qwen3.5:9b: prefill tok/s within 3.3%, decode within 4.3%. Its TTFT is 3-8% lower because its "1k" prompt is 968 tokens plus the template. The other models were too slow at 8k for the cross-check to run.
  • Llama prefill attention runs one token at a time.
    • The block-prefill route batches the GEMMs 256 tokens at a time.
    • Attention needs the batched NPU products (attn_block). For a dense layer the engine uses them only when the manifest names the family's prep (src/open_qwen36/manifest.cpp:268-272).
    • The dense recipe writes prep only for qk-norm families, i.e. Qwen3 (open_kernels/recipes/dense.py:446-448; the 3x dense-prefill speed-up of 3f3ff9f covered "the qwen3 family's attention").
    • So every Llama set, including the spec'd 8B, falls back to T single-token dxB dispatches per block (src/open_qwen36/core.cpp:2591). The startup line calls this "attention on the host"; the NPU is in fact 90-94% busy during prefill.
    • TTFT grows 3.0-3.6x per doubling of the prompt (1B: 7.2 → 22.7 → 80.8 s), and prefill speed falls from 143 to 51 tok/s (1B) and from 44 to 17 tok/s (8B) between 1k and 4k.
  • Qwen3 and Qwen3.5 prefill attention runs on the NPU as batched products.
    • Qwen3-0.6B prefill falls only from 439 to 344 tok/s up to 4k.
    • At 8k it drops to 141 tok/s: the attention window exceeds the kernels' l_max of 4096, and the host splits it and merges the softmax (core.cpp:3163-3226).
    • The Qwen3.5 layer-major schedule is flat: 9B at 129-139 tok/s from 1k to 16k, 27B at 39-41 tok/s. FLM did 113-120 tok/s on the 27B; Artlite does 410 at 1k.
  • Decode is NPU-bound and slows quickly with context.
    • The NPU is 96-99% busy during decode (drm-engine time).
    • Weight streaming at 1k runs at 12-43 GB/s: 28 / 33 / 40 GB/s for Llama 1B / 3B / 8B, 39 for Qwen3.5-9B, 43 for the 27B. FLM reaches 44-51 GB/s on the same Llama files.
    • Per-token time grows linearly with position, by about 15 ms per 1k positions on Qwen3-0.6B and 8 ms on Llama 1B. By 4k that roughly halves decode speed on the small models.
  • Where the sweeps stopped: under the 5-minute rule.
    • 4k for the three Llama models and the 27B (predicted 321-929 s at 8k).
    • 8k for Qwen3-0.6B, 16k for Qwen3.5-9B.
    • FLM reached 32-64k on the same models (8k on the 27B: FLM's container loads no more).

Faithfulness

  • Every run of every model was faithful:
    • prompt_tokens = N, so nothing was reused (OFLM reports no cached_tokens);
    • the Prefill chunk lines added up to the prompt;
    • no TDRs and no degenerate output;
    • finish_reason was length;
    • the needle was recalled in all runs.
    • The sweeps stopped at ≤ 16k, below the sizes where the FLM survey saw Llama's recall misses.
  • No chunk-length check ran. It needs a size above the 4096-token default chunk whose run took ≤ 60 s, and none qualified. oflm bench (unchunked by design) is the only unchunked data, and it matches the chunked sweep, so chunking costs nothing here.

Memory

  • OFLM allocates the KV cache for the whole --ctx-len at load, like FLM. Per position it is the bf16 K + V of the attention layers plus about 3%:

    model KV per position bf16 K + V of the attention layers
    Llama 1B / 3B / 8B 33.0 / 114 / 130 KiB 32 / 112 / 128
    Qwen3-0.6B 114 KiB (FLM: 165) 112
    Qwen3.5-9B / 27B 34.0 / 66.0 KiB (8 / 16 full-attention layers) 32 / 64

    So at the native context: Llama 3.1 8B holds 25.0 GiB idle at 131072, the 27B 39.4 GiB at 131072, and Qwen3.5-9B 18.1 GiB at 262144.

  • Everything lives in NPU buffers.

    • Host heap (RssAnon) is 0.09-0.21 GiB, with no host copy of the embedding (FLM kept 0.5-1.1 GiB on the host).
    • Before any KV (at --ctx-len 2048), the buffers already exceed the files: 1.15 / 0.64 GiB (0.6B), 1.63 / 1.21 (1B), 4.05 / 2.60 (3B), 9.01 / 5.35 (8B), 9.71 / 8.07 including vision (9B), and 31.3 / 18.5 GiB (27B).
    • Where the extra 0.4-12.8 GiB goes was not traced.
  • Load time from start to the first answer: 1.2-2.2 s for 0.6B and 1B, 2-8 s for 3B / 8B / 9B, and 14-20 s for the 27B.

OFLM problems found on the way

problem effect where
model_info.json pins llama3.1:8b's old tokenizer_config.json (4331 B); the repo replaced it on 2026-09-17 oflm pull llama3.1:8b fails its hash check worked around with the pinned blob (task.md §1)
Llama 3.2 1B / 3B and Qwen3 0.6B ship no open kernel sets, and the engine falls back to the closed one silently oflm run llama3.2:1b runs FLM's kernels while the docs call it open exported here with --model-dir
the dense recipe gives attn_block.prep to qk-norm families only every Llama prefill attends token by token dense.py:446-448, manifest.cpp:268-272
the startup line says "attention on the host" for that route misleading: it is per-token NPU dispatches core.cpp:450
Qwen3.5 / 3.8 catalog entries say Q4_K the containers hold q4_1 + q8 tiles weights.md
FLM's Qwen3.8-27B container has an 8-bit embedding it can't run on the open path (the lookup is bf16-only) q4nx_file.cpp:135

For docs/data (later)

An openflowlm.json in fastflowlm.json's schema, with these comparable quants:

  • llama3.2:1b, llama3.2:3b and llama3.1:8b are q4nx Q4_1 (Unsloth imatrix), so comparable_quants ["Q4_1", "Q4_K_M", "Q4_K_S", "Q4_0"]. FLM's row for the 8B used same_shapes_as; OFLM runs Llama 3.1 8B itself.
  • qwen3.8:27b is q4_1 linears with q8 ssm_out_proj and lm_head, converted from a Q8_0 GGUF, so ["Q4_K_M", "Q4_K_S"]. It has no MTP.
  • qwen3:0.6b and qwen3.5:9b have no Artlite chart row yet.

The 5-minute rule leaves OFLM without most chart points.

  • The charts use TTFT at 1k / 8k / 32k / 64k and decode at 1k / 32k. The survey has the 1k points for every model, 8k only for 0.6B and 9B, and nothing at 32k.
  • Targeted single runs without the 5-minute cap would take about 5 / 11 / 15 / 5 min at 8k for 1B / 3B / 8B / 27B.
  • At 32k the Llama prefill, growing 3.0-3.6x per doubling, would need about an hour for one 1B run and several hours for the 8B; the 27B would need about 15 min.

Summary

model weights/token, MB load, s TTFT 1k / 8k / max, s prefill tok/s 1k / max decode tok/s 1k / max decode GB/s 1k largest N footprint max / files, GB
qwen3:0.6b 373 2.2 2.33 / 58.21 / 58.21 439 / 141 32.86 / 7.22 12.2 8k (time: predicted 306 s) 7.46 / 0.68
llama3.2:1b 772 2.2 7.16 / - / 80.76 143 / 51 35.98 / 19.38 27.8 4k (time: predicted 321 s) 6.26 / 1.30
llama3.2:3b 2008 5.5 15.33 / - / 176.37 67 / 23 16.27 / 9.01 32.7 4k (time: predicted 715 s) 19.62 / 2.80
llama3.1:8b 4691 7.0 23.33 / - / 242.77 44 / 17 8.50 / 5.35 39.9 4k (time: predicted 929 s) 27.11 / 5.74
qwen3.5:9b 5586 5.8 7.83 / 60.24 / 127.38 131 / 129 7.00 / 3.85 39.1 16k (time: predicted 369 s) 20.87 / 8.66
qwen3.6-moe:35b-a3b not measured
qwen3.8:27b 17254 14.0 26.13 / - / 98.97 39 / 41 2.49 / 2.25 42.9 4k (time: predicted 357 s) 43.80 / 19.84

Per model

qwen3:0.6b

Files 0.68 GB (q4nx), native ctx 40960, catalog ctx 32768; template overhead 13 tokens. Kernel set Qwen3-0.6B-NPU2 (None sets, built 2026-10-17T16:26:50+0800 from 99fe7e4d, mlir-aie 1.4.2, Peano 21.0.0.2026080301+c9c5ecb7).

server ctx-len chunk engine context capacity load, s idle footprint, GiB idle NPU BOs, GiB idle RssFile, GiB
1 2048 4096 Qwen3 2048 1.2 1.15 0.00 0.06
2 40960 4096 Qwen3 40960 2.2 5.38 0.00 0.06
probe (1k) ctx-len TTFT, s decode tok/s footprint, GiB
probeA 2048 2.299 32.72 1.32
probeB 40960 2.311 32.83 5.55

Sweep, default prefill chunk (4096), ctx-len 40960:

1k 2k 4k 8k
prompt tokens 1024 2048 4096 8192
TTFT, s 2.33 5.06 11.91 58.21
prefill tok/s 439 405 344 141
decode tok/s 32.86 21.61 13.07 7.22
decode GB/s (weights) 12.2 8.1 4.9 2.7
OFLM prefill tok/s 469 425 357 143
OFLM decode tok/s 32.67 21.43 12.93 7.13
TTFT range, s 2.33-2.35 5.01-5.08 11.67-11.92 58.07-58.25
reps 3 3 3 3
footprint, GiB 5.56 5.87 6.10 6.95
NPU BOs, GiB 5.28 5.28 5.28 5.28
NPU busy prefill / decode 0.65 / 0.97 0.61 / 0.98 0.57 / 0.99 0.72 / 0.99
needle recalled 3/3 3/3 3/3 3/3
unfaithful (TDR / degenerate) 0 0 0 0
  • stop (sweep) at n = 16384: time: predicted 306 s

oflm bench (bench_qwen3_0.6b_20261017.csv):

context_length_k ttft_avg_s ttft_std_s ttft_min_s ttft_max_s prefill_avg_toks_per_s prefill_std_toks_per_s prefill_min_toks_per_s prefill_max_toks_per_s decoding_avg_toks_per_s decoding_std_toks_per_s decoding_min_toks_per_s decoding_max_toks_per_s
1 2.199367 0.014985 2.179525 2.215735 450.45 1.91 448.76 453.12 32.57 0.24 32.30 32.88
2 4.848985 0.069129 4.761141 4.930066 406.81 6.29 399.46 414.82 21.52 0.15 21.31 21.66
4 11.344956 0.099666 11.270727 11.485838 345.44 2.22 342.30 347.06 12.87 0.03 12.83 12.89
8 54.442570 0.149537 54.237644 54.590263 142.96 0.45 142.53 143.58 7.20 0.03 7.17 7.23

llama3.2:1b

Files 1.30 GB (q4nx), native ctx 131072, catalog ctx 131072; template overhead 35 tokens. Kernel set Llama-3.2-1B-NPU2 (None sets, built 2026-10-17T16:27:54+0800 from 99fe7e4d, mlir-aie 1.4.2, Peano 21.0.0.2026080301+c9c5ecb7).

server ctx-len chunk engine context capacity load, s idle footprint, GiB idle NPU BOs, GiB idle RssFile, GiB
1 2048 4096 Llama 3 2048 1.5 1.63 0.00 0.06
2 131072 4096 Llama 3 131072 2.2 5.69 0.00 0.06
probe (1k) ctx-len TTFT, s decode tok/s footprint, GiB
probeA 2048 7.240 35.80 1.69
probeB 131072 7.224 36.78 5.75

Sweep, default prefill chunk (4096), ctx-len 131072:

1k 2k 4k
prompt tokens 1024 2048 4096
TTFT, s 7.16 22.69 80.76
prefill tok/s 143 90 51
decode tok/s 35.98 27.68 19.38
decode GB/s (weights) 27.8 21.4 15.0
OFLM prefill tok/s 143 90 51
OFLM decode tok/s 36.70 28.17 19.65
TTFT range, s 7.15-7.23 22.61-22.71 80.37-81.14
reps 3 3 2
footprint, GiB 5.79 5.81 5.83
NPU BOs, GiB 5.60 5.60 5.60
NPU busy prefill / decode 0.90 / 0.96 0.93 / 0.96 0.94 / 0.98
needle recalled 3/3 3/3 2/2
unfaithful (TDR / degenerate) 0 0 0
  • stop (sweep) at n = 8192: time: predicted 321 s

llama3.2:3b

Files 2.80 GB (q4nx), native ctx 131072, catalog ctx 65536; template overhead 35 tokens. Kernel set Llama-3.2-3B-NPU2 (None sets, built 2026-10-17T16:29:09+0800 from 99fe7e4d, mlir-aie 1.4.2, Peano 21.0.0.2026080301+c9c5ecb7).

server ctx-len chunk engine context capacity load, s idle footprint, GiB idle NPU BOs, GiB idle RssFile, GiB
1 2048 4096 Llama 3 2048 2.0 4.05 0.00 0.06
2 131072 4096 Llama 3 131072 5.5 18.07 0.00 0.06
probe (1k) ctx-len TTFT, s decode tok/s footprint, GiB
probeA 2048 15.304 16.50 4.12
probeB 131072 15.242 16.33 18.15

Sweep, default prefill chunk (4096), ctx-len 131072:

1k 2k 4k
prompt tokens 1024 2048 4096
TTFT, s 15.33 48.41 176.37
prefill tok/s 67 42 23
decode tok/s 16.27 12.82 9.01
decode GB/s (weights) 32.7 25.7 18.1
OFLM prefill tok/s 67 42 23
OFLM decode tok/s 16.49 12.98 9.11
TTFT range, s 15.33-15.36 48.00-48.55 176.37-176.37
reps 3 3 1
footprint, GiB 18.21 18.27 18.27
NPU BOs, GiB 17.99 17.99 17.99
NPU busy prefill / decode 0.90 / 0.98 0.92 / 0.98 0.93 / 0.99
needle recalled 3/3 3/3 1/1
unfaithful (TDR / degenerate) 0 0 0
  • stop (sweep) at n = 8192: time: predicted 715 s

llama3.1:8b

Files 5.74 GB (q4nx), native ctx 131072, catalog ctx 16384; template overhead 35 tokens. Kernel set Llama-3.1-8B-NPU2 (None sets, built 2026-10-17T05:09:53+0800 from 99fe7e4d, mlir-aie 1.4.2, Peano 21.0.0.2026080301+c9c5ecb7).

server ctx-len chunk engine context capacity load, s idle footprint, GiB idle NPU BOs, GiB idle RssFile, GiB
1 2048 4096 Llama 3 2048 5.5 9.01 0.00 0.06
2 131072 4096 Llama 3 131072 7.0 25.00 0.00 0.06
probe (1k) ctx-len TTFT, s decode tok/s footprint, GiB
probeA 2048 23.817 8.44 9.12
probeB 131072 23.569 8.47 25.11

Sweep, default prefill chunk (4096), ctx-len 131072:

1k 2k 4k
prompt tokens 1024 2048 4096
TTFT, s 23.33 70.08 242.77
prefill tok/s 44 29 17
decode tok/s 8.50 7.11 5.35
decode GB/s (weights) 39.9 33.4 25.1
OFLM prefill tok/s 44 29 17
OFLM decode tok/s 8.59 7.18 5.41
TTFT range, s 23.30-33.29 70.02-70.15 242.77-242.77
reps 3 2 1
footprint, GiB 25.19 25.22 25.25
NPU BOs, GiB 24.92 24.92 24.92
NPU busy prefill / decode 0.91 / 0.99 0.94 / 0.99 0.94 / 0.99
needle recalled 3/3 2/2 1/1
unfaithful (TDR / degenerate) 0 0 0
  • stop (sweep) at n = 8192: time: predicted 929 s

qwen3.5:9b

Files 8.66 GB (q4nx), native ctx 262144, catalog ctx 32768; template overhead 8 tokens. Kernel set Qwen3.5-9B-NPU2 (None sets, built 2026-10-17T05:17:03+0800 from 99fe7e4d, mlir-aie 1.4.2, Peano 21.0.0.2026080301+c9c5ecb7).

server ctx-len chunk engine context capacity load, s idle footprint, GiB idle NPU BOs, GiB idle RssFile, GiB
1 2048 4096 Qwen3.5 2048 8.2 9.71 0.00 0.06
2 262144 4096 Qwen3.5 262144 5.8 18.14 0.00 0.06
probe (1k) ctx-len TTFT, s decode tok/s footprint, GiB
probeA 2048 7.871 7.02 10.08
probeB 262144 7.920 6.97 18.45

Sweep, default prefill chunk (4096), ctx-len 262144:

1k 2k 4k 8k 16k
prompt tokens 1024 2048 4096 8192 16384
TTFT, s 7.83 14.95 29.55 60.24 127.38
prefill tok/s 131 137 139 136 129
decode tok/s 7.00 6.61 5.99 5.02 3.85
decode GB/s (weights) 39.1 36.9 33.5 28.0 21.5
OFLM prefill tok/s 142 143 142 138 130
OFLM decode tok/s 6.92 6.53 5.92 4.95 3.80
TTFT range, s 7.79-7.91 14.87-15.01 29.39-29.70 60.10-60.37 127.38-127.38
reps 3 3 2 2 1
footprint, GiB 18.47 18.65 19.12 19.35 19.44
NPU BOs, GiB 18.01 18.01 18.01 18.01 18.01
NPU busy prefill / decode 0.91 / 0.97 0.93 / 0.97 0.92 / 0.97 0.91 / 0.97 0.88 / 0.98
needle recalled 3/3 3/3 2/2 2/2 1/1
unfaithful (TDR / degenerate) 0 0 0 0 0
  • stop (sweep) at n = 32768: time: predicted 369 s

oflm bench (bench_qwen3.5_9b_20261017.csv):

context_length_k ttft_avg_s ttft_std_s ttft_min_s ttft_max_s prefill_avg_toks_per_s prefill_std_toks_per_s prefill_min_toks_per_s prefill_max_toks_per_s decoding_avg_toks_per_s decoding_std_toks_per_s decoding_min_toks_per_s decoding_max_toks_per_s
1 7.229898 0.040206 7.176325 7.273183 135.30 0.72 134.54 136.27 6.70 0.08 6.60 6.79
2 14.293262 0.077408 14.207562 14.395100 136.21 0.76 135.21 137.05 6.39 0.11 6.27 6.54
4 28.606730 0.157629 28.423639 28.808405 135.74 0.69 134.87 136.56 5.77 0.01 5.76 5.79
8 57.104618 0.272339 56.871449 57.486679 135.84 0.64 134.93 136.39 4.85 0.02 4.82 4.88

qwen3.6-moe:35b-a3b

Not measured.

qwen3.8:27b

Files 19.84 GB (q4nx), native ctx 262144, catalog ctx 32768; template overhead 8 tokens. Kernel set Qwen3.8-27B-NPU2 (None sets, built 2026-10-17T05:15:58+0800 from 99fe7e4d, mlir-aie 1.4.2, Peano 21.0.0.2026080301+c9c5ecb7).

server ctx-len chunk engine context capacity load, s idle footprint, GiB idle NPU BOs, GiB idle RssFile, GiB
1 2048 4096 Qwen3.5 2048 19.5 31.27 0.00 0.06
2 131072 4096 Qwen3.5 131072 14.0 39.39 0.00 0.06
probe (1k) ctx-len TTFT, s decode tok/s footprint, GiB
probeA 2048 25.869 2.52 31.94
probeB 131072 25.744 2.55 39.91

Sweep, default prefill chunk (4096), ctx-len 131072:

1k 2k 4k
prompt tokens 1024 2048 4096
TTFT, s 26.13 50.13 98.97
prefill tok/s 39 41 41
decode tok/s 2.49 2.40 2.25
decode GB/s (weights) 42.9 41.4 38.8
OFLM prefill tok/s 42 42 42
OFLM decode tok/s 2.45 2.36 2.22
TTFT range, s 25.98-31.48 50.13-50.13 98.97-98.97
reps 3 1 1
footprint, GiB 40.06 40.28 40.79
NPU BOs, GiB 39.19 39.19 39.19
NPU busy prefill / decode 0.93 / 0.98 0.94 / 0.98 0.94 / 0.99
needle recalled 3/3 1/1 1/1
unfaithful (TDR / degenerate) 0 0 0
  • stop (sweep) at n = 8192: time: predicted 357 s

Rerun

cd experiments/oflm-survey
uv run oflm_bench.py --checkout <OpenFlowLM-Next> [--models tag,...] [--redo] [--max-n N]
python report.py
python weights.py ~/.config/oflm/models/<Name> ...   # per-token weight bytes for report.py
uv run env_ab.py --checkout <OpenFlowLM-Next>          # environment A/B on one model
  • The models were deleted after the survey (2026-10-17). To rerun, pull them again into ~/.config/oflm/models with oflm pull and the harness's environment (task.md §1; llama3.1:8b needs the pinned tokenizer_config.json). Without ~/.config/oflm or OFLM_MODEL_PATH, oflm falls back to FLM's ~/.config/flm.
  • The kernel sets are the checkout's src/xclbins/<Name>/open_kernels. Export the ones without a spec with export_qwen36_kernels.py --model-dir.
  • The 2026-10-17 run took 70 min for the six models (survey-1017.log).
  • --version (default 0.1.0) must match oflm version. The NPU power mode must be turbo.
  • A model with results/<tag>/done.json is skipped unless --redo is given.

Cyronius avatar Oct 18 '26 10:10 Cyronius

there are licensing issues with gplv3 -- can't use his code directly, but we can study it for ideas.

Cyronius avatar Oct 18 '26 12:10 Cyronius

Hi, yes, ideas/skills are free! Regarding usage of gpl code - it is up to you.

If you need remeasurement or analysis - ping me. https://github.com/artlite-project/artlite/blob/main/docs/images/ttft-dark.svg stores a ttft chart - and OpenFlowLM seems to be slower than it could be.

AngryLoki avatar Oct 18 '26 16:10 AngryLoki

@Cyronius are the licensing issues ours or inherited from AMD? And thank you @AngryLoki !

Atomic-Germ avatar Oct 21 '26 00:10 Atomic-Germ

4. @Cyronius are the licensing issues ours or inherited from AMD? And thank you @AngryLoki !

I mean that we would have to adopt the GPLv3 in order to use artlite code directly. I like the GPLv3, but I don't personally think we should adopt it for a project of this type that may end up being used as a library/linked to directly.

Cyronius avatar Oct 21 '26 10:10 Cyronius

Update: Artlite is now licensed under LGPL-2.1-or-later (artlite-project/artlite@6c861d4). The AMD-derived files in csrc/shim_xdna/ keep their own licenses (Apache-2.0, and GPL-2.0 with the Linux syscall note for the driver's UAPI header).

For OpenFlowLM this means you can use Artlite, or parts of it, from an MIT project: code taken from Artlite stays under LGPL-2.1-or-later as its own component, and changes to it are published with its source; the rest of OpenFlowLM stays MIT.

Why LGPL:

  • For about two years there was no competitive open-source end-user product on the Strix NPU. mlir-aie, IRON, iree-amd-aie and llvm-aie are toolchains, not end-user products. The open end-user projects that appeared recently, OpenFlowLM among them, are still well behind the closed ones, largely because the toolchain's documentation and examples are thin.
  • Meanwhile, several companies ship proprietary products on the Strix NPU; the best known is Windows Recall.
  • Building an xclbin from source is easy; going back is practically impossible. This kernel, produced by Artlite, is manageable as source. After compilation (optimizations, inlining, software pipelining with exposed operand latencies) it can be disassembled, but not understood. Closed NPU code is effectively impossible to audit, and it runs without noticeable load: the NPU barely changes power draw or heat, unlike the CPU or iGPU, and a workload can pause while someone watches Task Manager. Think of a product that discreetly records the user's screen and analyzes their activity on the NPU.
  • So I want modified copies of Artlite to be distributed with their source, without GPL's reach into everything linked to it. LGPL does that: proprietary apps may include Artlite as a component, as long as the source of the Artlite they ship, with their changes, is available. Their own fork is fine; "or later" lets them use LGPLv3's terms, under which a link to source hosted elsewhere is enough.

AngryLoki avatar Oct 21 '26 12:10 AngryLoki

well, that changes a lot. germ, if you want to switch to lgpl we can collaborate in a more direct way with artlite. it's up to you. with the analysis from artlite I think we can get there either way.

the artlite approach is quite a bit different from ours, so i don't think it's a direct import either way, but giving agents code they can start with is a great way to get things done faster/better.

Cyronius avatar Oct 21 '26 13:10 Cyronius

@AngryLoki @Cyronius I'm cool with lgpl

Atomic-Germ avatar Oct 21 '26 13:10 Atomic-Germ

I am fine with lgpl too, but we should be careful with the stuff that already have other licenses and we are not the authors of. If we want to switch, we should switch now.

I am looking at the numbers now.

vegah avatar Oct 21 '26 18:10 vegah

We need to merge #193, #194 and #209 and compare again.

vegah avatar Oct 21 '26 20:10 vegah

@vegah Good point; thank you.

Atomic-Germ avatar Oct 22 '26 00:10 Atomic-Germ

Re-measured at 9b1409d, which includes #193, #194 and #209, and added qwen3.6-moe:35b-a3b. Full report: https://gist.github.com/AngryLoki/1adec076f72db211098fbe12fd39790b

#232 (c2a9e094) breaks most catalog models, silently

The requests finish with finish_reason: length, the per-token NaN scan stays quiet and dmesg is clean. Only the text shows it. qwen3:0.6b is the only surveyed model still correct; everything else is correct at 96b915d4, the commit before #232.

  • llama3.2:1b, llama3.2:3b, llama3.1:8b: garbage. "Write the numbers from one to ten in words" gives one, two, three, three, four, five, six, seven, eight, nine, nine, ten, nine, nine, ...; prompts of a few hundred tokens give \n\n\n\n.\n\x08\n.\n .. or 6\n 6\n 6.
    • Cause: #232 makes the RoPE pairing a family property (ROPE_INTERLEAVED_FAMILIES = ("llama3",), open_kernels/recipes/spec.py:45) and compiles it into every llama3 set: ROPE_IL in dx (recipes/dense.py:368), and rope_pairing: interleaved in the base manifest layout, not only in the gguf section. A GGUF stores Llama's q/k rows permuted for interleaved RoPE, but the catalog's q4nx containers are half-split.
    • 9b1409d's engine on kernel sets exported at 96b915d4 answers correctly; 96b915d4's engine on 9b1409d's sets does not.
  • qwen3.5:9b, qwen3.8:27b, qwen3.6-moe:35b-a3b: wrong answers.
    • 9B: I can't help you\n</think>\n\nI can't help! ...
    • 27B: 1, 2, 3, 4, 5, 6, 7, 8. for the one-to-ten question
    • 35B: 20\t\t\t\t\t\t34\t# \t}<|im_start|>
    • For the 9B, the two exports' manifests match outside the new gguf section, so the kernel builds differ (#232 touched attn.h, layer_x, dn_glue, gemv_q4). 9b1409d's engine on 96b915d4's 9B set answers short prompts correctly but not a 713-token one, so the engine changed too. Not narrowed further.

Two short questions plus a ~700-token summary on each catalog model catches all of it in a minute or two.

Other findings

  • qwen3.8:27b prefill is 4.5x slower by default since #213: TTFT at 1k 26.1 → 118.5 s, decode 2.49 → 2.08 tok/s (at 96b915d4).
    • --prefill-precision single takes 30.0 s and gives the same answers on these prompts: the first 32 tokens match paired's in 7 of 7 runs, the full 128-token answers in 4 of 5.
    • three_term takes 89.8 s and is byte-identical to paired.
  • --speculative on a kernel set without the rows route (anything but K2 / Granite) does nothing, and logs nothing.
  • model_info.json still pins llama3.1:8b's old tokenizer_config.json (blob 95b50010). oflm pull keeps the repo's 185-byte file with "Hash mismatch ... continuing", and the model ends up without a chat template, because chat_template.jinja isn't in the catalog's file list.
  • oflm add ./model.gguf queries Hugging Face with the path as a repo name (HTTP 401 / 404), and can't name the family of a qwen35 GGUF (MiniCPM-V 4.7).
  • A GGUF install has no block prefill route (src/open_qwen36/core.cpp:348), so its prompts prefill one token at a time.
  • --pmode only acts on Windows (src/src/main.cpp:770-790).
  • The catalog says Q4_K for the qwen3.5 / 3.6 / 3.8 containers, which hold q4_1 + q8 tiles.

Numbers

Each row is on the newest build that answers correctly, with the same prompts as the 2026-10-17 report. FastFlowLM 1.0.13 ran on the same machine (Strix Halo, NPU turbo).

model build TTFT 1k, s: OFLM / FLM decode 1k, tok/s: OFLM / FLM vs 99fe7e4
qwen3:0.6b 9b1409d 1.33 / 1.07 32.8 / 73.2 prefill 1.7x at 1k, 1.4x at 4k (#193); decode same
llama3.2:1b 9b1409d engine, 96b915d4 kernels 7.09 / 0.80 37.1 / 59.0 within 0-7%
llama3.2:3b same 15.2 / 1.99 16.5 / 23.7 within 0-7%
llama3.1:8b same 23.3 / 3.25¹ 8.5 / 10.9¹ within 0-7%
qwen3.5:9b 96b915d4 7.90 / - 7.22 / - within 1-4%
qwen3.8:27b 96b915d4, --prefill-precision single 30.0 / 9.43² 2.05 / 3.05² +15% TTFT; paired: 118.5 s
qwen3.6-moe:35b-a3b 96b915d4 5.29 / 6.83³ 14.6 / 17.2³ new: 219 s / 5.2 tok/s at 32k (FLM 124 s / 10.8)

¹ FLM's deepseek-r1:8b (the same shapes). ² FLM's own container, decoding with its MTP head. ³ FLM's own Q4_K container.

  • Llama prefill is still one dxB dispatch per token. The dense recipe gives attn_block.prep to qwen3 and k2 only (BLOCK_ATTN_QKNORM_ROPE, BLOCK_ATTN_ROPE), and #183 keeps the host attention off Llama. TTFT grows ~3.3x per doubling, so all three Llama sweeps stop at 4k under the 5-minute cap. This is the largest gap to FLM: 7-9x at 1k, 26-39x at 4k.
  • qwen3:0.6b's new 8-bit prefill is host-bound: the NPU is busy 36-43% of it, with 5-6 host cores working. At 8k it still drops to 155 tok/s, where the attention window passes l_max 4096.

AngryLoki avatar Nov 16 '26 17:11 AngryLoki