Add v81 (forge host-conv, WER 0) + README v81 section
#1
by sanmonga22 - opened
- README.md +48 -4
- v81/tokenizer.json +0 -0
- v81/whisper-base.json +46 -0
- v81/whisper_base_mel_filters.bin +3 -0
- v81/whisper_conv_stem.bin +3 -0
- v81/whisperbase_dec_f16.bin +3 -0
- v81/whisperbase_enc_f16.bin +3 -0
README.md
CHANGED
|
@@ -12,14 +12,58 @@ language:
|
|
| 12 |
pipeline_tag: automatic-speech-recognition
|
| 13 |
---
|
| 14 |
|
| 15 |
-
# whisper-base — QHexRT NPU bundle (Hexagon v79)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
Precompiled **Whisper-base** ASR for the **QHexRT** runtime on Qualcomm Hexagon **v79**
|
| 18 |
(Snapdragon 8 Elite / SM8750, e.g. Galaxy S25). Encoder + decoder are Qualcomm AI Hub
|
| 19 |
`qnn_context_binary` (float/fp16) graphs; the host pipeline (log-mel, decode loop, detok) is QHexRT's
|
| 20 |
own. Device-validated: transcription matches the HF `openai/whisper-base` reference exactly.
|
| 21 |
|
| 22 |
-
## Contents (`v79/`)
|
| 23 |
| file | what |
|
| 24 |
|------|------|
|
| 25 |
| `whisper-base.json` | QHexRT manifest (ASR family, `asr_transcribe` plan) |
|
|
@@ -28,7 +72,7 @@ own. Device-validated: transcription matches the HF `openai/whisper-base` refere
|
|
| 28 |
| `whisper_base_mel_filters.bin` | HF mel filter bank `[201,80]` f32 (host log-mel) |
|
| 29 |
| `tokenizer.json` | Whisper multilingual tokenizer (vocab 51865) |
|
| 30 |
|
| 31 |
-
## Run (QHexRT CLI)
|
| 32 |
```bash
|
| 33 |
huggingface-cli download runanywhere/whisper_base_HNPU --local-dir whisper_base_HNPU
|
| 34 |
# QNN libs come from the QAIRT SDK (lib/aarch64-android) + the v79 HTP skel; push them next to qhx_asr.
|
|
@@ -39,7 +83,7 @@ adb shell "cd /data/local/tmp/wq && LD_LIBRARY_PATH=. ADSP_LIBRARY_PATH=. \
|
|
| 39 |
```
|
| 40 |
Audio: mono WAV (PCM16 or float32); resampled to 16 kHz host-side. Clips ≤ 30 s.
|
| 41 |
|
| 42 |
-
## Notes
|
| 43 |
- Arch: **v79** only (context binaries are dsp-arch-pinned). Other arches = re-export from AI Hub.
|
| 44 |
- No custom op-package needed — these are pure-native AI Hub graphs.
|
| 45 |
- Source model: `openai/whisper-base`, compiled via Qualcomm AI Hub for `qualcomm-snapdragon-8-elite-for-galaxy`.
|
|
|
|
| 12 |
pipeline_tag: automatic-speech-recognition
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# whisper-base — QHexRT NPU bundle (Hexagon v79 + v81)
|
| 16 |
+
|
| 17 |
+
Precompiled **Whisper-base** ASR for the **QHexRT** runtime on Qualcomm Hexagon. Two arch-pinned bundles in
|
| 18 |
+
this repo (the host pipeline — log-mel feature extraction, the decode loop, detok — is QHexRT's own; the
|
| 19 |
+
encoder + decoder are prepared QNN context binaries):
|
| 20 |
+
|
| 21 |
+
| arch | dir | device | source | status |
|
| 22 |
+
|------|-----|--------|--------|--------|
|
| 23 |
+
| **v81** | `v81/` | SM8850 / Snapdragon 8 Elite (e.g. Galaxy S26) | forge (host-conv) | **device-validated — WER 0** vs HF |
|
| 24 |
+
| **v79** | `v79/` | SM8750 / Snapdragon 8 Elite (e.g. Galaxy S25) | Qualcomm AI Hub | device-validated — matches HF |
|
| 25 |
+
|
| 26 |
+
## v81 (`v81/`) — forge host-conv bundle
|
| 27 |
+
|
| 28 |
+
Device-validated on **SM8850 / v81** (QAIRT 2.47): `qhx_asr` transcribes a LibriSpeech clip →
|
| 29 |
+
*"Mr. Quilter is the apostle of the middle classes, and we are glad to welcome his gospel."* — token-for-token
|
| 30 |
+
equal to the HF `openai/whisper-base` reference (**WER 0**), 27 tokens in **~1.4 s**; on-device encoder
|
| 31 |
+
cross-KV cosine **0.99995** vs host.
|
| 32 |
+
|
| 33 |
+
The encoder graph starts at **post-conv features**: the two conv1d+GELU stem layers are HTP-hostile in-graph
|
| 34 |
+
(they collapse the transcript to empty), so they run **on the host** in `asr_transcribe` from the baked
|
| 35 |
+
`whisper_conv_stem.bin`. Per-stage on-device localization proved the rest of the encoder is bit-precise on v81.
|
| 36 |
+
|
| 37 |
+
| file | what |
|
| 38 |
+
|------|------|
|
| 39 |
+
| `whisper-base.json` | QHexRT manifest (ASR family, `asr_transcribe` plan; `conv_weights` + `n_mels`) |
|
| 40 |
+
| `whisperbase_enc_f16.bin` | encoder context binary — **post-conv** features → per-layer cross-attn KV |
|
| 41 |
+
| `whisperbase_dec_f16.bin` | autoregressive decoder (causal self-attn + cross-attn, in-graph int32 embed + tied lm-head) |
|
| 42 |
+
| `whisper_conv_stem.bin` | host-side conv-stem weights `[c1w,c1b,c2w,c2b,pos]` (the host computes the conv) |
|
| 43 |
+
| `whisper_base_mel_filters.bin` | log-mel filterbank `[201,80]` (host feature extraction) |
|
| 44 |
+
| `tokenizer.json` | Whisper multilingual tokenizer (vocab 51865) |
|
| 45 |
+
|
| 46 |
+
```bash
|
| 47 |
+
hf download runanywhere/whisper_base_HNPU --include "v81/*" --local-dir whisper_base_HNPU
|
| 48 |
+
D=/data/local/tmp/whisper && adb push whisper_base_HNPU/v81/* $D/
|
| 49 |
+
# + the QAIRT 2.47 aarch64 libs (libQnnHtp.so, libQnnSystem.so) + the v81 HTP skel + qhx_asr into $D
|
| 50 |
+
adb shell "cd $D && export ADSP_LIBRARY_PATH='$D;/vendor/dsp/cdsp'; LD_LIBRARY_PATH=. \
|
| 51 |
+
./qhx_asr whisper-base.json libQnnHtp.so libQnnSystem.so . <audio16k>.wav"
|
| 52 |
+
# -> TRANSCRIPT: ...
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
> **Runtime caveat (v81):** this bundle needs a `qhx_asr` **built from the forge QHexRT** (the host-side-conv
|
| 56 |
+
> `asr_transcribe`). That host-op branches on the encoder input — `encoder_features` → host conv (this bundle);
|
| 57 |
+
> `input_features` → the AI-Hub in-graph-conv path — so the **same `qhx_asr` also runs the v79 bundle below**.
|
| 58 |
+
|
| 59 |
+
## v79 (`v79/`) — Qualcomm AI Hub bundle
|
| 60 |
|
| 61 |
Precompiled **Whisper-base** ASR for the **QHexRT** runtime on Qualcomm Hexagon **v79**
|
| 62 |
(Snapdragon 8 Elite / SM8750, e.g. Galaxy S25). Encoder + decoder are Qualcomm AI Hub
|
| 63 |
`qnn_context_binary` (float/fp16) graphs; the host pipeline (log-mel, decode loop, detok) is QHexRT's
|
| 64 |
own. Device-validated: transcription matches the HF `openai/whisper-base` reference exactly.
|
| 65 |
|
| 66 |
+
### Contents (`v79/`)
|
| 67 |
| file | what |
|
| 68 |
|------|------|
|
| 69 |
| `whisper-base.json` | QHexRT manifest (ASR family, `asr_transcribe` plan) |
|
|
|
|
| 72 |
| `whisper_base_mel_filters.bin` | HF mel filter bank `[201,80]` f32 (host log-mel) |
|
| 73 |
| `tokenizer.json` | Whisper multilingual tokenizer (vocab 51865) |
|
| 74 |
|
| 75 |
+
### Run (QHexRT CLI)
|
| 76 |
```bash
|
| 77 |
huggingface-cli download runanywhere/whisper_base_HNPU --local-dir whisper_base_HNPU
|
| 78 |
# QNN libs come from the QAIRT SDK (lib/aarch64-android) + the v79 HTP skel; push them next to qhx_asr.
|
|
|
|
| 83 |
```
|
| 84 |
Audio: mono WAV (PCM16 or float32); resampled to 16 kHz host-side. Clips ≤ 30 s.
|
| 85 |
|
| 86 |
+
### Notes
|
| 87 |
- Arch: **v79** only (context binaries are dsp-arch-pinned). Other arches = re-export from AI Hub.
|
| 88 |
- No custom op-package needed — these are pure-native AI Hub graphs.
|
| 89 |
- Source model: `openai/whisper-base`, compiled via Qualcomm AI Hub for `qualcomm-snapdragon-8-elite-for-galaxy`.
|
v81/tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
v81/whisper-base.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"schema_version": 1,
|
| 3 |
+
"_comment": "Whisper-base ASR (encoder-decoder). Host log-mel feature extraction feeds the encoder graph; the autoregressive decoder (causal self-attention + cross-attention to the cached encoder states, learned positional embeddings, tied lm-head) emits tokens, detok'd on the host. Gated on WER vs HF Whisper.",
|
| 4 |
+
"model": {
|
| 5 |
+
"name": "whisper-base",
|
| 6 |
+
"family": "asr",
|
| 7 |
+
"dsp_arch": "v81",
|
| 8 |
+
"tokenizer_pre": "whisper"
|
| 9 |
+
},
|
| 10 |
+
"params": {
|
| 11 |
+
"hidden": 512,
|
| 12 |
+
"vocab": 51865,
|
| 13 |
+
"n_layers": 6,
|
| 14 |
+
"max_ctx": 200,
|
| 15 |
+
"kv_dim": 512,
|
| 16 |
+
"head_dim": 64,
|
| 17 |
+
"rope_theta": 10000.0,
|
| 18 |
+
"eos_token_id": 50257
|
| 19 |
+
},
|
| 20 |
+
"artifacts": {
|
| 21 |
+
"contexts": {
|
| 22 |
+
"encoder": {
|
| 23 |
+
"bin": "whisperbase_enc_f16.bin"
|
| 24 |
+
},
|
| 25 |
+
"decoder": {
|
| 26 |
+
"bin": "whisperbase_dec_f16.bin"
|
| 27 |
+
}
|
| 28 |
+
},
|
| 29 |
+
"tokenizer": "tokenizer.json"
|
| 30 |
+
},
|
| 31 |
+
"plan": {
|
| 32 |
+
"steps": [
|
| 33 |
+
{
|
| 34 |
+
"host": "asr_transcribe",
|
| 35 |
+
"params": {
|
| 36 |
+
"encoder": "whisperbase_enc_f16",
|
| 37 |
+
"decoder": "whisperbase_dec_f16",
|
| 38 |
+
"sot": 50258,
|
| 39 |
+
"mel_filters": "whisper_base_mel_filters.bin",
|
| 40 |
+
"conv_weights": "whisper_conv_stem.bin",
|
| 41 |
+
"n_mels": 80
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
]
|
| 45 |
+
}
|
| 46 |
+
}
|
v81/whisper_base_mel_filters.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:039ce818842793b3547f84ca19dbf32488538b14016d3cb259342ed6667903c4
|
| 3 |
+
size 64320
|
v81/whisper_conv_stem.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ab32f7839de3b8db4e4eed32b743f774fce82b00b0a2a414708272a0971a2f26
|
| 3 |
+
size 6713344
|
v81/whisperbase_dec_f16.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4e5aa7eeeb643978e7017fb4dcc962b65cf1cf648858da2deed2a8a927e93f94
|
| 3 |
+
size 152477696
|
v81/whisperbase_enc_f16.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c0c2fb3aea60453149125b636690930578c5767408c3c593ae52a748b3a38d9f
|
| 3 |
+
size 58335232
|