Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
@@ -38,56 +38,56 @@ 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 |
-
|
|
86 |
-
|
|
87 |
-
|
|
88 |
-
|
|
89 |
-
|
|
90 |
-
|
|
91 |
|
92 |
|
93 |
|
@@ -148,23 +148,23 @@ python -m qai_hub_models.models.whisper_base_en.export
|
|
148 |
```
|
149 |
```
|
150 |
Profiling Results
|
151 |
-
------------------------------------------------------------
|
152 |
-
WhisperEncoder
|
153 |
-
Device : Samsung Galaxy S23 (13)
|
154 |
-
Runtime : TFLITE
|
155 |
-
Estimated inference time (ms) : 200.0
|
156 |
-
Estimated peak memory usage (MB): [0, 81]
|
157 |
-
Total # Ops : 419
|
158 |
-
Compute Unit(s) : GPU (408 ops) CPU (11 ops)
|
159 |
-
|
160 |
------------------------------------------------------------
|
161 |
WhisperDecoder
|
162 |
Device : Samsung Galaxy S23 (13)
|
163 |
Runtime : TFLITE
|
164 |
-
Estimated inference time (ms) :
|
165 |
-
Estimated peak memory usage (MB): [
|
166 |
Total # Ops : 983
|
167 |
Compute Unit(s) : NPU (983 ops)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
```
|
169 |
|
170 |
|
@@ -187,42 +187,42 @@ from qai_hub_models.models.whisper_base_en import Model
|
|
187 |
|
188 |
# Load the model
|
189 |
model = Model.from_pretrained()
|
190 |
-
encoder_model = model.encoder
|
191 |
decoder_model = model.decoder
|
|
|
192 |
|
193 |
# Device
|
194 |
device = hub.Device("Samsung Galaxy S23")
|
195 |
|
196 |
# Trace model
|
197 |
-
|
198 |
-
|
199 |
|
200 |
-
|
201 |
|
202 |
# Compile model on a specific device
|
203 |
-
|
204 |
-
model=
|
205 |
device=device,
|
206 |
-
input_specs=
|
207 |
)
|
208 |
|
209 |
# Get target model to run on-device
|
210 |
-
|
211 |
# Trace model
|
212 |
-
|
213 |
-
|
214 |
|
215 |
-
|
216 |
|
217 |
# Compile model on a specific device
|
218 |
-
|
219 |
-
model=
|
220 |
device=device,
|
221 |
-
input_specs=
|
222 |
)
|
223 |
|
224 |
# Get target model to run on-device
|
225 |
-
|
226 |
|
227 |
```
|
228 |
|
@@ -234,14 +234,14 @@ After compiling models from step 1. Models can be profiled model on-device using
|
|
234 |
provisioned in the cloud. Once the job is submitted, you can navigate to a
|
235 |
provided job URL to view a variety of on-device performance metrics.
|
236 |
```python
|
237 |
-
encoder_profile_job = hub.submit_profile_job(
|
238 |
-
model=encoder_target_model,
|
239 |
-
device=device,
|
240 |
-
)
|
241 |
decoder_profile_job = hub.submit_profile_job(
|
242 |
model=decoder_target_model,
|
243 |
device=device,
|
244 |
)
|
|
|
|
|
|
|
|
|
245 |
|
246 |
```
|
247 |
|
@@ -250,13 +250,6 @@ Step 3: **Verify on-device accuracy**
|
|
250 |
To verify the accuracy of the model on-device, you can run on-device inference
|
251 |
on sample input data on the same cloud hosted device.
|
252 |
```python
|
253 |
-
encoder_input_data = encoder_model.sample_inputs()
|
254 |
-
encoder_inference_job = hub.submit_inference_job(
|
255 |
-
model=encoder_target_model,
|
256 |
-
device=device,
|
257 |
-
inputs=encoder_input_data,
|
258 |
-
)
|
259 |
-
encoder_inference_job.download_output_data()
|
260 |
decoder_input_data = decoder_model.sample_inputs()
|
261 |
decoder_inference_job = hub.submit_inference_job(
|
262 |
model=decoder_target_model,
|
@@ -264,6 +257,13 @@ decoder_inference_job = hub.submit_inference_job(
|
|
264 |
inputs=decoder_input_data,
|
265 |
)
|
266 |
decoder_inference_job.download_output_data()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
|
268 |
```
|
269 |
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 | 37.916 ms | 5 - 43 MB | FP16 | NPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.tflite) |
|
42 |
+
| WhisperDecoder | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 4.223 ms | 20 - 63 MB | FP16 | NPU | [Whisper-Base-En.so](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.so) |
|
43 |
+
| WhisperDecoder | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 15.843 ms | 0 - 116 MB | FP16 | NPU | [Whisper-Base-En.onnx](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.onnx) |
|
44 |
+
| WhisperDecoder | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 32.58 ms | 4 - 82 MB | FP16 | NPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.tflite) |
|
45 |
+
| WhisperDecoder | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 3.296 ms | 20 - 75 MB | FP16 | NPU | [Whisper-Base-En.so](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.so) |
|
46 |
+
| WhisperDecoder | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 13.657 ms | 0 - 222 MB | FP16 | NPU | [Whisper-Base-En.onnx](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.onnx) |
|
47 |
+
| WhisperDecoder | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 27.503 ms | 4 - 76 MB | FP16 | NPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.tflite) |
|
48 |
+
| WhisperDecoder | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 2.646 ms | 9 - 59 MB | FP16 | NPU | Use Export Script |
|
49 |
+
| WhisperDecoder | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 12.074 ms | 6 - 203 MB | FP16 | NPU | [Whisper-Base-En.onnx](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.onnx) |
|
50 |
+
| WhisperDecoder | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 38.524 ms | 6 - 42 MB | FP16 | NPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.tflite) |
|
51 |
+
| WhisperDecoder | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 4.167 ms | 19 - 20 MB | FP16 | NPU | Use Export Script |
|
52 |
+
| WhisperDecoder | SA7255P ADP | SA7255P | TFLITE | 67.034 ms | 4 - 76 MB | FP16 | NPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.tflite) |
|
53 |
+
| WhisperDecoder | SA7255P ADP | SA7255P | QNN | 26.93 ms | 9 - 19 MB | FP16 | NPU | Use Export Script |
|
54 |
+
| WhisperDecoder | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 38.064 ms | 6 - 42 MB | FP16 | NPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.tflite) |
|
55 |
+
| WhisperDecoder | SA8255 (Proxy) | SA8255P Proxy | QNN | 4.245 ms | 19 - 20 MB | FP16 | NPU | Use Export Script |
|
56 |
+
| WhisperDecoder | SA8295P ADP | SA8295P | TFLITE | 40.976 ms | 2 - 67 MB | FP16 | NPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.tflite) |
|
57 |
+
| WhisperDecoder | SA8295P ADP | SA8295P | QNN | 5.535 ms | 18 - 24 MB | FP16 | NPU | Use Export Script |
|
58 |
+
| WhisperDecoder | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 38.218 ms | 6 - 43 MB | FP16 | NPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.tflite) |
|
59 |
+
| WhisperDecoder | SA8650 (Proxy) | SA8650P Proxy | QNN | 4.172 ms | 20 - 22 MB | FP16 | NPU | Use Export Script |
|
60 |
+
| WhisperDecoder | SA8775P ADP | SA8775P | TFLITE | 38.342 ms | 5 - 77 MB | FP16 | NPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.tflite) |
|
61 |
+
| WhisperDecoder | SA8775P ADP | SA8775P | QNN | 5.638 ms | 18 - 28 MB | FP16 | NPU | Use Export Script |
|
62 |
+
| WhisperDecoder | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 42.473 ms | 3 - 75 MB | FP16 | NPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.tflite) |
|
63 |
+
| WhisperDecoder | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 5.146 ms | 20 - 71 MB | FP16 | NPU | Use Export Script |
|
64 |
+
| WhisperDecoder | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 3.907 ms | 20 - 20 MB | FP16 | NPU | Use Export Script |
|
65 |
+
| WhisperDecoder | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 14.267 ms | 107 - 107 MB | FP16 | NPU | [Whisper-Base-En.onnx](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperDecoder.onnx) |
|
66 |
+
| WhisperEncoder | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 196.633 ms | 35 - 110 MB | FP16 | GPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.tflite) |
|
67 |
+
| WhisperEncoder | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 266.434 ms | 0 - 77 MB | FP16 | NPU | [Whisper-Base-En.so](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.so) |
|
68 |
+
| WhisperEncoder | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 300.379 ms | 91 - 94 MB | FP16 | NPU | [Whisper-Base-En.onnx](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.onnx) |
|
69 |
+
| WhisperEncoder | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 157.913 ms | 37 - 77 MB | FP16 | GPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.tflite) |
|
70 |
+
| WhisperEncoder | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 186.485 ms | 1 - 287 MB | FP16 | NPU | [Whisper-Base-En.so](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.so) |
|
71 |
+
| WhisperEncoder | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 211.549 ms | 94 - 982 MB | FP16 | NPU | [Whisper-Base-En.onnx](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.onnx) |
|
72 |
+
| WhisperEncoder | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 140.336 ms | 37 - 60 MB | FP16 | GPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.tflite) |
|
73 |
+
| WhisperEncoder | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 152.984 ms | 0 - 304 MB | FP16 | NPU | Use Export Script |
|
74 |
+
| WhisperEncoder | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 183.176 ms | 96 - 640 MB | FP16 | NPU | [Whisper-Base-En.onnx](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.onnx) |
|
75 |
+
| WhisperEncoder | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 196.378 ms | 34 - 110 MB | FP16 | GPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.tflite) |
|
76 |
+
| WhisperEncoder | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 199.737 ms | 0 - 21 MB | FP16 | NPU | Use Export Script |
|
77 |
+
| WhisperEncoder | SA7255P ADP | SA7255P | TFLITE | 1160.066 ms | 32 - 56 MB | FP16 | GPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.tflite) |
|
78 |
+
| WhisperEncoder | SA7255P ADP | SA7255P | QNN | 935.326 ms | 1 - 11 MB | FP16 | NPU | Use Export Script |
|
79 |
+
| WhisperEncoder | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 200.355 ms | 34 - 123 MB | FP16 | GPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.tflite) |
|
80 |
+
| WhisperEncoder | SA8255 (Proxy) | SA8255P Proxy | QNN | 217.297 ms | 1 - 2 MB | FP16 | NPU | Use Export Script |
|
81 |
+
| WhisperEncoder | SA8295P ADP | SA8295P | TFLITE | 204.198 ms | 38 - 66 MB | FP16 | GPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.tflite) |
|
82 |
+
| WhisperEncoder | SA8295P ADP | SA8295P | QNN | 219.469 ms | 1 - 7 MB | FP16 | NPU | Use Export Script |
|
83 |
+
| WhisperEncoder | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 200.209 ms | 0 - 78 MB | FP16 | GPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.tflite) |
|
84 |
+
| WhisperEncoder | SA8650 (Proxy) | SA8650P Proxy | QNN | 213.794 ms | 0 - 11 MB | FP16 | NPU | Use Export Script |
|
85 |
+
| WhisperEncoder | SA8775P ADP | SA8775P | TFLITE | 367.334 ms | 37 - 64 MB | FP16 | GPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.tflite) |
|
86 |
+
| WhisperEncoder | SA8775P ADP | SA8775P | QNN | 195.132 ms | 0 - 6 MB | FP16 | NPU | Use Export Script |
|
87 |
+
| WhisperEncoder | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 284.098 ms | 39 - 83 MB | FP16 | GPU | [Whisper-Base-En.tflite](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.tflite) |
|
88 |
+
| WhisperEncoder | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 283.131 ms | 0 - 297 MB | FP16 | NPU | Use Export Script |
|
89 |
+
| WhisperEncoder | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 160.208 ms | 0 - 0 MB | FP16 | NPU | Use Export Script |
|
90 |
+
| WhisperEncoder | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 297.781 ms | 133 - 133 MB | FP16 | NPU | [Whisper-Base-En.onnx](https://huggingface.co/qualcomm/Whisper-Base-En/blob/main/WhisperEncoder.onnx) |
|
91 |
|
92 |
|
93 |
|
|
|
148 |
```
|
149 |
```
|
150 |
Profiling Results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
------------------------------------------------------------
|
152 |
WhisperDecoder
|
153 |
Device : Samsung Galaxy S23 (13)
|
154 |
Runtime : TFLITE
|
155 |
+
Estimated inference time (ms) : 37.9
|
156 |
+
Estimated peak memory usage (MB): [5, 43]
|
157 |
Total # Ops : 983
|
158 |
Compute Unit(s) : NPU (983 ops)
|
159 |
+
|
160 |
+
------------------------------------------------------------
|
161 |
+
WhisperEncoder
|
162 |
+
Device : Samsung Galaxy S23 (13)
|
163 |
+
Runtime : TFLITE
|
164 |
+
Estimated inference time (ms) : 196.6
|
165 |
+
Estimated peak memory usage (MB): [35, 110]
|
166 |
+
Total # Ops : 419
|
167 |
+
Compute Unit(s) : GPU (408 ops) CPU (11 ops)
|
168 |
```
|
169 |
|
170 |
|
|
|
187 |
|
188 |
# Load the model
|
189 |
model = Model.from_pretrained()
|
|
|
190 |
decoder_model = model.decoder
|
191 |
+
encoder_model = model.encoder
|
192 |
|
193 |
# Device
|
194 |
device = hub.Device("Samsung Galaxy S23")
|
195 |
|
196 |
# Trace model
|
197 |
+
decoder_input_shape = decoder_model.get_input_spec()
|
198 |
+
decoder_sample_inputs = decoder_model.sample_inputs()
|
199 |
|
200 |
+
traced_decoder_model = torch.jit.trace(decoder_model, [torch.tensor(data[0]) for _, data in decoder_sample_inputs.items()])
|
201 |
|
202 |
# Compile model on a specific device
|
203 |
+
decoder_compile_job = hub.submit_compile_job(
|
204 |
+
model=traced_decoder_model ,
|
205 |
device=device,
|
206 |
+
input_specs=decoder_model.get_input_spec(),
|
207 |
)
|
208 |
|
209 |
# Get target model to run on-device
|
210 |
+
decoder_target_model = decoder_compile_job.get_target_model()
|
211 |
# Trace model
|
212 |
+
encoder_input_shape = encoder_model.get_input_spec()
|
213 |
+
encoder_sample_inputs = encoder_model.sample_inputs()
|
214 |
|
215 |
+
traced_encoder_model = torch.jit.trace(encoder_model, [torch.tensor(data[0]) for _, data in encoder_sample_inputs.items()])
|
216 |
|
217 |
# Compile model on a specific device
|
218 |
+
encoder_compile_job = hub.submit_compile_job(
|
219 |
+
model=traced_encoder_model ,
|
220 |
device=device,
|
221 |
+
input_specs=encoder_model.get_input_spec(),
|
222 |
)
|
223 |
|
224 |
# Get target model to run on-device
|
225 |
+
encoder_target_model = encoder_compile_job.get_target_model()
|
226 |
|
227 |
```
|
228 |
|
|
|
234 |
provisioned in the cloud. Once the job is submitted, you can navigate to a
|
235 |
provided job URL to view a variety of on-device performance metrics.
|
236 |
```python
|
|
|
|
|
|
|
|
|
237 |
decoder_profile_job = hub.submit_profile_job(
|
238 |
model=decoder_target_model,
|
239 |
device=device,
|
240 |
)
|
241 |
+
encoder_profile_job = hub.submit_profile_job(
|
242 |
+
model=encoder_target_model,
|
243 |
+
device=device,
|
244 |
+
)
|
245 |
|
246 |
```
|
247 |
|
|
|
250 |
To verify the accuracy of the model on-device, you can run on-device inference
|
251 |
on sample input data on the same cloud hosted device.
|
252 |
```python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
decoder_input_data = decoder_model.sample_inputs()
|
254 |
decoder_inference_job = hub.submit_inference_job(
|
255 |
model=decoder_target_model,
|
|
|
257 |
inputs=decoder_input_data,
|
258 |
)
|
259 |
decoder_inference_job.download_output_data()
|
260 |
+
encoder_input_data = encoder_model.sample_inputs()
|
261 |
+
encoder_inference_job = hub.submit_inference_job(
|
262 |
+
model=encoder_target_model,
|
263 |
+
device=device,
|
264 |
+
inputs=encoder_input_data,
|
265 |
+
)
|
266 |
+
encoder_inference_job.download_output_data()
|
267 |
|
268 |
```
|
269 |
With the output of the model, you can compute like PSNR, relative errors or
|