qaihm-bot commited on
Commit
ca09e33
·
verified ·
1 Parent(s): 5ff5756

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +87 -27
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
- | QuickSRNetSmall-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 1.058 ms | 0 - 1 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
39
- | QuickSRNetSmall-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.466 ms | 0 - 2 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.so](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.so) |
40
- | QuickSRNetSmall-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 0.659 ms | 0 - 1 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.onnx](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.onnx) |
41
- | QuickSRNetSmall-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.893 ms | 0 - 20 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
42
- | QuickSRNetSmall-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.32 ms | 0 - 8 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.so](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.so) |
43
- | QuickSRNetSmall-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 0.484 ms | 0 - 20 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.onnx](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.onnx) |
44
- | QuickSRNetSmall-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 1.152 ms | 0 - 14 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
45
- | QuickSRNetSmall-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.329 ms | 0 - 9 MB | INT8 | NPU | Use Export Script |
46
- | QuickSRNetSmall-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 0.436 ms | 0 - 14 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.onnx](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.onnx) |
47
- | QuickSRNetSmall-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | TFLITE | 2.183 ms | 0 - 15 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
48
- | QuickSRNetSmall-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | QNN | 0.931 ms | 0 - 8 MB | INT8 | NPU | Use Export Script |
49
- | QuickSRNetSmall-Quantized | RB5 (Proxy) | QCS8250 Proxy | TFLITE | 11.279 ms | 2 - 4 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
50
- | QuickSRNetSmall-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 1.135 ms | 0 - 10 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
51
- | QuickSRNetSmall-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.388 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
52
- | QuickSRNetSmall-Quantized | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 1.068 ms | 0 - 14 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
53
- | QuickSRNetSmall-Quantized | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.391 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
54
- | QuickSRNetSmall-Quantized | SA8775 (Proxy) | SA8775P Proxy | TFLITE | 1.073 ms | 0 - 1 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
55
- | QuickSRNetSmall-Quantized | SA8775 (Proxy) | SA8775P Proxy | QNN | 0.395 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
56
- | QuickSRNetSmall-Quantized | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 1.087 ms | 0 - 29 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
57
- | QuickSRNetSmall-Quantized | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.394 ms | 0 - 2 MB | INT8 | NPU | Use Export Script |
58
- | QuickSRNetSmall-Quantized | SA8295P ADP | SA8295P | TFLITE | 1.828 ms | 0 - 13 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
59
- | QuickSRNetSmall-Quantized | SA8295P ADP | SA8295P | QNN | 0.869 ms | 0 - 6 MB | INT8 | NPU | Use Export Script |
60
- | QuickSRNetSmall-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 1.681 ms | 2 - 23 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
61
- | QuickSRNetSmall-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 0.533 ms | 0 - 10 MB | INT8 | NPU | Use Export Script |
62
- | QuickSRNetSmall-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.485 ms | 0 - 0 MB | INT8 | NPU | Use Export Script |
63
- | QuickSRNetSmall-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 0.748 ms | 3 - 3 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.onnx](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.onnx) |
64
 
65
 
66
 
@@ -126,12 +126,72 @@ QuickSRNetSmall-Quantized
126
  Device : Samsung Galaxy S23 (13)
127
  Runtime : TFLITE
128
  Estimated inference time (ms) : 1.1
129
- Estimated peak memory usage (MB): [0, 1]
130
  Total # Ops : 13
131
  Compute Unit(s) : NPU (10 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
+ | QuickSRNetSmall-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 1.074 ms | 0 - 3 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
39
+ | QuickSRNetSmall-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.502 ms | 0 - 10 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.so](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.so) |
40
+ | QuickSRNetSmall-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 3.581 ms | 0 - 2 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.onnx](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.onnx) |
41
+ | QuickSRNetSmall-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.865 ms | 0 - 21 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
42
+ | QuickSRNetSmall-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.325 ms | 0 - 10 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.so](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.so) |
43
+ | QuickSRNetSmall-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 2.715 ms | 0 - 29 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.onnx](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.onnx) |
44
+ | QuickSRNetSmall-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 0.828 ms | 0 - 14 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
45
+ | QuickSRNetSmall-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.282 ms | 0 - 9 MB | INT8 | NPU | Use Export Script |
46
+ | QuickSRNetSmall-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 2.618 ms | 0 - 18 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.onnx](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.onnx) |
47
+ | QuickSRNetSmall-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | TFLITE | 2.109 ms | 0 - 15 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
48
+ | QuickSRNetSmall-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | QNN | 1.096 ms | 0 - 8 MB | INT8 | NPU | Use Export Script |
49
+ | QuickSRNetSmall-Quantized | RB5 (Proxy) | QCS8250 Proxy | TFLITE | 11.377 ms | 2 - 5 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
50
+ | QuickSRNetSmall-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 1.058 ms | 0 - 1 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
51
+ | QuickSRNetSmall-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.392 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
52
+ | QuickSRNetSmall-Quantized | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 1.064 ms | 0 - 1 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
53
+ | QuickSRNetSmall-Quantized | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.388 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
54
+ | QuickSRNetSmall-Quantized | SA8775 (Proxy) | SA8775P Proxy | TFLITE | 1.082 ms | 0 - 3 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
55
+ | QuickSRNetSmall-Quantized | SA8775 (Proxy) | SA8775P Proxy | QNN | 0.391 ms | 0 - 2 MB | INT8 | NPU | Use Export Script |
56
+ | QuickSRNetSmall-Quantized | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 2.623 ms | 1 - 32 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
57
+ | QuickSRNetSmall-Quantized | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.42 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
58
+ | QuickSRNetSmall-Quantized | SA8295P ADP | SA8295P | TFLITE | 1.802 ms | 2 - 14 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
59
+ | QuickSRNetSmall-Quantized | SA8295P ADP | SA8295P | QNN | 0.896 ms | 0 - 5 MB | INT8 | NPU | Use Export Script |
60
+ | QuickSRNetSmall-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 1.909 ms | 2 - 23 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.tflite](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.tflite) |
61
+ | QuickSRNetSmall-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 0.537 ms | 0 - 11 MB | INT8 | NPU | Use Export Script |
62
+ | QuickSRNetSmall-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.487 ms | 0 - 0 MB | INT8 | NPU | Use Export Script |
63
+ | QuickSRNetSmall-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 3.597 ms | 15 - 15 MB | INT8 | NPU | [QuickSRNetSmall-Quantized.onnx](https://huggingface.co/qualcomm/QuickSRNetSmall-Quantized/blob/main/QuickSRNetSmall-Quantized.onnx) |
64
 
65
 
66
 
 
126
  Device : Samsung Galaxy S23 (13)
127
  Runtime : TFLITE
128
  Estimated inference time (ms) : 1.1
129
+ Estimated peak memory usage (MB): [0, 3]
130
  Total # Ops : 13
131
  Compute Unit(s) : NPU (10 ops) CPU (3 ops)
132
  ```
133
 
134
 
135
+ ## How does this work?
136
+
137
+ This [export script](https://aihub.qualcomm.com/models/quicksrnetsmall_quantized/qai_hub_models/models/QuickSRNetSmall-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.quicksrnetsmall_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