bhushans commited on
Commit
a5f97d4
·
verified ·
1 Parent(s): 401023c

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +41 -23
README.md CHANGED
@@ -36,29 +36,31 @@ More details on model performance across various devices, can be found
36
 
37
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
38
  |---|---|---|---|---|---|---|---|---|
39
- | ResNet18Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 0.406 ms | 0 - 59 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
40
  | ResNet18Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.632 ms | 0 - 8 MB | INT8 | NPU | [ResNet18Quantized.so](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.so) |
41
- | ResNet18Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.32 ms | 0 - 27 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
42
- | ResNet18Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.476 ms | 0 - 12 MB | INT8 | NPU | [ResNet18Quantized.so](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.so) |
43
- | ResNet18Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 0.292 ms | 0 - 15 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
44
- | ResNet18Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.45 ms | 0 - 10 MB | INT8 | NPU | Use Export Script |
45
- | ResNet18Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | TFLITE | 1.573 ms | 0 - 17 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
46
- | ResNet18Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | QNN | 2.14 ms | 0 - 8 MB | INT8 | NPU | Use Export Script |
47
- | ResNet18Quantized | RB5 (Proxy) | QCS8250 Proxy | TFLITE | 7.062 ms | 0 - 7 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
48
- | ResNet18Quantized | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 0.408 ms | 0 - 1 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
49
- | ResNet18Quantized | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.599 ms | 0 - 2 MB | INT8 | NPU | Use Export Script |
50
- | ResNet18Quantized | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 0.406 ms | 0 - 1 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
51
- | ResNet18Quantized | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.604 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
52
- | ResNet18Quantized | SA8775 (Proxy) | SA8775P Proxy | TFLITE | 0.401 ms | 0 - 1 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
53
- | ResNet18Quantized | SA8775 (Proxy) | SA8775P Proxy | QNN | 0.598 ms | 0 - 2 MB | INT8 | NPU | Use Export Script |
54
- | ResNet18Quantized | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 0.41 ms | 0 - 1 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
 
 
55
  | ResNet18Quantized | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.601 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
56
- | ResNet18Quantized | SA8295P ADP | SA8295P | TFLITE | 0.795 ms | 0 - 15 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
57
- | ResNet18Quantized | SA8295P ADP | SA8295P | QNN | 1.084 ms | 0 - 6 MB | INT8 | NPU | Use Export Script |
58
- | ResNet18Quantized | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 0.475 ms | 0 - 26 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
59
- | ResNet18Quantized | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 0.7 ms | 0 - 14 MB | INT8 | NPU | Use Export Script |
60
- | ResNet18Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.685 ms | 0 - 0 MB | INT8 | NPU | Use Export Script |
61
- | ResNet18Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 104.85 ms | 116 - 116 MB | INT8 | NPU | [ResNet18Quantized.onnx](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.onnx) |
62
 
63
 
64
 
@@ -123,7 +125,7 @@ ResNet18Quantized
123
  Device : Samsung Galaxy S23 (13)
124
  Runtime : TFLITE
125
  Estimated inference time (ms) : 0.4
126
- Estimated peak memory usage (MB): [0, 59]
127
  Total # Ops : 41
128
  Compute Unit(s) : NPU (41 ops)
129
  ```
@@ -144,13 +146,29 @@ in memory using the `jit.trace` and then call the `submit_compile_job` API.
144
  import torch
145
 
146
  import qai_hub as hub
147
- from qai_hub_models.models.resnet18_quantized import
148
 
149
  # Load the model
 
150
 
151
  # Device
152
  device = hub.Device("Samsung Galaxy S23")
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
 
155
  ```
156
 
 
36
 
37
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
38
  |---|---|---|---|---|---|---|---|---|
39
+ | ResNet18Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 0.403 ms | 0 - 149 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
40
  | ResNet18Quantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 0.632 ms | 0 - 8 MB | INT8 | NPU | [ResNet18Quantized.so](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.so) |
