sanmonga22 commited on
Commit
960c084
Β·
verified Β·
1 Parent(s): 780026f

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +54 -23
README.md CHANGED
@@ -12,18 +12,60 @@ language:
12
  pipeline_tag: automatic-speech-recognition
13
  ---
14
 
15
- # whisper-small β€” QHexRT NPU bundle (Hexagon v79)
16
 
17
- Precompiled **Whisper-small** ASR for the **QHexRT** runtime on Qualcomm Hexagon **v79**
18
- (Snapdragon 8 Elite / SM8750, e.g. Galaxy S25). More accurate than
19
- [whisper-base](https://huggingface.co/runanywhere/whisper_base_HNPU) at ~3Γ— the size and ~1.3Γ—
20
- slower decode (still comfortably real-time). Encoder + decoder are Qualcomm AI Hub
21
- `qnn_context_binary` (float/fp16) graphs; the host pipeline is QHexRT's own. Device-validated:
22
- transcription matches the HF `openai/whisper-small` reference exactly.
23
 
24
- Measured on S25/v79: 718 ms for 2.67 s of audio (β‰ˆ3.7Γ— real-time) vs base's 546 ms (β‰ˆ5Γ—).
 
 
 
25
 
26
- ## Contents (`v79/`)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  | file | what |
28
  |------|------|
29
  | `whisper-small.json` | QHexRT manifest (ASR family, `asr_transcribe` plan; 12 layers, d_model 768) |
@@ -32,18 +74,7 @@ Measured on S25/v79: 718 ms for 2.67 s of audio (β‰ˆ3.7Γ— real-time) vs base's 5
32
  | `whisper_mel_filters.bin` | HF 80-mel filter bank `[201,80]` f32 (shared across whisper sizes) |
33
  | `tokenizer.json` | Whisper multilingual tokenizer (vocab 51865, shared) |
34
 
35
- ## Run (QHexRT CLI)
36
- ```bash
37
- huggingface-cli download runanywhere/whisper_small_HNPU --local-dir whisper_small_HNPU
38
- # QNN libs come from the QAIRT SDK (lib/aarch64-android) + the v79 HTP skel; push them next to qhx_asr.
39
- adb push whisper_small_HNPU/v79 /data/local/tmp/wq/whisper_small
40
- adb shell "cd /data/local/tmp/wq && LD_LIBRARY_PATH=. ADSP_LIBRARY_PATH=. \
41
- ./qhx_asr whisper_small/whisper-small.json libQnnHtp.so libQnnSystem.so whisper_small whisper_small/<audio16k>.wav"
42
- ```
43
- Audio: mono WAV (PCM16 or float32); resampled to 16 kHz host-side. Clips ≀ 30 s.
44
 
45
- ## Notes
46
- - Arch: **v79** only (context binaries are dsp-arch-pinned).
47
- - No custom op-package needed β€” pure-native AI Hub graphs.
48
- - The QHexRT `asr_transcribe` orchestrator is size-agnostic; base/small/tiny differ only in these bins + manifest dims.
49
- - Source model: `openai/whisper-small`, compiled via Qualcomm AI Hub for `qualcomm-snapdragon-8-elite-for-galaxy`.
 
12
  pipeline_tag: automatic-speech-recognition
13
  ---
14
 
15
+ # whisper-small β€” QHexRT NPU bundle (Hexagon v79 + v81)
16
 
17
+ Precompiled **Whisper-small** ASR (12 layers, d_model 768) for the **QHexRT** runtime on the Qualcomm Hexagon
18
+ NPU. Two arch-pinned bundles ship as sibling dirs:
 
 
 
 
19
 
20
+ | dir | Hexagon arch | device | encoder path | device-validated |
21
+ |-----|--------------|--------|--------------|------------------|
22
+ | `v79/` | v79 (SM8750, Galaxy S25) | Snapdragon 8 Elite | AI-Hub **in-graph** conv | βœ… transcript == HF |
23
+ | `v81/` | v81 (SM8850, soc 87) | Snapdragon 8 Elite Gen 5 | **forge host-conv** (`encoder_features`) | βœ… **WER 0** |
24
 
25
+ A context binary won't load on another arch (`soc_model` + `dsp_arch` baked in). The same `qhx_asr` runs both
26
+ bundles (it branches on the encoder input). The `asr_transcribe` orchestrator is size-agnostic β€” base/small
27
+ differ only in these bins + the manifest dims.
28
+
29
+ ---
30
+
31
+ ## `v81/` β€” Hexagon v81 (SM8850), compiled with **forge** (QAIRT 2.47)
32
+
33
+ Same host-conv decomposition as whisper-base (the HTP-hostile conv stem runs host-side from
34
+ `whisper_conv_stem.bin`; the encoder graph starts at post-conv `encoder_features [1500,768]`). fp16 encoder +
35
+ decoder. This bundle is a **new forge port** β€” the spec (`recipes/whisper-small`) is generated from the same
36
+ exporter that produced the validated whisper-base v81, then device-gated on hardware.
37
+
38
+ ### Files (`v81/`)
39
+ | file | role |
40
+ |------|------|
41
+ | `whisper-small.json` | QHexRT manifest (`asr_transcribe` plan; 12 layers / d768 / 12 heads) |
42
+ | `whispersmall_enc_f16.bin` | encoder (post-conv `encoder_features` β†’ per-layer cross-attn K/V) |
43
+ | `whispersmall_dec_f16.bin` | autoregressive decoder (self+cross attn, in-graph int32 embed + tied lm-head) |
44
+ | `whisper_conv_stem.bin` | host-side conv-stem weights `[c1w,c1b,c2w,c2b,pos]` |
45
+ | `whisper_small_mel_filters.bin` | HF 80-mel filter bank (host log-mel) |
46
+ | `tokenizer.json` | Whisper tokenizer (vocab 51865) |
47
+
48
+ ### Run (`v81/`)
49
+ ```bash
50
+ huggingface-cli download runanywhere/whisper_small_HNPU --local-dir whisper_small_HNPU
51
+ adb push whisper_small_HNPU/v81 /data/local/tmp/wq/whisper_small # QNN libs + v81 HTP skel from the QAIRT SDK
52
+ adb shell "cd /data/local/tmp/wq && LD_LIBRARY_PATH=. ADSP_LIBRARY_PATH=. \
53
+ ./qhx_asr whisper_small/whisper-small.json libQnnHtp.so libQnnSystem.so whisper_small whisper_small/<audio16k>.wav"
54
+ ```
55
+
56
+ ### Measured (SM8850 / v81, soc 87, QAIRT 2.47)
57
+ - **WER = 0** vs HF `openai/whisper-small` on a clean LibriSpeech clip *and* a 23 s clip (decode runs the full
58
+ length). Encoder cross-KV cosine **1.00000**, decoder 12/12 teacher-forced + greedy chain MATCH (export gate).
59
+
60
+ ---
61
+
62
+ ## `v79/` β€” Hexagon v79 (SM8750, Galaxy S25), Qualcomm AI Hub graphs
63
+
64
+ Encoder + decoder are Qualcomm AI Hub `qnn_context_binary` (float/fp16) graphs; the host pipeline is QHexRT's
65
+ own. Device-validated: transcription matches the HF `openai/whisper-small` reference exactly. Measured on
66
+ S25/v79: 718 ms for 2.67 s of audio (β‰ˆ3.7Γ— real-time).
67
+
68
+ ### Files (`v79/`)
69
  | file | what |
70
  |------|------|
71
  | `whisper-small.json` | QHexRT manifest (ASR family, `asr_transcribe` plan; 12 layers, d_model 768) |
 
74
  | `whisper_mel_filters.bin` | HF 80-mel filter bank `[201,80]` f32 (shared across whisper sizes) |
75
  | `tokenizer.json` | Whisper multilingual tokenizer (vocab 51865, shared) |
76
 
77
+ Audio: mono WAV (PCM16 or float32); resampled to 16 kHz host-side. Clips ≀ 30 s. No custom op-package needed.
78
+ Source model: `openai/whisper-small`.
 
 
 
 
 
 
 
79
 
80
+ _v81 bundle built + device-validated with [QHexRT](https://github.com/RunanywhereAI/QHexRT) `forge` β€” `recipes/whisper-small`._