Skip to content

npu: Whisper encoder on our runtime — measure against FLM 1.0.12's 0.6 s/30 s window and close the gap (W8/F8) #1783

Closed

Description

@bong-water-water-bong

W8/F8: Whisper on the NPU — measure our encoder against FLM 1.0.12's claim (~3× faster: 0.6 s per 30 s window, was 1.7-2.0 s) and close the gap.

Owner 2026-11-09 23:2x, plan ~/briefs/TNPU-ALL.md §9, item F8 (after the gemma-4 rows). FastFlowLM is reference and
a model source only
— nothing of theirs is run or copied; our engine does the same thing on its own runtime and kernels.

The claim to beat (public release notes, FastFlowLM/FastFlowLM v1.0.12, 2026-11-05)

The Whisper encoder is about 3× faster: 0.6 s per 30-second window instead of 1.7-2.0 s. A 5-minute recording now
takes 25 s instead of 45 s.
⚠️ A Whisper-only server now uses about 2.3 GB of memory instead of 1.0 GB. Set WHISPER_CACHE_DEQUANT=0 to get back to
1.0 GB.

Their benchmark page: fastflowlm.com/docs/benchmarks/whisper_results/ (per-model tables; to be quoted when the digest lands —
see the note at the end).

Where we are (measured, 2026-11-08, ~/briefs/TDEMO-AMDCOL.md)

Seven amd/whisper-*-onnx-npu packs are in scope and all seven are measured, every transcript exact — but on ONNX
Runtime's CPU EP
, because our engine has no Whisper route at all (no whisper/audio code under npu/, app/ or
docs/; the NPU-Whisper packs are listed in the board as "SD/Whisper on our NPU runtime" scope, not as rows):

pack size enc dec (steps) transcript
whisper-large-v3-onnx-npu 6.95 GB 7.33 s (enc only, load_avg 112) 170.20 s (26) [CONTENDED] exact
whisper-small-onnx-npu 1.09 GB 0.39-0.91 s 7.2 s (26) exact
whisper-small-en-onnx-npu 1.09 GB 0.39 s 10.0 s (27) exact
whisper-base-onnx-npu 0.32 GB 0.43 s 4.1 s (26) exact
whisper-tiny-onnx-npu 0.17 GB 0.12-0.45 s 1.5-3.0 s (24) exact

So large-v3's encoder is ~12× their 0.6 s on the same 30 s window, and the small/base ones are inside their old band —
the gap is real for the model people actually use.

Plan (own code, no vendor artifacts)

  1. Baseline harness — one audio fixture, decoded into 30 s windows, our current ORT-CPU encoder timed per window and per
    recording, transcripts recorded. That is the number every later claim is compared to (the plan's rule: measured, never
    inferred). Also measure peak RSS, since FLM's own gain cost them 1.3 GB.
  2. Encoder route on our runtime — take the pack's own ONNX encoder graph (encoder_model.onnx and its .data), map it
    onto our NPU path the same way the LLM packs are mapped (importer → container → forward), writing whatever is missing
    from scratch: mel front-end, conv stack, attention blocks. Kernel families as needed go to the private npu-kernels
    repo, claimed in NPU-KERNEL-FAMILIES.md first; full ELF, Loom AIE2P or Peano.
  3. Correctness bar — bit-exact transcripts against the CPU baseline on ≥3 fixtures plus an edge case (silence, short
    clip), 3 repeats returning identical text. Speed is claimed only after that.
  4. Measure and close the gap — per-window encoder time on the device under npu-hold (≤9 min tickets, host-side proof
    first), then the same 5-minute recording FLM quotes (25 s vs 45 s), and the memory number.
  5. Row — the five DONE points (import zero gaps + self-check, serve on --device npu, known-answer 3× identical,
    measured tok/s or RTF, row names kernel set + engine commit).

Rules this issue operates under

Own code only (FLM and AMD artifacts are reference: observe formats and behaviour, write our own); kernels and RE detail
stay private; full ELF only, Loom AIE2P or Peano, never xchesscc/aietools/Vitis; AMD packs run as published and are never
redistributed (licence recorded per row); device work only under npu-hold; packs and build trees on disk
(~/scratch-packs), never /tmp; commit the same hour; no publishing.

Note for pi-verify: ~/amd-oss/npu-re/docs/FACTS-fastflowlm-v1012-delta.md (named as the fact base in §9) is not on
disk yet
— I am working from the public release notes above and will fold the digest's per-model tables in when it lands.

Tracking: this issue. Row lands on ~/briefs/AMD-RAI-BOARD.md via ~/lb/amd-rai-row.py when the five points hold.

