qaihm-bot commited on
Commit
f85233e
·
verified ·
1 Parent(s): 8982a7e

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +85 -25
README.md CHANGED
@@ -35,32 +35,32 @@ More details on model performance across various devices, can be found
35
 
36
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
37
  |---|---|---|---|---|---|---|---|---|
38
- | XLSR-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 1.08 ms | 0 - 1 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
39
- | XLSR-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.658 ms | 0 - 65 MB | INT8 | NPU | [XLSR-Quantized.so](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.so) |
40
- | XLSR-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 0.676 ms | 0 - 1 MB | INT8 | NPU | [XLSR-Quantized.onnx](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.onnx) |
41
- | XLSR-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.891 ms | 0 - 22 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
42
- | XLSR-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.452 ms | 0 - 13 MB | INT8 | NPU | [XLSR-Quantized.so](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.so) |
43
- | XLSR-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 0.494 ms | 0 - 23 MB | INT8 | NPU | [XLSR-Quantized.onnx](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.onnx) |
44
- | XLSR-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 1.055 ms | 0 - 16 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
45
- | XLSR-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.511 ms | 0 - 10 MB | INT8 | NPU | Use Export Script |
46
- | XLSR-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 0.468 ms | 0 - 16 MB | INT8 | NPU | [XLSR-Quantized.onnx](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.onnx) |
47
- | XLSR-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | TFLITE | 2.112 ms | 0 - 16 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
48
- | XLSR-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | QNN | 1.095 ms | 0 - 8 MB | INT8 | NPU | Use Export Script |
49
- | XLSR-Quantized | RB5 (Proxy) | QCS8250 Proxy | TFLITE | 16.001 ms | 4 - 21 MB | INT8 | GPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
50
- | XLSR-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 1.082 ms | 0 - 8 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
51
- | XLSR-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.43 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
52
- | XLSR-Quantized | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 1.053 ms | 0 - 1 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
53
- | XLSR-Quantized | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.429 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
54
- | XLSR-Quantized | SA8775 (Proxy) | SA8775P Proxy | TFLITE | 1.06 ms | 0 - 15 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
55
- | XLSR-Quantized | SA8775 (Proxy) | SA8775P Proxy | QNN | 0.461 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
56
- | XLSR-Quantized | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 1.055 ms | 0 - 16 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
57
  | XLSR-Quantized | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.43 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
58
- | XLSR-Quantized | SA8295P ADP | SA8295P | TFLITE | 1.839 ms | 0 - 15 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
59
- | XLSR-Quantized | SA8295P ADP | SA8295P | QNN | 1.066 ms | 0 - 5 MB | INT8 | NPU | Use Export Script |
60
- | XLSR-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 1.544 ms | 0 - 23 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
61
- | XLSR-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 0.71 ms | 0 - 15 MB | INT8 | NPU | Use Export Script |
62
- | XLSR-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.54 ms | 0 - 0 MB | INT8 | NPU | Use Export Script |
63
- | XLSR-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 0.786 ms | 3 - 3 MB | INT8 | NPU | [XLSR-Quantized.onnx](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.onnx) |
64
 
65
 
66
 
