wav2vec2-keyword-spotting-OpenVINO

wav2vec2-keyword-spotting for Intel NPUs, GPUs and CPUs: w2v2_frontend_fp16 and w2v2_head_fp16 from litert-community/wav2vec2-keyword-spotting as ONNX (tf2onnx 1.17.0, opset 17), OpenVINO IR with fp32 weights, and precompiled Intel NPU blobs. tf2onnx 1.17.0 drops the bias of 24 FULLY_CONNECTED layers of w2v2_head_fp16; these files were converted with a one-line fix of that handler (convert/patch_tf2onnx.py in the GitHub repo), and their outputs match the .tflite. On the NPU of a Core Ultra 9 386H the blob runs in 7.53 ms (w2v2_frontend_fp16) and 6.87 ms (w2v2_head_fp16) per run, numpy input to numpy output.

Scripts, raw records, and the same table for all 52 graphs of LiteRT-Models: https://github.com/john-rocky/windows-zoo

Files

file bytes sha256
w2v2_frontend_fp16.onnx 18,478,369 51645678a786b40dad1834d998943b95488858f5181b4cdf5f8822db6095ce63
openvino/w2v2_frontend_fp16.xml 183,708 ccdf923947def70198df847a6ed07ded583f5e40e22304c2d34f3fad8e9c3ed5
openvino/w2v2_frontend_fp16.bin 18,380,412 3a3d7d02bf8b3f25865e4b8133da47b9867b57a6ed7b667e35a39241876ae6e3
npu/w2v2_frontend_fp16.blob 11,481,217 394cbec179b17382b55ffc121763824a04c765e5a1235791acdd79d60e7ec5af
w2v2_head_fp16.onnx 360,612,481 daadaee04b8b8f5ce8cc0038e05561cec8e5b0df27f81d55254f43823d6633d7
openvino/w2v2_head_fp16.xml 1,158,918 f54cbcf27bb4c68f79217d2fded2a1fdc2ba80994b22772e7133faae2924831a
openvino/w2v2_head_fp16.bin 359,904,956 19dc678653b957a5e85736287231ec7160c7329ec54f0224ddfc5526c534103b
npu/w2v2_head_fp16.blob 188,002,433 a3f9872809bbb7e22c4630aac2946e0bd721e51af3ab6d03757044eba1cd069b

The NPU blobs were compiled with OpenVINO 2026.4.1, Intel NPU driver 32.0.100.4841 (OpenVINO reports NPU_DRIVER_VERSION 1004841, NPU_COMPILER_VERSION 524292). If import_model refuses a blob on another driver or OpenVINO version, compile the IR instead (the commented line in the snippet).

How it was measured

