qaihm-bot commited on
Commit
43ffe3f
1 Parent(s): ebe68c5

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
- | SESR-M5-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 1.356 ms | 0 - 8 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
39
- | SESR-M5-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.975 ms | 0 - 10 MB | INT8 | NPU | [SESR-M5-Quantized.so](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.so) |
40
- | SESR-M5-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 1.07 ms | 0 - 2 MB | INT8 | NPU | [SESR-M5-Quantized.onnx](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.onnx) |
41
- | SESR-M5-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 1.128 ms | 0 - 25 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
42
- | SESR-M5-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.71 ms | 0 - 13 MB | INT8 | NPU | [SESR-M5-Quantized.so](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.so) |
43
- | SESR-M5-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 0.803 ms | 0 - 29 MB | INT8 | NPU | [SESR-M5-Quantized.onnx](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.onnx) |
44
- | SESR-M5-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 1.022 ms | 0 - 17 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
45
- | SESR-M5-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.747 ms | 0 - 11 MB | INT8 | NPU | Use Export Script |
46
- | SESR-M5-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 0.74 ms | 0 - 20 MB | INT8 | NPU | [SESR-M5-Quantized.onnx](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.onnx) |
47
- | SESR-M5-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | TFLITE | 4.893 ms | 2 - 19 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
48
- | SESR-M5-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | QNN | 3.09 ms | 0 - 7 MB | INT8 | NPU | Use Export Script |
49
- | SESR-M5-Quantized | RB5 (Proxy) | QCS8250 Proxy | TFLITE | 20.563 ms | 2 - 10 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
50
- | SESR-M5-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 1.353 ms | 0 - 73 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
51
- | SESR-M5-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.682 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
52
- | SESR-M5-Quantized | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 1.328 ms | 0 - 2 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
53
- | SESR-M5-Quantized | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.685 ms | 0 - 2 MB | INT8 | NPU | Use Export Script |
54
- | SESR-M5-Quantized | SA8775 (Proxy) | SA8775P Proxy | TFLITE | 1.442 ms | 2 - 5 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
55
- | SESR-M5-Quantized | SA8775 (Proxy) | SA8775P Proxy | QNN | 0.689 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
56
- | SESR-M5-Quantized | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 1.353 ms | 0 - 3 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
57
- | SESR-M5-Quantized | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.692 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
58
- | SESR-M5-Quantized | SA8295P ADP | SA8295P | TFLITE | 2.467 ms | 0 - 17 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
59
- | SESR-M5-Quantized | SA8295P ADP | SA8295P | QNN | 1.515 ms | 0 - 6 MB | INT8 | NPU | Use Export Script |
60
- | SESR-M5-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 1.842 ms | 0 - 25 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
61
- | SESR-M5-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 1.112 ms | 0 - 15 MB | INT8 | NPU | Use Export Script |
62
- | SESR-M5-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.801 ms | 0 - 0 MB | INT8 | NPU | Use Export Script |
63
- | SESR-M5-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 1.224 ms | 3 - 3 MB | INT8 | NPU | [SESR-M5-Quantized.onnx](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.onnx) |
64
 
65
 
66
 
@@ -126,12 +126,72 @@ SESR-M5-Quantized
126
  Device : Samsung Galaxy S23 (13)
127
  Runtime : TFLITE
128
  Estimated inference time (ms) : 1.4
129
- Estimated peak memory usage (MB): [0, 8]
130
  Total # Ops : 27
131
  Compute Unit(s) : NPU (24 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
+ | SESR-M5-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 1.36 ms | 0 - 3 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
39
+ | SESR-M5-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.977 ms | 0 - 10 MB | INT8 | NPU | [SESR-M5-Quantized.so](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.so) |
40
+ | SESR-M5-Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 3.084 ms | 0 - 3 MB | INT8 | NPU | [SESR-M5-Quantized.onnx](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.onnx) |
41
+ | SESR-M5-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 1.12 ms | 0 - 26 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
42
+ | SESR-M5-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.706 ms | 0 - 12 MB | INT8 | NPU | [SESR-M5-Quantized.so](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.so) |
43
+ | SESR-M5-Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 2.217 ms | 0 - 74 MB | INT8 | NPU | [SESR-M5-Quantized.onnx](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.onnx) |
44
+ | SESR-M5-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 1.592 ms | 0 - 18 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
45
+ | SESR-M5-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.728 ms | 0 - 12 MB | INT8 | NPU | Use Export Script |
46
+ | SESR-M5-Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 2.049 ms | 0 - 57 MB | INT8 | NPU | [SESR-M5-Quantized.onnx](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.onnx) |
47
+ | SESR-M5-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | TFLITE | 3.602 ms | 2 - 20 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
48
+ | SESR-M5-Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | QNN | 3.106 ms | 0 - 8 MB | INT8 | NPU | Use Export Script |
49
+ | SESR-M5-Quantized | RB5 (Proxy) | QCS8250 Proxy | TFLITE | 21.818 ms | 1 - 4 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
50
+ | SESR-M5-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 1.334 ms | 0 - 1 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
51
+ | SESR-M5-Quantized | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.689 ms | 0 - 2 MB | INT8 | NPU | Use Export Script |
52
+ | SESR-M5-Quantized | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 1.35 ms | 0 - 74 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
53
+ | SESR-M5-Quantized | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.692 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
54
+ | SESR-M5-Quantized | SA8775 (Proxy) | SA8775P Proxy | TFLITE | 1.329 ms | 0 - 2 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
55
+ | SESR-M5-Quantized | SA8775 (Proxy) | SA8775P Proxy | QNN | 0.692 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
56
+ | SESR-M5-Quantized | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 1.362 ms | 0 - 1 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
57
+ | SESR-M5-Quantized | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.696 ms | 0 - 2 MB | INT8 | NPU | Use Export Script |
58
+ | SESR-M5-Quantized | SA8295P ADP | SA8295P | TFLITE | 2.612 ms | 2 - 19 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
59
+ | SESR-M5-Quantized | SA8295P ADP | SA8295P | QNN | 1.545 ms | 0 - 6 MB | INT8 | NPU | Use Export Script |
60
+ | SESR-M5-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 1.73 ms | 0 - 26 MB | INT8 | NPU | [SESR-M5-Quantized.tflite](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.tflite) |
61
+ | SESR-M5-Quantized | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 1.125 ms | 0 - 16 MB | INT8 | NPU | Use Export Script |
62
+ | SESR-M5-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.829 ms | 0 - 0 MB | INT8 | NPU | Use Export Script |
63
+ | SESR-M5-Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 3.574 ms | 2 - 2 MB | INT8 | NPU | [SESR-M5-Quantized.onnx](https://huggingface.co/qualcomm/SESR-M5-Quantized/blob/main/SESR-M5-Quantized.onnx) |
64
 
65
 
66
 
 
126
  Device : Samsung Galaxy S23 (13)
127
  Runtime : TFLITE
128
  Estimated inference time (ms) : 1.4
129
+ Estimated peak memory usage (MB): [0, 3]
130
  Total # Ops : 27
131
  Compute Unit(s) : NPU (24 ops) CPU (3 ops)
132
  ```
133
 
134
 
135
+ ## How does this work?
136
+
137
+ This [export script](https://aihub.qualcomm.com/models/sesr_m5_quantized/qai_hub_models/models/SESR-M5-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.sesr_m5_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