@@ -132,6 +132,66 @@ Compute Unit(s) : NPU (16 ops) CPU (3 ops)
132
  ```
133
 
134
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
 
137
  ## Run demo on a cloud-hosted device
 
35
 
36
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
37
  |---|---|---|---|---|---|---|---|---|
38
+ | XLSR-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 1.065 ms | 0 - 1 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
39
+ | XLSR-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.652 ms | 0 - 10 MB | INT8 | NPU | [XLSR-Quantized.so](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.so) |
40
+ | XLSR-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 4.078 ms | 11 - 12 MB | INT8 | NPU | [XLSR-Quantized.onnx](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.onnx) |
41
+ | XLSR-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.883 ms | 0 - 22 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
42
+ | XLSR-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.448 ms | 0 - 15 MB | INT8 | NPU | [XLSR-Quantized.so](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.so) |
43
+ | XLSR-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 3.038 ms | 0 - 35 MB | INT8 | NPU | [XLSR-Quantized.onnx](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.onnx) |
44
+ | XLSR-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 1.063 ms | 0 - 15 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
45
+ | XLSR-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.484 ms | 0 - 10 MB | INT8 | NPU | Use Export Script |
46
+ | XLSR-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 3.057 ms | 0 - 25 MB | INT8 | NPU | [XLSR-Quantized.onnx](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.onnx) |
47
+ | XLSR-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | TFLITE | 2.274 ms | 0 - 16 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
48
+ | XLSR-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | QNN | 1.123 ms | 0 - 7 MB | INT8 | NPU | Use Export Script |
49
+ | XLSR-Quantized | RB5 (Proxy) | QCS8250 Proxy | TFLITE | 16.434 ms | 4 - 14 MB | INT8 | GPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
50
+ | XLSR-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 1.065 ms | 0 - 66 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
51
+ | XLSR-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.432 ms | 0 - 2 MB | INT8 | NPU | Use Export Script |
52
+ | XLSR-Quantized | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 1.106 ms | 0 - 17 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
53
+ | XLSR-Quantized | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.433 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
54
+ | XLSR-Quantized | SA8775 (Proxy) | SA8775P Proxy | TFLITE | 1.073 ms | 0 - 1 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
55
+ | XLSR-Quantized | SA8775 (Proxy) | SA8775P Proxy | QNN | 0.428 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
56
+ | XLSR-Quantized | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 1.065 ms | 0 - 1 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
57
  | XLSR-Quantized | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.43 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
58
+ | XLSR-Quantized | SA8295P ADP | SA8295P | TFLITE | 1.884 ms | 0 - 14 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
59
+ | XLSR-Quantized | SA8295P ADP | SA8295P | QNN | 0.896 ms | 0 - 6 MB | INT8 | NPU | Use Export Script |
60
+ | XLSR-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 1.656 ms | 2 - 25 MB | INT8 | NPU | [XLSR-Quantized.tflite](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.tflite) |
61
+ | XLSR-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 0.723 ms | 0 - 16 MB | INT8 | NPU | Use Export Script |
62
+ | XLSR-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.539 ms | 0 - 0 MB | INT8 | NPU | Use Export Script |
63
+ | XLSR-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 7.761 ms | 9 - 9 MB | INT8 | NPU | [XLSR-Quantized.onnx](https://huggingface.co/qualcomm/XLSR-Quantized/blob/main/XLSR-Quantized.onnx) |
64
 
65
 
66
 
 
132
  ```
133
 
134
 
135
+ ## How does this work?
136
+
137
+ This [export script](https://aihub.qualcomm.com/models/xlsr_quantized/qai_hub_models/models/XLSR-Quantized/export.py)
138
+ leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
139
+ on-device. Lets go through each step below in detail:
140
+
141
+ Step 1: **Compile model for on-device deployment**
142
+
143
+ To compile a PyTorch model for on-device deployment, we first trace the model
144
+ in memory using the `jit.trace` and then call the `submit_compile_job` API.
145
+
146
+ ```python
147
+ import torch
148
+
149
+ import qai_hub as hub
150
+ from qai_hub_models.models.xlsr_quantized import
151
+
152
+ # Load the model
153
+
154
+ # Device
155
+ device = hub.Device("Samsung Galaxy S23")
156
+
157
+
158
+ ```
159
+
160
+
161
+ Step 2: **Performance profiling on cloud-hosted device**
162
+
163
+ After compiling models from step 1. Models can be profiled model on-device using the
164
+ `target_model`. Note that this scripts runs the model on a device automatically
165
+ provisioned in the cloud. Once the job is submitted, you can navigate to a
166
+ provided job URL to view a variety of on-device performance metrics.
167
+ ```python
168
+ profile_job = hub.submit_profile_job(
169
+ model=target_model,
170
+ device=device,
171
+ )
172
+
173
+ ```
174
+
175
+ Step 3: **Verify on-device accuracy**
176
+
177
+ To verify the accuracy of the model on-device, you can run on-device inference
178
+ on sample input data on the same cloud hosted device.
179
+ ```python
180
+ input_data = torch_model.sample_inputs()
181
+ inference_job = hub.submit_inference_job(
182
+ model=target_model,
183
+ device=device,
184
+ inputs=input_data,
185
+ )
186
+ on_device_output = inference_job.download_output_data()
187
+
188
+ ```
189
+ With the output of the model, you can compute like PSNR, relative errors or
190
+ spot check the output with expected output.
191
+
192
+ **Note**: This on-device profiling and inference requires access to Qualcomm®
193
+ AI Hub. [Sign up for access](https://myaccount.qualcomm.com/signup).
194
+
195
 
196
 
197
  ## Run demo on a cloud-hosted device