41
+ | ResNet18Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 0.308 ms | 0 - 15 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
42
+ | ResNet18Quantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 0.48 ms | 0 - 13 MB | INT8 | NPU | [ResNet18Quantized.so](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.so) |
43
+ | ResNet18Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 0.303 ms | 0 - 9 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
44
+ | ResNet18Quantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 0.441 ms | 0 - 10 MB | INT8 | NPU | Use Export Script |
45
+ | ResNet18Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | TFLITE | 1.366 ms | 0 - 13 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
46
+ | ResNet18Quantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | QNN | 2.024 ms | 0 - 7 MB | INT8 | NPU | Use Export Script |
47
+ | ResNet18Quantized | RB5 (Proxy) | QCS8250 Proxy | TFLITE | 7.058 ms | 0 - 7 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
48
+ | ResNet18Quantized | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 0.408 ms | 0 - 8 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
49
+ | ResNet18Quantized | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 0.601 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
50
+ | ResNet18Quantized | SA7255P ADP | SA7255P | TFLITE | 4.37 ms | 0 - 10 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
51
+ | ResNet18Quantized | SA7255P ADP | SA7255P | QNN | 5.053 ms | 0 - 5 MB | INT8 | NPU | Use Export Script |
52
+ | ResNet18Quantized | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 0.407 ms | 0 - 8 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
53
+ | ResNet18Quantized | SA8255 (Proxy) | SA8255P Proxy | QNN | 0.602 ms | 0 - 2 MB | INT8 | NPU | Use Export Script |
54
+ | ResNet18Quantized | SA8295P ADP | SA8295P | TFLITE | 0.777 ms | 0 - 9 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
55
+ | ResNet18Quantized | SA8295P ADP | SA8295P | QNN | 1.094 ms | 0 - 6 MB | INT8 | NPU | Use Export Script |
56
+ | ResNet18Quantized | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 0.41 ms | 0 - 135 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
57
  | ResNet18Quantized | SA8650 (Proxy) | SA8650P Proxy | QNN | 0.601 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
58
+ | ResNet18Quantized | SA8775P ADP | SA8775P | TFLITE | 0.688 ms | 0 - 8 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
59
+ | ResNet18Quantized | SA8775P ADP | SA8775P | QNN | 1.031 ms | 0 - 6 MB | INT8 | NPU | Use Export Script |
60
+ | ResNet18Quantized | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 0.479 ms | 0 - 16 MB | INT8 | NPU | [ResNet18Quantized.tflite](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.tflite) |
61
+ | ResNet18Quantized | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 0.707 ms | 0 - 13 MB | INT8 | NPU | Use Export Script |
62
+ | ResNet18Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 0.678 ms | 1 - 1 MB | INT8 | NPU | Use Export Script |
63
+ | ResNet18Quantized | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 109.769 ms | 116 - 116 MB | INT8 | NPU | [ResNet18Quantized.onnx](https://huggingface.co/qualcomm/ResNet18Quantized/blob/main/ResNet18Quantized.onnx) |
64
 
65
 
66
 
 
125
  Device : Samsung Galaxy S23 (13)
126
  Runtime : TFLITE
127
  Estimated inference time (ms) : 0.4
128
+ Estimated peak memory usage (MB): [0, 149]
129
  Total # Ops : 41
130
  Compute Unit(s) : NPU (41 ops)
131
  ```
 
146
  import torch
147
 
148
  import qai_hub as hub
149
+ from qai_hub_models.models.resnet18_quantized import Model
150
 
151
  # Load the model
152
+ torch_model = Model.from_pretrained()
153
 
154
  # Device
155
  device = hub.Device("Samsung Galaxy S23")
156
 
157
+ # Trace model
158
+ input_shape = torch_model.get_input_spec()
159
+ sample_inputs = torch_model.sample_inputs()
160
+
161
+ pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
162
+
163
+ # Compile model on a specific device
164
+ compile_job = hub.submit_compile_job(
165
+ model=pt_model,
166
+ device=device,
167
+ input_specs=torch_model.get_input_spec(),
168
+ )
169
+
170
+ # Get target model to run on-device
171
+ target_model = compile_job.get_target_model()
172
 
173
  ```
174