MSI Stealth 16 AI+ (Core Ultra 9 386H, RTX 5080 Laptop GPU at a 95 W power limit, Windows 11 build 26200.9711, on AC power), 2026-11-06 to 2026-11-07. On the laptop, each row is one process: load, one run, 5 warmup runs, then the median of 30 timed runs (2 warmup + 10 timed runs when the first run takes more than 3 s), numpy input to numpy output, every runtime at its default settings, one process at a time, each started after the CPU, the RTX and the Intel GPU had gone idle (the thresholds are in METHOD.md of the GitHub repo). Output check: each output against the CPU output in fp32 on the same input (ONNX Runtime's CPU EP); PASS = cosine ≥ 0.99, no NaN or Inf, and top-1 agreement ≥ 0.99 for class scores. The Snapdragon rows are Qualcomm AI Hub profile jobs of the same ONNX files (their own timer). No Snapdragon rows for w2v2_head_fp16: Qualcomm AI Hub measured the file before the bias fix (its numbers are in the GitHub table).

w2v2_frontend_fp16

processor runtime file ms load s output check
Intel AI Boost NPU OpenVINO 2026.4.1 npu/ blob (import_model) 7.53 0.01 FAIL: output_0_output: cos 0.8997 < 0.99
Intel AI Boost NPU ONNX Runtime 1.31.1 + OpenVINO EP 1.8.1 .onnx, compiled when the session loads 9.61 1.82 FAIL: output_0_output: cos 0.8999 < 0.99
Intel Graphics (iGPU) ONNX Runtime 1.31.1 + OpenVINO EP 1.8.1 .onnx 4.26 0.35 PASS (cos ≥ 0.9999)
RTX 5080 Laptop (95 W limit) ONNX Runtime 1.31.1, CUDA EP fp16 copy of the .onnx (not in this repo) 1.51 1.13 PASS (cos ≥ 0.9999)
RTX 5080 Laptop (95 W limit) ONNX Runtime 1.31.1, CUDA EP .onnx 2.24 1.05 PASS (cos ≥ 0.9999)
Core Ultra 9 386H CPU ONNX Runtime 1.31.1, CPU EP .onnx 12.05 0.05 reference
Snapdragon X2 Elite NPU Qualcomm AI Hub, precompiled QNN ONNX .onnx compiled by AI Hub 11.32 0.37 not compared (AI Hub profile job, 2026-10-30)
Snapdragon X2 Elite NPU Qualcomm AI Hub, ONNX Runtime QNN EP .onnx, compiled when it loads 13.61 7.60 not compared (AI Hub profile job, 2026-10-30)
Galaxy S26 NPU Qualcomm AI Hub, precompiled QNN ONNX .onnx compiled by AI Hub 11.94 0.17 not compared (AI Hub profile job, 2026-10-30)

The ONNX file against the source .tflite (LiteRT interpreter on the CPU, the same input): PASS, cosine ≥ 0.9999 for every output.

w2v2_head_fp16

processor runtime file ms load s output check
Intel AI Boost NPU OpenVINO 2026.4.1 npu/ blob (import_model) 6.87 0.11 PASS (cos ≥ 0.9999)
Intel AI Boost NPU ONNX Runtime 1.31.1 + OpenVINO EP 1.8.1 .onnx, compiled when the session loads 7.27 19.44 PASS (cos ≥ 0.9999)
Intel Graphics (iGPU) ONNX Runtime 1.31.1 + OpenVINO EP 1.8.1 .onnx 6.72 2.89 PASS (cos ≥ 0.9999)
RTX 5080 Laptop (95 W limit) ONNX Runtime 1.31.1, CUDA EP fp16 copy of the .onnx (not in this repo) 7.52 1.24 PASS (cos ≥ 0.9992)
RTX 5080 Laptop (95 W limit) ONNX Runtime 1.31.1, CUDA EP .onnx 8.59 1.35 PASS (cos ≥ 0.9999)
Core Ultra 9 386H CPU ONNX Runtime 1.31.1, CPU EP .onnx 17.71 0.47 reference

The ONNX file against the source .tflite (LiteRT interpreter on the CPU, the same input): PASS, cosine ≥ 0.9999 for every output.

Run it on the Intel NPU

Download this repo, then run the snippets from its folder:

pip install huggingface_hub
hf download mlboydaisuke/wav2vec2-keyword-spotting-OpenVINO --local-dir wav2vec2-keyword-spotting-OpenVINO
cd wav2vec2-keyword-spotting-OpenVINO

OpenVINO (pip install openvino==2026.4.1):

import numpy as np
import openvino as ov

core = ov.Core()
if "NPU" not in core.available_devices:
    raise SystemExit(f"no Intel NPU visible to OpenVINO: {core.available_devices}")
with open("npu/w2v2_frontend_fp16.blob", "rb") as f:
    compiled = core.import_model(f.read(), "NPU")  # precompiled: no compile at load
# or compile the IR on this machine: compiled = core.compile_model("openvino/w2v2_frontend_fp16.xml", "NPU")
# replace the zeros with your preprocessed input (float32, the shapes printed by compiled.inputs)
feeds = {i.get_any_name(): np.zeros(list(i.shape), np.float32) for i in compiled.inputs}
outputs = compiled(feeds)
print({o.get_any_name(): outputs[o].shape for o in compiled.outputs})

ONNX Runtime with the OpenVINO EP (pip install onnxruntime==1.31.1 onnxruntime-ep-openvino==1.8.1):

import numpy as np
import onnxruntime as ort
import onnxruntime_ep_openvino as ov_ep

ort.register_execution_provider_library(ov_ep.get_ep_name(), ov_ep.get_library_path())
npu = [d for d in ort.get_ep_devices()
       if d.ep_name == ov_ep.get_ep_name() and d.ep_metadata.get("ov_device") == "NPU"]
if not npu:
    raise SystemExit("no Intel NPU visible to the OpenVINO EP")
so = ort.SessionOptions()
so.add_provider_for_devices(npu, {})
sess = ort.InferenceSession("w2v2_frontend_fp16.onnx", sess_options=so)  # compiles for the NPU here
# replace the zeros with your preprocessed input (float32)
feeds = {i.name: np.zeros(i.shape, np.float32) for i in sess.get_inputs()}
outputs = sess.run(None, feeds)
print([o.shape for o in outputs])

The same lines run w2v2_head_fp16 with its own file names.

Branch windows-model-zoo

The branch windows-model-zoo adds the 2 files that windows-model-zoo runs. unfixed/: the conversion without the bias fix above, with its fp16 copy. To use the model, take main's files.

Licence

Apache-2.0, the licence of litert-community/wav2vec2-keyword-spotting. The upstream model: superb/wav2vec2-base-superb-ks.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for mlboydaisuke/wav2vec2-keyword-spotting-OpenVINO

Collection including mlboydaisuke/wav2vec2-keyword-spotting-OpenVINO