Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
@@ -38,48 +38,48 @@ More details on model performance across various devices, can be found
|
|
38 |
|
39 |
| Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
|
40 |
|---|---|---|---|---|---|---|---|---|
|
41 |
-
|
|
42 |
-
|
|
43 |
-
|
|
44 |
-
|
|
45 |
-
|
|
46 |
-
|
|
47 |
-
|
|
48 |
-
|
|
49 |
-
|
|
50 |
-
|
|
51 |
-
|
|
52 |
-
|
|
53 |
-
|
|
54 |
-
|
|
55 |
-
|
|
56 |
-
|
|
57 |
-
|
|
58 |
-
|
|
59 |
-
|
|
60 |
-
|
|
61 |
-
|
|
62 |
-
|
|
63 |
-
|
|
64 |
-
|
|
65 |
-
|
|
66 |
-
|
|
67 |
-
|
|
68 |
-
|
|
69 |
-
|
|
70 |
-
|
|
71 |
-
|
|
72 |
-
|
|
73 |
-
|
|
74 |
-
|
|
75 |
-
|
|
76 |
-
|
|
77 |
-
|
|
78 |
-
|
|
79 |
-
|
|
80 |
-
|
|
81 |
-
|
|
82 |
-
|
|
83 |
|
84 |
|
85 |
|
@@ -140,23 +140,23 @@ python -m qai_hub_models.models.whisper_tiny_en.export
|
|
140 |
```
|
141 |
```
|
142 |
Profiling Results
|
143 |
-
------------------------------------------------------------
|
144 |
-
WhisperEncoder
|
145 |
-
Device : Samsung Galaxy S23 (13)
|
146 |
-
Runtime : TFLITE
|
147 |
-
Estimated inference time (ms) : 102.5
|
148 |
-
Estimated peak memory usage (MB): [15, 102]
|
149 |
-
Total # Ops : 271
|
150 |
-
Compute Unit(s) : GPU (260 ops) CPU (11 ops)
|
151 |
-
|
152 |
------------------------------------------------------------
|
153 |
WhisperDecoder
|
154 |
Device : Samsung Galaxy S23 (13)
|
155 |
Runtime : TFLITE
|
156 |
Estimated inference time (ms) : 4.0
|
157 |
-
Estimated peak memory usage (MB): [3,
|
158 |
Total # Ops : 557
|
159 |
Compute Unit(s) : NPU (557 ops)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
```
|
161 |
|
162 |
|
@@ -179,42 +179,42 @@ from qai_hub_models.models.whisper_tiny_en import Model
|
|
179 |
|
180 |
# Load the model
|
181 |
model = Model.from_pretrained()
|
182 |
-
encoder_model = model.encoder
|
183 |
decoder_model = model.decoder
|
|
|
184 |
|
185 |
# Device
|
186 |
device = hub.Device("Samsung Galaxy S23")
|
187 |
|
188 |
# Trace model
|
189 |
-
|
190 |
-
|
191 |
|
192 |
-
|
193 |
|
194 |
# Compile model on a specific device
|
195 |
-
|
196 |
-
model=
|
197 |
device=device,
|
198 |
-
input_specs=
|
199 |
)
|
200 |
|
201 |
# Get target model to run on-device
|
202 |
-
|
203 |
# Trace model
|
204 |
-
|
205 |
-
|
206 |
|
207 |
-
|
208 |
|
209 |
# Compile model on a specific device
|
210 |
-
|
211 |
-
model=
|
212 |
device=device,
|
213 |
-
input_specs=
|
214 |
)
|
215 |
|
216 |
# Get target model to run on-device
|
217 |
-
|
218 |
|
219 |
```
|
220 |
|
@@ -226,14 +226,14 @@ After compiling models from step 1. Models can be profiled model on-device using
|
|
226 |
provisioned in the cloud. Once the job is submitted, you can navigate to a
|
227 |
provided job URL to view a variety of on-device performance metrics.
|
228 |
```python
|
229 |
-
encoder_profile_job = hub.submit_profile_job(
|
230 |
-
model=encoder_target_model,
|
231 |
-
device=device,
|
232 |
-
)
|
233 |
decoder_profile_job = hub.submit_profile_job(
|
234 |
model=decoder_target_model,
|
235 |
device=device,
|
236 |
)
|
|
|
|
|
|
|
|
|
237 |
|
238 |
```
|
239 |
|
@@ -242,13 +242,6 @@ Step 3: **Verify on-device accuracy**
|
|
242 |
To verify the accuracy of the model on-device, you can run on-device inference
|
243 |
on sample input data on the same cloud hosted device.
|
244 |
```python
|
245 |
-
encoder_input_data = encoder_model.sample_inputs()
|
246 |
-
encoder_inference_job = hub.submit_inference_job(
|
247 |
-
model=encoder_target_model,
|
248 |
-
device=device,
|
249 |
-
inputs=encoder_input_data,
|
250 |
-
)
|
251 |
-
encoder_inference_job.download_output_data()
|
252 |
decoder_input_data = decoder_model.sample_inputs()
|
253 |
decoder_inference_job = hub.submit_inference_job(
|
254 |
model=decoder_target_model,
|
@@ -256,6 +249,13 @@ decoder_inference_job = hub.submit_inference_job(
|
|
256 |
inputs=decoder_input_data,
|
257 |
)
|
258 |
decoder_inference_job.download_output_data()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
|
260 |
```
|
261 |
With the output of the model, you can compute like PSNR, relative errors or
|
|
|
38 |
|
39 |
| Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
|
40 |
|---|---|---|---|---|---|---|---|---|
|
41 |
+
| WhisperDecoder | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 4.05 ms | 3 - 40 MB | FP16 | NPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperDecoder.tflite) |
|
42 |
+
| WhisperDecoder | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 2.401 ms | 0 - 121 MB | FP16 | NPU | [Whisper-Tiny-En.so](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperDecoder.so) |
|
43 |
+
| WhisperDecoder | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 3.05 ms | 0 - 62 MB | FP16 | NPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperDecoder.tflite) |
|
44 |
+
| WhisperDecoder | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 1.71 ms | 4 - 49 MB | FP16 | NPU | [Whisper-Tiny-En.so](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperDecoder.so) |
|
45 |
+
| WhisperDecoder | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 2.62 ms | 0 - 56 MB | FP16 | NPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperDecoder.tflite) |
|
46 |
+
| WhisperDecoder | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 1.546 ms | 0 - 42 MB | FP16 | NPU | Use Export Script |
|
47 |
+
| WhisperDecoder | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 4.107 ms | 3 - 41 MB | FP16 | NPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperDecoder.tflite) |
|
48 |
+
| WhisperDecoder | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 2.368 ms | 10 - 12 MB | FP16 | NPU | Use Export Script |
|
49 |
+
| WhisperDecoder | SA7255P ADP | SA7255P | TFLITE | 18.307 ms | 2 - 57 MB | FP16 | NPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperDecoder.tflite) |
|
50 |
+
| WhisperDecoder | SA7255P ADP | SA7255P | QNN | 15.533 ms | 9 - 19 MB | FP16 | NPU | Use Export Script |
|
51 |
+
| WhisperDecoder | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 4.007 ms | 3 - 40 MB | FP16 | NPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperDecoder.tflite) |
|
52 |
+
| WhisperDecoder | SA8255 (Proxy) | SA8255P Proxy | QNN | 2.339 ms | 3 - 4 MB | FP16 | NPU | Use Export Script |
|
53 |
+
| WhisperDecoder | SA8295P ADP | SA8295P | TFLITE | 5.188 ms | 3 - 55 MB | FP16 | NPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperDecoder.tflite) |
|
54 |
+
| WhisperDecoder | SA8295P ADP | SA8295P | QNN | 3.586 ms | 1 - 7 MB | FP16 | NPU | Use Export Script |
|
55 |
+
| WhisperDecoder | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 4.064 ms | 3 - 41 MB | FP16 | NPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperDecoder.tflite) |
|
56 |
+
| WhisperDecoder | SA8650 (Proxy) | SA8650P Proxy | QNN | 2.422 ms | 10 - 11 MB | FP16 | NPU | Use Export Script |
|
57 |
+
| WhisperDecoder | SA8775P ADP | SA8775P | TFLITE | 5.443 ms | 0 - 55 MB | FP16 | NPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperDecoder.tflite) |
|
58 |
+
| WhisperDecoder | SA8775P ADP | SA8775P | QNN | 3.465 ms | 9 - 15 MB | FP16 | NPU | Use Export Script |
|
59 |
+
| WhisperDecoder | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 4.664 ms | 3 - 62 MB | FP16 | NPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperDecoder.tflite) |
|
60 |
+
| WhisperDecoder | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 2.892 ms | 4 - 50 MB | FP16 | NPU | Use Export Script |
|
61 |
+
| WhisperDecoder | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 2.285 ms | 10 - 10 MB | FP16 | NPU | Use Export Script |
|
62 |
+
| WhisperEncoder | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 99.892 ms | 20 - 51 MB | FP16 | GPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperEncoder.tflite) |
|
63 |
+
| WhisperEncoder | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 139.106 ms | 0 - 55 MB | FP16 | NPU | [Whisper-Tiny-En.so](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperEncoder.so) |
|
64 |
+
| WhisperEncoder | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 81.683 ms | 17 - 47 MB | FP16 | GPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperEncoder.tflite) |
|
65 |
+
| WhisperEncoder | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 109.268 ms | 0 - 191 MB | FP16 | NPU | [Whisper-Tiny-En.so](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperEncoder.so) |
|
66 |
+
| WhisperEncoder | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 74.784 ms | 25 - 44 MB | FP16 | GPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperEncoder.tflite) |
|
67 |
+
| WhisperEncoder | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 98.55 ms | 0 - 195 MB | FP16 | NPU | Use Export Script |
|
68 |
+
| WhisperEncoder | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 96.819 ms | 13 - 55 MB | FP16 | GPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperEncoder.tflite) |
|
69 |
+
| WhisperEncoder | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 104.143 ms | 0 - 5 MB | FP16 | NPU | Use Export Script |
|
70 |
+
| WhisperEncoder | SA7255P ADP | SA7255P | TFLITE | 507.645 ms | 20 - 45 MB | FP16 | GPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperEncoder.tflite) |
|
71 |
+
| WhisperEncoder | SA7255P ADP | SA7255P | QNN | 464.481 ms | 1 - 10 MB | FP16 | NPU | Use Export Script |
|
72 |
+
| WhisperEncoder | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 100.562 ms | 18 - 147 MB | FP16 | GPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperEncoder.tflite) |
|
73 |
+
| WhisperEncoder | SA8255 (Proxy) | SA8255P Proxy | QNN | 106.657 ms | 0 - 5 MB | FP16 | NPU | Use Export Script |
|
74 |
+
| WhisperEncoder | SA8295P ADP | SA8295P | TFLITE | 103.764 ms | 21 - 42 MB | FP16 | GPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperEncoder.tflite) |
|
75 |
+
| WhisperEncoder | SA8295P ADP | SA8295P | QNN | 127.685 ms | 4 - 10 MB | FP16 | NPU | Use Export Script |
|
76 |
+
| WhisperEncoder | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 109.307 ms | 20 - 60 MB | FP16 | GPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperEncoder.tflite) |
|
77 |
+
| WhisperEncoder | SA8650 (Proxy) | SA8650P Proxy | QNN | 107.644 ms | 0 - 5 MB | FP16 | NPU | Use Export Script |
|
78 |
+
| WhisperEncoder | SA8775P ADP | SA8775P | TFLITE | 177.953 ms | 20 - 47 MB | FP16 | GPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperEncoder.tflite) |
|
79 |
+
| WhisperEncoder | SA8775P ADP | SA8775P | QNN | 119.437 ms | 0 - 6 MB | FP16 | NPU | Use Export Script |
|
80 |
+
| WhisperEncoder | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 185.481 ms | 11 - 48 MB | FP16 | GPU | [Whisper-Tiny-En.tflite](https://huggingface.co/qualcomm/Whisper-Tiny-En/blob/main/WhisperEncoder.tflite) |
|
81 |
+
| WhisperEncoder | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 165.323 ms | 0 - 196 MB | FP16 | NPU | Use Export Script |
|
82 |
+
| WhisperEncoder | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 97.277 ms | 0 - 0 MB | FP16 | NPU | Use Export Script |
|
83 |
|
84 |
|
85 |
|
|
|
140 |
```
|
141 |
```
|
142 |
Profiling Results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
------------------------------------------------------------
|
144 |
WhisperDecoder
|
145 |
Device : Samsung Galaxy S23 (13)
|
146 |
Runtime : TFLITE
|
147 |
Estimated inference time (ms) : 4.0
|
148 |
+
Estimated peak memory usage (MB): [3, 40]
|
149 |
Total # Ops : 557
|
150 |
Compute Unit(s) : NPU (557 ops)
|
151 |
+
|
152 |
+
------------------------------------------------------------
|
153 |
+
WhisperEncoder
|
154 |
+
Device : Samsung Galaxy S23 (13)
|
155 |
+
Runtime : TFLITE
|
156 |
+
Estimated inference time (ms) : 99.9
|
157 |
+
Estimated peak memory usage (MB): [20, 51]
|
158 |
+
Total # Ops : 271
|
159 |
+
Compute Unit(s) : GPU (260 ops) CPU (11 ops)
|
160 |
```
|
161 |
|
162 |
|
|
|
179 |
|
180 |
# Load the model
|
181 |
model = Model.from_pretrained()
|
|
|
182 |
decoder_model = model.decoder
|
183 |
+
encoder_model = model.encoder
|
184 |
|
185 |
# Device
|
186 |
device = hub.Device("Samsung Galaxy S23")
|
187 |
|
188 |
# Trace model
|
189 |
+
decoder_input_shape = decoder_model.get_input_spec()
|
190 |
+
decoder_sample_inputs = decoder_model.sample_inputs()
|
191 |
|
192 |
+
traced_decoder_model = torch.jit.trace(decoder_model, [torch.tensor(data[0]) for _, data in decoder_sample_inputs.items()])
|
193 |
|
194 |
# Compile model on a specific device
|
195 |
+
decoder_compile_job = hub.submit_compile_job(
|
196 |
+
model=traced_decoder_model ,
|
197 |
device=device,
|
198 |
+
input_specs=decoder_model.get_input_spec(),
|
199 |
)
|
200 |
|
201 |
# Get target model to run on-device
|
202 |
+
decoder_target_model = decoder_compile_job.get_target_model()
|
203 |
# Trace model
|
204 |
+
encoder_input_shape = encoder_model.get_input_spec()
|
205 |
+
encoder_sample_inputs = encoder_model.sample_inputs()
|
206 |
|
207 |
+
traced_encoder_model = torch.jit.trace(encoder_model, [torch.tensor(data[0]) for _, data in encoder_sample_inputs.items()])
|
208 |
|
209 |
# Compile model on a specific device
|
210 |
+
encoder_compile_job = hub.submit_compile_job(
|
211 |
+
model=traced_encoder_model ,
|
212 |
device=device,
|
213 |
+
input_specs=encoder_model.get_input_spec(),
|
214 |
)
|
215 |
|
216 |
# Get target model to run on-device
|
217 |
+
encoder_target_model = encoder_compile_job.get_target_model()
|
218 |
|
219 |
```
|
220 |
|
|
|
226 |
provisioned in the cloud. Once the job is submitted, you can navigate to a
|
227 |
provided job URL to view a variety of on-device performance metrics.
|
228 |
```python
|
|
|
|
|
|
|
|
|
229 |
decoder_profile_job = hub.submit_profile_job(
|
230 |
model=decoder_target_model,
|
231 |
device=device,
|
232 |
)
|
233 |
+
encoder_profile_job = hub.submit_profile_job(
|
234 |
+
model=encoder_target_model,
|
235 |
+
device=device,
|
236 |
+
)
|
237 |
|
238 |
```
|
239 |
|
|
|
242 |
To verify the accuracy of the model on-device, you can run on-device inference
|
243 |
on sample input data on the same cloud hosted device.
|
244 |
```python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
decoder_input_data = decoder_model.sample_inputs()
|
246 |
decoder_inference_job = hub.submit_inference_job(
|
247 |
model=decoder_target_model,
|
|
|
249 |
inputs=decoder_input_data,
|
250 |
)
|
251 |
decoder_inference_job.download_output_data()
|
252 |
+
encoder_input_data = encoder_model.sample_inputs()
|
253 |
+
encoder_inference_job = hub.submit_inference_job(
|
254 |
+
model=encoder_target_model,
|
255 |
+
device=device,
|
256 |
+
inputs=encoder_input_data,
|
257 |
+
)
|
258 |
+
encoder_inference_job.download_output_data()
|
259 |
|
260 |
```
|
261 |
With the output of the model, you can compute like PSNR, relative errors or
|