qaihm-bot commited on
Commit
1b52bde
1 Parent(s): a811dcc

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +99 -18
README.md CHANGED
@@ -18,7 +18,7 @@ tags:
18
 
19
  GoogLeNet is a machine learning model that can classify images from the Imagenet dataset. It can also be used as a backbone in building more complex models for specific use cases.
20
 
21
- This model is an implementation of GoogLeNetQuantized found [here](https://github.com/pytorch/vision/blob/main/torchvision/models/googlenet.py).
22
  This repository provides scripts to run GoogLeNetQuantized on Qualcomm® devices.
23
  More details on model performance across various devices, can be found
24
  [here](https://aihub.qualcomm.com/models/googlenet_quantized).
@@ -33,26 +33,43 @@ More details on model performance across various devices, can be found
33
  - Number of parameters: 6.62M
34
  - Model size: 6.55 MB
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
 
38
 
39
- | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
40
- | ---|---|---|---|---|---|---|---|
41
- | Samsung Galaxy S23 Ultra (Android 13) | Snapdragon® 8 Gen 2 | TFLite | 0.275 ms | 0 - 1 MB | INT8 | NPU | [GoogLeNetQuantized.tflite](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.tflite)
42
- | Samsung Galaxy S23 Ultra (Android 13) | Snapdragon® 8 Gen 2 | QNN Model Library | 0.34 ms | 0 - 12 MB | INT8 | NPU | [GoogLeNetQuantized.so](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.so)
43
-
44
-
45
 
46
  ## Installation
47
 
48
  This model can be installed as a Python package via pip.
49
 
50
  ```bash
51
- pip install "qai-hub-models[googlenet_quantized]"
52
  ```
53
 
54
 
55
-
56
  ## Configure Qualcomm® AI Hub to run this model on a cloud-hosted device
57
 
58
  Sign-in to [Qualcomm® AI Hub](https://app.aihub.qualcomm.com/) with your
@@ -97,18 +114,78 @@ device. This script does the following:
97
  ```bash
98
  python -m qai_hub_models.models.googlenet_quantized.export
99
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  ```
102
- Profile Job summary of GoogLeNetQuantized
103
- --------------------------------------------------
104
- Device: Snapdragon X Elite CRD (11)
105
- Estimated Inference Time: 0.42 ms
106
- Estimated Peak Memory Range: 0.48-0.48 MB
107
- Compute Units: NPU (86) | Total (86)
108
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
  ```
 
 
111
 
 
 
112
 
113
 
114
 
@@ -145,15 +222,19 @@ provides instructions on how to use the `.so` shared library in an Android appl
145
  Get more details on GoogLeNetQuantized's performance across various devices [here](https://aihub.qualcomm.com/models/googlenet_quantized).
146
  Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
147
 
 
148
  ## License
149
- - The license for the original implementation of GoogLeNetQuantized can be found
150
- [here](https://github.com/pytorch/vision/blob/main/LICENSE).
151
- - The license for the compiled assets for on-device deployment can be found [here](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/Qualcomm+AI+Hub+Proprietary+License.pdf)
 
152
 
153
  ## References
154
  * [Going Deeper with Convolutions](https://arxiv.org/abs/1409.4842)
155
  * [Source Model Implementation](https://github.com/pytorch/vision/blob/main/torchvision/models/googlenet.py)
156
 
 
 
157
  ## Community
158
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
159
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
 
18
 
19
  GoogLeNet is a machine learning model that can classify images from the Imagenet dataset. It can also be used as a backbone in building more complex models for specific use cases.
20
 
21
+ This model is an implementation of GoogLeNetQuantized found [here]({source_repo}).
22
  This repository provides scripts to run GoogLeNetQuantized on Qualcomm® devices.
23
  More details on model performance across various devices, can be found
24
  [here](https://aihub.qualcomm.com/models/googlenet_quantized).
 
33
  - Number of parameters: 6.62M
34
  - Model size: 6.55 MB
35
 
36
+ | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
37
+ |---|---|---|---|---|---|---|---|---|
38
+ | GoogLeNetQuantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 0.284 ms | 0 - 3 MB | INT8 | NPU | [GoogLeNetQuantized.tflite](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.tflite) |
39
+ | GoogLeNetQuantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.342 ms | 0 - 10 MB | INT8 | NPU | [GoogLeNetQuantized.so](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.so) |
40
+ | GoogLeNetQuantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 0.499 ms | 0 - 10 MB | INT8 | NPU | [GoogLeNetQuantized.onnx](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.onnx) |
41
+ | GoogLeNetQuantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.209 ms | 0 - 38 MB | INT8 | NPU | [GoogLeNetQuantized.tflite](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.tflite) |
42
+ | GoogLeNetQuantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.253 ms | 0 - 15 MB | INT8 | NPU | [GoogLeNetQuantized.so](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.so) |
43
+ | GoogLeNetQuantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 0.461 ms | 0 - 57 MB | INT8 | NPU | [GoogLeNetQuantized.onnx](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.onnx) |
44
+ | GoogLeNetQuantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | TFLITE | 0.92 ms | 0 - 21 MB | INT8 | NPU | [GoogLeNetQuantized.tflite](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.tflite) |
45
+ | GoogLeNetQuantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | QNN | 1.155 ms | 0 - 7 MB | INT8 | NPU | Use Export Script |
46
+ | GoogLeNetQuantized | RB5 (Proxy) | QCS8250 Proxy | TFLITE | 5.708 ms | 0 - 2 MB | INT8 | NPU | [GoogLeNetQuantized.tflite](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.tflite) |
47
+ | GoogLeNetQuantized | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 0.289 ms | 0 - 1 MB | INT8 | NPU | [GoogLeNetQuantized.tflite](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.tflite) |
48
+ | GoogLeNetQuantized | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.299 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
49
+ | GoogLeNetQuantized | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 0.278 ms | 0 - 1 MB | INT8 | NPU | [GoogLeNetQuantized.tflite](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.tflite) |
50
+ | GoogLeNetQuantized | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.301 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
51
+ | GoogLeNetQuantized | SA8775 (Proxy) | SA8775P Proxy | TFLITE | 0.29 ms | 0 - 31 MB | INT8 | NPU | [GoogLeNetQuantized.tflite](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.tflite) |
52
+ | GoogLeNetQuantized | SA8775 (Proxy) | SA8775P Proxy | QNN | 0.306 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
53
+ | GoogLeNetQuantized | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 0.352 ms | 0 - 38 MB | INT8 | NPU | [GoogLeNetQuantized.tflite](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.tflite) |
54
+ | GoogLeNetQuantized | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 0.41 ms | 0 - 17 MB | INT8 | NPU | Use Export Script |
55
+ | GoogLeNetQuantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 0.18 ms | 0 - 20 MB | INT8 | NPU | [GoogLeNetQuantized.tflite](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.tflite) |
56
+ | GoogLeNetQuantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.255 ms | 0 - 12 MB | INT8 | NPU | Use Export Script |
57
+ | GoogLeNetQuantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 0.403 ms | 0 - 26 MB | INT8 | NPU | [GoogLeNetQuantized.onnx](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.onnx) |
58
+ | GoogLeNetQuantized | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.409 ms | 0 - 0 MB | INT8 | NPU | Use Export Script |
59
+ | GoogLeNetQuantized | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 0.549 ms | 8 - 8 MB | INT8 | NPU | [GoogLeNetQuantized.onnx](https://huggingface.co/qualcomm/GoogLeNetQuantized/blob/main/GoogLeNetQuantized.onnx) |
60
 
61
 
62
 
 
 
 
 
 
 
63
 
64
  ## Installation
65
 
66
  This model can be installed as a Python package via pip.
67
 
68
  ```bash
69
+ pip install qai-hub-models
70
  ```
71
 
72
 
 
73
  ## Configure Qualcomm® AI Hub to run this model on a cloud-hosted device
74
 
75
  Sign-in to [Qualcomm® AI Hub](https://app.aihub.qualcomm.com/) with your
 
114
  ```bash
115
  python -m qai_hub_models.models.googlenet_quantized.export
116
  ```
117
+ ```
118
+ Profiling Results
119
+ ------------------------------------------------------------
120
+ GoogLeNetQuantized
121
+ Device : Samsung Galaxy S23 (13)
122
+ Runtime : TFLITE
123
+ Estimated inference time (ms) : 0.3
124
+ Estimated peak memory usage (MB): [0, 3]
125
+ Total # Ops : 86
126
+ Compute Unit(s) : NPU (86 ops)
127
+ ```
128
+
129
+
130
+ ## How does this work?
131
+
132
+ This [export script](https://aihub.qualcomm.com/models/googlenet_quantized/qai_hub_models/models/GoogLeNetQuantized/export.py)
133
+ leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
134
+ on-device. Lets go through each step below in detail:
135
+
136
+ Step 1: **Compile model for on-device deployment**
137
+
138
+ To compile a PyTorch model for on-device deployment, we first trace the model
139
+ in memory using the `jit.trace` and then call the `submit_compile_job` API.
140
+
141
+ ```python
142
+ import torch
143
+
144
+ import qai_hub as hub
145
+ from qai_hub_models.models.googlenet_quantized import
146
+
147
+ # Load the model
148
 
149
+ # Device
150
+ device = hub.Device("Samsung Galaxy S23")
151
+
152
+
153
+ ```
154
+
155
+
156
+ Step 2: **Performance profiling on cloud-hosted device**
157
+
158
+ After compiling models from step 1. Models can be profiled model on-device using the
159
+ `target_model`. Note that this scripts runs the model on a device automatically
160
+ provisioned in the cloud. Once the job is submitted, you can navigate to a
161
+ provided job URL to view a variety of on-device performance metrics.
162
+ ```python
163
+ profile_job = hub.submit_profile_job(
164
+ model=target_model,
165
+ device=device,
166
+ )
167
+
168
  ```
 
 
 
 
 
 
169
 
170
+ Step 3: **Verify on-device accuracy**
171
+
172
+ To verify the accuracy of the model on-device, you can run on-device inference
173
+ on sample input data on the same cloud hosted device.
174
+ ```python
175
+ input_data = torch_model.sample_inputs()
176
+ inference_job = hub.submit_inference_job(
177
+ model=target_model,
178
+ device=device,
179
+ inputs=input_data,
180
+ )
181
+ on_device_output = inference_job.download_output_data()
182
 
183
  ```
184
+ With the output of the model, you can compute like PSNR, relative errors or
185
+ spot check the output with expected output.
186
 
187
+ **Note**: This on-device profiling and inference requires access to Qualcomm®
188
+ AI Hub. [Sign up for access](https://myaccount.qualcomm.com/signup).
189
 
190
 
191
 
 
222
  Get more details on GoogLeNetQuantized's performance across various devices [here](https://aihub.qualcomm.com/models/googlenet_quantized).
223
  Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
224
 
225
+
226
  ## License
227
+ * The license for the original implementation of GoogLeNetQuantized can be found [here](https://github.com/pytorch/vision/blob/main/LICENSE).
228
+ * The license for the compiled assets for on-device deployment can be found [here](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/Qualcomm+AI+Hub+Proprietary+License.pdf)
229
+
230
+
231
 
232
  ## References
233
  * [Going Deeper with Convolutions](https://arxiv.org/abs/1409.4842)
234
  * [Source Model Implementation](https://github.com/pytorch/vision/blob/main/torchvision/models/googlenet.py)
235
 
236
+
237
+
238
  ## Community
239
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
240
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).