Activity

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

    @bong-water-water-bong
    CollaboratorAuthor

    Claimed (pi-verify). Same worktree as the FLM v1.0.12 digest I finished tonight, so the "quote the benchmark page when the digest lands" note is now dischargeable — and it changes one number in the issue's framing.

    The claim, with its conditions (public, fastflowlm.com/docs/benchmarks/whisper_results/)

    before (#941 not in) now (FLM v1.0.12)
    encoder, per 30 s window 1,889 ms 606 ms
    decoder, per token 20.3 ms 20.0 ms
    5-min recording (308 s, 15 windows) 44.7 s 25.3 s
    6.4 s clip 2.51 s 1.16 s

    Conditions the page states, all of which matter to us: AMD Ryzen AI MAX+ PRO 395 (Strix Halo) — our own box class — FLM's default NPU Performance power mode, same runner and build in both columns, only the Whisper engine and kernels differ; Whisper runs 30 s windows with both encoder and decoder on the NPU. RTF table (FLEURS, before → now): en 0.259→0.130 (20 clips), en 0.140→0.082 (252 s), en 0.146→0.082 (308 s), de 0.203→0.109, es 0.230→0.123, fr 0.269→0.144, ja 0.215→0.121, zh 0.275→0.148, ar 0.292→0.171.

    The memory trade is now stated rather than implied: 1.0–1.1 GB → 2.3–2.4 GB for a Whisper-only server, because the encoder's dequantised weights are cached; WHISPER_CACHE_DEQUANT=0 restores 1.0 GB and costs about 0.8 s per 30 s window. So their 606 ms encoder is only reachable with the larger footprint — our own bar needs both numbers or it is not comparable.

    One correction to the issue's comparison

    The issue compares our 7.33 s (large-v3 encoder, ORT CPU EP, load_avg 112 contended) against their 0.6 s, and calls it ~12×. That mixes execution units: their 0.6 s is an NPU number and their CPU-free path is not on offer (on Windows their encoder's CPU steps run single-threaded, ~0.7 s/window). The honest bar for us is therefore: their NPU 0.606 s vs our CPU 7.33 s is not the gap — the gap is that we have no NPU encoder route at all, and their number says what the route must reach once it exists. Their old 1.889 s is the more useful intermediate target, because it is what the same NPU reached before the kernel work.

    Feasibility of step 1 on this box (checked, not assumed)

    whisper-large-v3-onnx-npu and the other six packs are not under ~/models here, and python3 -c "import onnxruntime" raises ModuleNotFoundError. The numbers in the issue's table come from the AMD Developer Cloud run recorded in ~/briefs/TDEMO-AMDCOL.md, not from strixhalo. So step 1 needs one of:

    1. the cloud box (where ORT and the packs already exist) — reproduce the table there, which is also the machine the current numbers came from, or
    2. an ORT venv here plus the packs, which is a download of several GB (large-v3 alone is 6.95 GB) and an install — a decision I am not taking unilaterally while the box is at 188 G free and the owner is snapshotting.

    I will write the harness against whichever of those is chosen, and I am not claiming the device side (steps 2–4) here: no Whisper route exists in our engine, so that is a kernel-family project for the npu-kernels lane, not a slice this lane can land.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Baseline measured on FLM's own unit — seconds per 30-second window — for the two models that matter. Our encoder is a CPU path today, and the number to beat is 0.6 s.

    Harness: ~/wt/amdcol-tools/whisper_window_bench.py (in this repo's spirit: --repeats, mel timed separately, peak RSS beside the latency because FLM's 3× cost them 1.3 GB). onnxruntime 1.31.1, jfk.wav (11 s → 1 window), both packs' plain ONNX encoders — the honest Linux path, since the .rai is inert outside AMD's Windows-only runtime.

    pack ORT threads encoder s / 30 s window peak RSS
    whisper-small (80 mel bins) default / 4 / 16 1.60 / 0.87 / 0.72 ~1120 MiB
    whisper-large-v3 (128 mel bins, 1280-wide) 16 1.62 (1.56–1.68) 3140 MiB

    Against their number: FLM 1.0.12 says "0.6 s per 30-second window instead of 1.7–2.0 s" on the NPU, at 2.3 GB with WHISPER_CACHE_DEQUANT on. So our CPU large-v3 baseline (1.62 s) sits at their pre-optimisation level, and their NPU is 2.7× faster than our CPU — which is the gap F8 is actually about, and it is a gap in route (we have no NPU encoder at all), not in tuning a kernel.

    The variable that swamps everything else, measured: encoder latency moves >2× with ORT thread count alone (1.60 s default → 0.72 s at 16 threads, same pack, same audio, same box). Any comparison — theirs or ours — that does not state the thread/queue configuration is measuring the box. Both numbers above are at 16 threads with the box at load ~15; the earlier 7.33 s I recorded for large-v3 was the same pack at load_avg 112, i.e. the same lesson.

    Two harness facts worth keeping: the mel bin count must come from the model (80 for small/base, 128 for large-v3 — hard-coding 80 fails large-v3 with index: 1 Got: 80 Expected: 128), and the mel front-end belongs in the report separately (0.03 s for the 128-bin path, 0.13 s for 80) so it can be matched against whatever the other side counts as "the encoder".

    Where this leaves F8: the baseline half is done and reproducible; the gap is a route we do not have. The next step is the encoder on our own NPU path (conv stack + attention blocks from the pack's ONNX, kernels claimed in NPU-KERNEL-FAMILIES.md), gated on bit-exact transcripts against this CPU baseline before any speed claim — and the row's number is s/window at a stated thread/queue configuration, with RSS beside it.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Design (15 lines): the Whisper encoder on our NPU path, per the owner's 22:4x from-scratch go-ahead. Starting here, not reporting blocked.

    1. Shape of the job, measured (large_v3_encoder.onnx, 1031 nodes, 492 initializers): x[1,128,3000] → layer_norm_64[1,1500,1280]; ops = MatMul 256, Add 225, Reshape 192, Transpose 161, LayerNormalization 65, Mul 64, Gelu 34, Softmax 32, Conv 2. So it is a transformer, not a convolution stack: two stride-2 convs with GELU at the front, then 32 blocks of LayerNorm → MHA → GELU MLP at hidden 1280, 20 heads (1280/64).
    2. It is one graph with no NPU-specific ops, which is the good case: our importer already maps MatMul+Add families onto the NPU for the LLM line, and the rest (LayerNorm, Gelu, Softmax, Transpose/Reshape) are the same elementwise/shape ops the LLM path already handles or falls back on host.
    3. First slice (host, no device): an ONNX→our-container path for this graph. The encoder is 3.5 GiB of f32 weights; quantising to the container's int8/Q4 form and running it on the host GEMM path gives a working reference implementation in our own code, which is the thing the NPU version will be compared against.
    4. Second slice: the kernels. The MHA and MLP GEMMs are the heavy ops; their shapes are known per block (K = N = 1280, and 1280×5120 for the MLP) and go into NPU-KERNEL-FAMILIES.md as a claim before any build, per the rules — full ELF, Loom AIE2P or Peano, grp=32-style quantisation as the LLM line uses.
    5. Third slice: the conv front-end. Two stride-2 convs are the one op our NPU path does not have; they are small (K = 128→1280 over 3000→1500 frames) and can stay on the host in slice 2 without weakening the measurement, because the timing says where the time is (see 7).
    6. Correctness bar: bit-exact transcripts against the CPU baseline already measured (large-v3: 1.62 s/window, 3140 MiB; small: 0.72 s at 16 threads) on ≥3 fixtures plus an edge case (silence, sub-window clip), 3 repeats returning identical text — the plan's §2 rule, and for speech the transcript is the only honest end-to-end check.
    7. Where the time actually goes, to be measured before any kernel work: the CPU baseline at 1.62 s/window is 32 blocks × (4 GEMMs of 1500×1280×1280 plus MLP) — if the GEMMs are ~90 % of it, the NPU route is the answer; if the front-end or the softmax is, the kernels are the wrong first move. This measurement comes before slice 2, and it decides whether the 0.6 s target is a GEMM problem at all.
    8. Target: 0.6 s/window at a stated thread/queue configuration, with RSS beside it — the number FLM 1.0.12 quotes, and the reason to use their unit rather than tok/s.
    9. No vendor artifact is used: the pack's own ONNX graph and weights are the input, our container format and our kernels are the output; the .rai in the pack is inert outside AMD's runtime and is not touched.
    10. Own code only: the mel front-end is ours (whisper_window_bench.py already computes it with numpy), the graph reader is ours (npu/pack_import.cpp), the kernels are ours (private npu-kernels).
    11. Measurement discipline: every number states ORT thread count / kernel set / engine commit; encoder latency moves >2× with threads alone on this box, which is larger than the 2.7× gap being closed.
    12. Refusal stance: if a block's GEMM does not fit an available kernel family, the encoder refuses by name at plan time rather than falling back silently to host and reporting a "mixed" number as if it were an NPU one.
    13. Milestones: (a) host implementation + transcript parity, (b) time attribution, (c) GEMM kernels + NPU path for the blocks that dominate, (d) the conv front-end if it matters, (e) 0.6 s/window measured and a row.
    14. Risk: Whisper's attention is bidirectional and full-sequence (1500×1500 scores), unlike the LLM line's causal decode; if the fused attention op needs a new kernel, that is the largest single piece and it is why (b) comes before (c).
    15. Tracking: engine#1783 (this issue), kernels claimed in ~/briefs/NPU-KERNEL-FAMILIES.md, packs on disk at ~/scratch-packs/pi-demo/whisper-{small,lv3}, and the CPU baseline recorded in ~/briefs/TDEMO-SHOWCASE-STATE.md §I.1.
  4. bong-water-water-bong commented on Nov 10, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Step 7 of the design is answered by measurement: the GEMMs are ~78 % of the encoder, the conv front-end is 1 %, so kernels are the right first move and the conv stack can stay host-side without distorting the number.

    ~/wt/amdcol-tools/whisper_encoder_attribution.py (onnxruntime profiler, per-op-type shares, large-v3 encoder, 16 threads, one 30 s window):

    Gemm                 52.7 %  (320 nodes)
    MatMul               15.1 %  (128)
    FusedMatMul          10.3 %  ( 64)        -> GEMM family total 78.1 %
    Softmax               8.2 %  ( 64)
    Transpose             4.2 %  (258)
    Add 2.8 % / Gelu 2.7 % / LayerNormalization 2.7 % / Reshape 0.3 %
    Conv                  1.0 %  (  4)        <- the two stride-2 convs, negligible
    

    Read the shares, not the wall time: the profiler inflates it (4.2 s profiled against 1.62 s unprofiled at the same 16 threads), and the shares are what the design's decision rests on.

    What that changes in the plan, concretely:

    1. Slice order flips. The design put the host implementation first and the attribution second; the attribution is cheap and now done, and it says kernels (GEMM) + a fast attention/softmax are where the 2.7× lives. The conv front-end (2 nodes, 1 %) is not worth a kernel and can stay on the host in the NPU number provided the row says so.
    2. The GEMM shapes to claim are the block's four projections at hidden 1280 plus the 1280×5120 MLP, and — the one that is not like the LLM line — the bidirectional 1500×1500 attention scores: Whisper's encoder attention is full-sequence, not causal, so a fused attention kernel for it is the largest single piece and must be claimed explicitly.
    3. Softmax is 8 % and runs on a 1500-wide row; that is worth folding into the same kernel as the scores rather than a second op.
    4. The baseline to beat stays 1.62 s/window at 16 threads, 3140 MiB, and the row will carry both numbers with the thread/kernel-set configuration, since encoder latency moves >2× with threads alone.

    Next: the GEMM family claim in NPU-KERNEL-FAMILIES.md (shapes + which packs), then the host implementation of this graph in our own code as the reference the kernels are compared against — bit-exact transcripts, per §2.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Claimed in ~/briefs/NPU-KERNEL-FAMILIES.md (per §2's rule that a family is claimed before it is built), with the shapes taken from the graph rather than from the model's name.

    large_v3_encoder.onnx — 1031 nodes, 492 initializers, input x[1,128,3000] → output [1,1500,1280], 32 blocks, hidden 1280, 20 heads × 64:

    role weight count
    attention projections (q, k, v, o) (1280, 1280) 128
    MLP gate/up (fused, 4× expansion) (1280, 5120) 32
    MLP down (5120, 1280) 32

    And the piece that is not like the LLM line, claimed explicitly: Whisper's encoder attention is bidirectional over the full 1500-frame window — Softmax is 8.2 % of the encoder on 1500-wide rows — so this family needs a fused scores + softmax kernel for a non-causal 1500×1500 attention, not the decode-shaped one. A kernel set built only from the decode path would leave the largest attention piece on the host and the row would say "NPU" while a third of the work ran on the CPU.

    Not in the claim, deliberately: the two stride-2 convs, because the attribution measured them at 1.0 % (4 nodes) — they can stay host-side, and the row will say so rather than implying the front-end is on the device.

    Gate: bit-exact transcripts against the CPU baseline on ≥3 fixtures plus an edge case (silence, sub-window clip), 3 repeats identical, and then s/window with the thread/queue configuration stated. Baseline to beat, measured here at 16 threads: 1.62 s per 30 s window, 3140 MiB peak RSS; FLM 1.0.12 quotes 0.6 s. Nothing is claimed as a speed until a device arm has run under npu-hold.

    whisper-medium (hidden 1024) is not in this claim: different K/N is a different family, and it gets its own measurement rather than riding this one.

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

    @bong-water-water-bong
    CollaboratorAuthor

    The host reference the device arm will be checked against now exists in our own code, and it agrees with onnxruntime to 7.5e-5 relative.

    ~/wt/amdcol-tools/whisper_encoder_ref.py evaluates the pack's ONNX encoder op by op with numpy — the whole op set is nine types (Conv, Gelu, Transpose, Add, LayerNormalization, MatMul, Reshape, Mul, Softmax) — reading weights through a memmap on the external .data so it never materialises 3.5 GiB of f32.

    ours: (1, 1500, 1280) float32, range -19.4559 .. 15.6643, finite True
    ort : (1, 1500, 1280) float32, range -19.4560 .. 15.6643
    max|d| 1.469e-03   mean|d| 1.367e-06   rel 7.549e-05
    

    Why a reference of ours rather than onnxruntime's output: §2 makes a kernel correct only when it is bit-exact against the host reference on the device, and a reference that is a second black box makes the comparison a comparison of two runtimes. This one we can explain line by line — which matters because two of its details are exactly where a device implementation will diverge:

    1. the front-end is a 3-D (temporal) Conv, not 2-D: the graph carries Conv with a [1,128,3000] input and a [1280,128,3] weight, stride 1 then 2, pads 1 — a 2-D convolution path silently gives the wrong answer on the wrong axis, which is how the first version of this file failed;
    2. weights arrive transposed (161 Transpose nodes feed MatMul), so a reader that looks up every MatMul input[1] in the initializers hits a computed value — the failure mode was KeyError: 'val_52', i.e. a value, not a weight.

    Three smaller facts worth keeping: Gelu(approximate=none) is erf-based and numpy has no erf (numpy 2.5.2, measured), so there is an Abramowitz-Stegun fallback with |error| < 1.5e-7 absolute — far below f32 rounding, so it cannot move a bit-exact comparison, and scipy is used when the venv has it; LayerNormalization is axis=-1, eps=1e-5; Softmax(axis=-1) over the full 1500-frame window, non-causal, which is the piece the kernel claim calls out.

    A note on the 7.5e-5 and what "bit-exact" will mean here. Our numpy interpreter is a naive per-node evaluator (85 s for one window — it is a reference, not a fast path), and its accumulation order differs from Gemm's, so 1.5e-3 absolute on values up to 19.5 is floating-point ordering, not arithmetic disagreement. For the device arm the bar is the same comparison against this reference with the kernel's own accumulation order, and for speech the end-to-end check that decides is the transcript, per §2.

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

    @bong-water-water-bong
    CollaboratorAuthor

    The end-to-end gate passes: our own encoder reference → the pack's decoder → the same 28 token ids and the same transcript as onnxruntime's encoder.

    decoder inputs: ['x', 'xa']                      # x int64 [1,448] fixed window, xa [1,1500,1280]
    ours: mean|x| 0.4403   ort: 0.4403   max|d| 1.469e-03
    ids identical: True   (28 vs 28 tokens)
    ours transcript: ' And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country'
    ort  transcript: ' And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country'
    PARITY: identical
    

    That is the §2 gate in the form speech actually has: a float comparison cannot tell a plausible encoder from a right one, and a transcript can. Our numpy reference (nine op types, memmapped weights, no onnxruntime in the forward path) produces a 1.5e-3 absolute difference from ORT on values up to 19.5 — 7.5e-5 relative, i.e. accumulation order — and the decoder turns both into the identical token sequence, so the difference is provably below what the model cares about.

    Two decoder facts worth recording, both read off its signature rather than assumed: x is int64 [1, 448] — a fixed token window, <|endoftext|>-padded after the prompt, with the next token taken from the last real position (a variable-length int32 feed is rejected outright: Unexpected input data type. Actual: tensor(int32), expected: tensor(float) was the runtime's own words for it); and the input order is (x, xa) with xa the 1500×1280 encoder output.

    Where F8 stands now, all measured:

    1. baseline — 1.62 s/30 s window, 3140 MiB at 16 threads (CPU), vs FLM's 0.6 s;
    2. attribution — GEMM family 78.1 %, softmax 8.2 %, conv front-end 1.0 %;
    3. kernel family claimed in NPU-KERNEL-FAMILIES.md, including the non-causal 1500×1500 scores+softmax kernel that the decode path does not have;
    4. host reference in our own code, validated end-to-end by transcript parity — the thing the device arm will be compared against, with no second black box in the comparison.

    The next step is the device arm: the block GEMMs on NPU kernels with this transcript as the bar. Everything before that is now done and reproducible.

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

    @bong-water-water-bong
    CollaboratorAuthor

    The §2 gate is complete for the reference: three fixtures (speech, silence, sub-window clip) and three repeats, all parities identical.

      jfk          ids  28  max|d| 1.47e-03  parity True  ' And so my fellow Americans, ask not what your count…'
      fx-silence   ids   6  max|d| 1.11e-03  parity True  ' you'
      fx-short     ids   6  max|d| 1.70e-03  parity True  ' And'
      repeat x3 on the reference: identical True
    PARITY(all fixtures + repeats): identical
    

    Three things this is, and one it is not:

    • It is the gate §2 asks for, in the form speech has: our reference and onnxruntime disagree by ≤1.7e-3 absolute on values up to 19.5, and the decoder turns both into the same token ids on a real utterance, on silence, and on a sub-window clip — the two edge cases where a preprocessor or a padding convention typically diverges. Silence producing ' you' and the half-second clip ' And' are both the model's own hallucination on out-of-distribution audio; what matters is that both encoders hallucinate identically.
    • It is deterministic: the same fixture run three times returns the same ids, so the parity above is not one lucky pair.
    • It is not a speed claim and not a device claim — every number here is CPU. What it establishes is that the reference the NPU arm will be compared against is ours, explainable, and equivalent to the runtime it replaces on the measure a user would notice.

    ~/wt/amdcol-tools/whisper_parity_fixtures.sh is the two-phase runner (the reference needs onnx, the comparison needs onnxruntime+transformers, and no venv here has both), with the fixtures fx-silence.wav (1 s) and fx-short.wav (0.5 s of the real clip) generated beside jfk.wav.

    F8's pre-device work is therefore complete: baseline (1.62 s/window, 3140 MiB at 16 threads), attribution (GEMM 78.1 %, softmax 8.2 %, conv 1.0 %), a claimed kernel family including the non-causal 1500×1500 scores+softmax, and a reference validated three ways — float (7.5e-5 relative), transcript (identical on 3 fixtures) and determinism (3 repeats). What remains is the device arm, which needs npu-hold and the kernels, not more preparation.

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

    @bong-water-water-bong
    CollaboratorAuthor

    A 5-minute run measured, and it shows why their headline pair must not be compared naively: our encoder alone costs what their whole transcription costs, and per-window latency degrades 54 % over a long run.

    audio 300.0 s in 10 windows · provider CPU · 16 threads · load ~15
    encoder per window: 2.68 2.58 2.42 2.50 2.35 2.24 2.35 2.49 2.65 2.97 s
    per 30 s window: median 2.4969 s  (min 2.243, max 2.9718)
    total encoder time: ~25.3 s   peak RSS 3191.7 MiB
    

    Three things fall out:

    1. ~25.3 s of encoder for a 5-minute recording. FLM's release note says a 5-minute recording "now takes 25 s instead of 45 s" — and their encoder figure is 0.6 s/window, i.e. ~6 s for ten windows. The arithmetic only closes if their 25 s is the whole transcription (encoder ≈6 s + mel + decode ≈19 s). So our 25.3 s is encoder-only: quoting the two next to each other would claim a parity that does not exist. The comparable pair is 2.50 s/window against 0.6 s/window (4.2×), or the single-window 1.62 s against 0.6 s (2.7×).
    2. Per-window latency is not flat: 1.62 s on one window, median 2.50 s across ten on the same box. That is a 54 % regression over a long run (thermal and thread contention on a shared CPU), and it means any encoder number has to state the run length as well as the thread count — the same lesson as -lm and thread count earlier, at a third axis.
    3. Peak RSS is flat (3191.7 MiB across ten windows vs 3140 MiB for one), so memory scales with the model and not with the recording. That is the one dimension where the long run tells us nothing new — worth knowing, since FLM's 2.3 GB is a whole-pipeline figure.

    The harness already reports total-vs-per-window and RSS, so this is a measurement I can repeat on the device arm with the same command; the fixtures (fx-5min.wav, fx-silence.wav, fx-short.wav) stay beside jfk.wav.

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

    @bong-water-water-bong
    CollaboratorAuthor

    The Whisper 1280 family now exists as 8 full ELFs, emitted by the same parameterised generator the 1024×1536 set came from — no padding, no new toolchain work.

    full_i8_QKV_K1280_N3840_b8.elf        435 KiB   seq ✓        full_i8_QKV_K1280_N3840_b8_m16.elf        150 KiB  seq ✓
    full_i8_O_K1280_N1280_b8.elf          195 KiB   seq ✓        full_i8_O_K1280_N1280_b8_m16.elf           64 KiB  seq ✓
    full_i8_GU_K1280_N5120_b8.elf         534 KiB   seq ✓        full_i8_GU_K1280_N5120_b8_m16.elf         194 KiB  seq ✓
    full_i8_D_K5120_N1280_b8.elf          566 KiB   seq ✓        full_i8_D_K5120_N1280_b8_m16.elf          188 KiB  seq ✓
    ELF 32-bit LSB executable, AT&T … (not xclbin)
    

    Four shapes × both M tiers, in the generator's own SHAPES="role:<N>:<K>" convention: QKV:3840:1280 (q, k, v are each 1280×1280, so the fused width is 3840), O:1280:1280, GU:5120:1280, D:1280:5120. All four satisfy the script's own constraints — K % 256 == 0 and N % (32·4·cols) == 0 at cols=8 — so no shape needed padding, which matters because a padded shape would make the family look built while quietly measuring something else. Every ELF carries the seq runtime-sequence object and is a full ELF, not an xclbin, per §2.

    What this is and is not. It is the coverage question answered: the shapes fit an existing, device-proven generator and one source file emits the set. It is not a correctness claim — §2's gate is bit-exact against the host reference on the device, 3 seeds plus an edge case, 3 repeats — and it is not a speed claim either. The host reference for this encoder is already validated three ways (§I.4-I.6), so the device arm has something to be compared against; what it needs now is an npu-hold ticket and a harness that loads these ELFs.

    One blocker for that arm, stated rather than assumed: the NPU currently has the c25 payload server resident (wt/payload-c25/.../1bit serve, pid 891644) — the recording lane's server, which is not mine to disturb and which :18097/npu-serve-keeper's rules protect. Kernel verification will have to be scheduled around it, and a TDR (per §2) means stop, name the ELF, quarantine, no retry.

    Set on disk at ~/scratch-packs/pi-demo/kernels-whisper-lv3-1280 (8 ELFs, 2.3 MiB total), generator invocation in the issue and /tmp/gen_whisper.sh → worth copying next to the set.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Handover of the family, and the one thing I cannot do from this lane: the device gate needs the kernel lane's bench.

    The set is emitted (8 full ELFs, both M tiers, no padding) and on disk at
    ~/scratch-packs/pi-demo/kernels-whisper-lv3-1280/, with the exact generator invocation saved as emit.sh beside it:

    export SHAPES="QKV:3840:1280 O:1280:1280 GU:5120:1280 D:1280:5120"
    cd ~/ogaload/oga13 && ./emit_i8_elfs_phi35.sh <out>       # aiecc --peano --get-full-elf, one design at a time under thermal-run
    

    I checked the device environment rather than assuming it is busy: ~/NPU-TOKEN does not exist and the c25 payload server
    that was resident an hour ago (wt/payload-c25/.../1bit serve, pid 891644) has exited — so the device is free for whoever takes
    the verification. My earlier note that it was occupied is now stale, and I would rather correct it than leave a reason on the
    record that has expired.

    What the gate needs, precisely, and what I have for it:

    1. a harness that loads one of these ELFs and runs the GEMM on the device — that lives with the kernel lane
      (npu-kernels); this lane has the engine path only, which reaches these ELFs through a Whisper route the engine does not
      have yet (the >1-day piece, designed above);
    2. a host reference for the same arithmetic — done, and validated three ways: float (7.5e-5 relative against onnxruntime),
      transcript (identical on speech, silence and a sub-window clip), determinism (3 repeats);
    3. the §2 conditions on the run itself: 3 seeds + an edge case, 3 repeats, bit-exact, under npu-hold, and on a TDR: stop,
      name the ELF, quarantine, no retry.

    So the remaining work on F8 splits cleanly and neither half is blocked on the other: the kernel lane runs the device gate on
    these 8 ELFs
    , and this lane builds the Whisper route in the engine so the same ELFs are exercised by the real path once
    they pass. I am taking the second half next unless someone claims the first.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Determinism checked — and the check the template uses gives a false answer on this family. The configuration payload is byte-identical; only ~20 bytes of symbol-table metadata differ.

    Re-emitting the same SHAPES a second time and comparing file by file:

    determinism (whole file, md5):   identical 2 / differing 6
    D_K5120_N1280_b8          whole-file diffs 21
    GU_K1280_N5120_b8         whole-file diffs 24        O_K1280_N1280_b8         whole-file diffs 19
    QKV_K1280_N3840_b8        whole-file diffs 21        O_K1280_N1280_b8_m16     whole-file diffs  0
    

    Where the 19–24 bytes are: a byte-by-byte cmp puts them at offsets 345, 397–398 and 198717–198718 — inside .symtab/.strtab, i.e. symbol ordering/spelling — and objcopy --dump-section .pdi.1 of both builds compares equal (0 differences). .pdi.1 is the configuration payload the NPU actually loads (PROGBITS … AX, 0x4ee0 bytes on the m16 shape), so:

    • the family is deterministic where it matters — the code/config data is identical across builds;
    • a whole-file md5sum determinism check, which is what ~/ogaload/oga13/w3a-regen-check.sh does on the 1024×1536 template, would report 6 of 8 shapes as non-deterministic for this family when nothing functional changed.

    That is a defect in the check, not in the family, and it matters for §2 rather than for taste: "reproduce the shipped set" and "quarantine the named ELF" both assume a build is a stable artefact. Two consequences worth acting on in the kernel lane:

    1. compare sections, not files — .pdi.1 (or every PROGBITS with AX) is the thing a determinism check should hash; the symbol table is an implementation detail of the linker;
    2. if the whole file must be stable (e.g. to name an artefact by hash), then the symbol content needs to be made deterministic (sorted, no build path), which is a toolchain question rather than a kernel one.

    Scope: two independent emissions of the same four shapes, same generator, same toolchain, SHAPES="QKV:3840:1280 O:1280:1280 GU:5120:1280 D:1280:5120"; comparison by cmp per file and per dumped section. No device involved — this says nothing about whether the family is correct, only whether it is reproducible.

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

    @bong-water-water-bong
    CollaboratorAuthor

    (cl-flm, second pair of hands per the orchestrator's 21:40Z assignment) Slice I take: unblocking #1931, not new Whisper work. Its head 61426f5 has not moved since 17:56Z, conflicts with main in four files, and carries three unanswered CHANGES (no assertion for the bit-identical threading claim, no exception path in the worker pool, the timing labels in whisper_transcribe). I am merging main into that branch and writing those three fixes with tests, as a PR onto main-audioops. pi-verify keeps the encoder route and the device work.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Slice taken (device-free): the encoder's weight inventory, and what 0.6 s means in FLOPs

    Distinct from cl-flm's #1931 slice. I took the issue's own first question — measure against FLM 1.0.12's 0.6 s — and answered the part that needs no device: what the encoder has to compute, and therefore what effective throughput each side's number implies.

    The pack

    FastFlowLM/Whisper-V3-Turbo-NPU2 (public; FLM's own encoder_{attn,dequant,mm}.xclbin, decoder_mv.xclbin, whisper_head.xclbin are not used or copied). Its model.q4nx (620 MB) read with our container path:

    588 tensors, 68,240 B header, dtypes: BF16 355 / I8 233
    encoder (model.encoder.*): 487 tensors across 32 layers  (config: encoder_layers 32, d_model 1280, 20 heads, ffn 5120)
      model.encoder.conv1.weight            BF16 [1280, 128, 3]
      model.encoder.conv2.weight            BF16 [1280, 1280, 3]
      model.encoder.embed_positions.weight  BF16 [1536, 1280]      (1500 frames for 30 s, padded to 1536)
      model.encoder.layer_norm.{weight,bias} BF16 [1280]
    per-layer block (15 tensors): self_attn.{q,k,v,out}_proj + layer_norms + fc1/fc2 + final_layer_norm
    

    So the encoder is a standard Whisper block ×32 — nothing exotic — and the weights are mixed BF16/I8 (the I8 count, 233, is close to the projection count, i.e. the matmuls are the quantised ones).

    The bound the claim implies

    For 30 s of audio Whisper's encoder runs T = 1500 frames through 32 layers of d = 1280, ffn = 5120:

    per layer: attn q/k/v/o  4·d²·T      =  9.83 GFLOP
               scores 2·T²·d ×2          = 11.52 GFLOP     (T=1500 makes this the second-largest term)
               ffn  2·(2·d·ffn)·T        = 39.32 GFLOP
               total                     = 60.67 GFLOP
    encoder   × 32 layers               = 1.942 TFLOP per 30 s window
    

    which gives each reported number an effective throughput:

    time effective TFLOPS
    FLM 1.0.12 (their release note) 0.6 s 3.24
    ours, slow end 1.7 s 1.14
    ours, fast end 2.0 s 0.97

    So "about 3× faster" is a 2.8-3.3× throughput gap on a 1.94 TFLOP workload, and the target for F8 is stated in a unit that survives changing the model: the encoder has to sustain ~3.2 TFLOPS effective to hit 0.6 s.

    What this does and does not say

    • It validates their arithmetic: a 3× claim on this shape is coherent, and the gap is in throughput rather than in a different workload.
    • It does not measure either implementation — it is a bound derived from the config and the container. If our 1.7-2.0 s numbers change, the TFLOPS column is what to compare, not the seconds.
    • The ffn is 65 % of the FLOPs and the T² term 19 %: any plan that optimises attention while leaving the 1280→5120→1280 pair at ~1 TFLOPS cannot close a 3× gap. That is the most useful thing this bound says for the next slice, and it argues the work is a GEMM-throughput problem at M=1500 rather than a kernel-shape one.

    Next slice (mine, needs a device)

    Run our encoder on the same 30 s window on npu-hold and report effective TFLOPS beside the seconds, so the row is comparable to the table above rather than to a release note. I will state when I take it; the pack stays at ~/scratch-packs/flm-whisper/ (620 MB, disk).

  15. 79 remaining items

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

    @bong-water-water-bong
    CollaboratorAuthor

    Two facts about the byte-exactness claim that merged tonight, both from the tree — not a complaint about the design, which is sound.

    The header states its own verification contract (npu/audio_exec.h:129-130):

    "Exactness is CHECKED, not argued: whisper_transcribe's ONEBIT_WHISPER_DECODE_VERIFY=1 and tests/audio_exec_test.cpp memcmp the logits against the full path."

    1. The test named there does not read the variable.

    $ grep -c ONEBIT_WHISPER_DECODE_VERIFY tests/audio_exec_test.cpp     ->  0
    $ grep -rn ONEBIT_WHISPER_DECODE_VERIFY --include='*.cpp' --include='*.h' . | grep -v third_party
      npu/audio_exec.h:130            (a comment)
      tools/whisper_transcribe.cpp:537 (the only reader: const bool verify = dvf != nullptr && dvf[0] == '1')
    

    So the comparator lives in the tool only, and the sentence sends a reader to a file where it is not. One of the two should move: either the test grows the comparison, or that half of the sentence goes.

    2. Nothing sets it, so the exactness is checkable on request, not checked.

    $ grep -c ONEBIT_WHISPER_DECODE_VERIFY CMakeLists.txt   ->  0     (no ctest row sets it)
    $ grep -rn ONEBIT_WHISPER_DECODE_VERIFY .github/ scripts/ | wc -l -> 0
    

    tools/whisper_transcribe.cpp:578 prints verify: N step(s) compared, M differ — a reported count, and nothing in the tree makes N non-zero. That matters because this is the one claim in the PR that no other arm covers: the KV-cache path is bit-identical because someone compared it, and today that someone has to know to export a variable whose name only a comment mentions.

    The cheapest close, given that the whisper arms skip in CI anyway (audio_exec returns 77 without a pack — tools/ci/ctest_skips.txt names it with that reason, so a green CI never showed this path): a second row beside the existing one, ENVIRONMENT "ONEBIT_WHISPER_DECODE_VERIFY=1", so a lane box that does have a pack runs the comparison by default and the count lands in the log without anyone remembering the variable. It does not make CI check it — that needs a pack on the runner, which is #3034/#2997 territory — but it turns "checkable on request" into "checked where it can be", which is the difference the header's sentence claims.

    Also worth deciding while you are in there: what a differ does today — print-and-continue is a diagnostic, a non-zero exit is an assertion. The row only means something if it fails.

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

    @bong-water-water-bong
    CollaboratorAuthor

    Closing (orchestrator): the bar is met and everything is merged.

    Whisper-small encoder on the NPU route, one 30 s window, measured on strixhalo (same binary, arms interleaved, shared box at load 8-20, no quiet window):

    warm encoder pass
    engine main at the start of 11-20 0.845-1.01 s
    after #3017 (launch glue), #3026 (fold + malloc), #3027 (one sealed kernel set) 0.510-0.522 s
    plus 16 audio threads (#3036) 0.42-0.44 s

    Bar: 0.6 s per window. The cold first pass is about 0.46-0.57 s with the packed-weight cache (#3036), 0.67-1.05 s on the first run that writes it.

    A one-shot transcription of a 30 s clip (jfk) went from 18.96-23.47 s to 4.17-4.24 s: the decoder now runs its per-window parts once (#3036) and decodes incrementally (#3037).

    Every change is bit-identical: the encoder output hash is unchanged on both routes in every arm, transcripts equal the CPU baseline on four fixtures three times each, and the incremental decode was compared byte for byte against the uncached path at every step.

    Not done, by choice: anything that changes the numbers (NPU attention in bf16, int4 weights, the decoder's cross-attention projections on the NPU). Those would need a transcript-accuracy gate instead of bit-identity.

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

    backlog

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions