bhushans commited on
Commit
ef5f828
1 Parent(s): c4cc12c

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +41 -26
README.md CHANGED
@@ -35,29 +35,28 @@ 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
- | Swin-Small | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 18.792 ms | 0 - 3 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
39
- | Swin-Small | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 21.109 ms | 0 - 40 MB | FP16 | NPU | [Swin-Small.so](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.so) |
40
- | Swin-Small | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 34.188 ms | 0 - 130 MB | FP16 | NPU | [Swin-Small.onnx](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.onnx) |
41
- | Swin-Small | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 12.781 ms | 0 - 528 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
42
- | Swin-Small | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 14.548 ms | 0 - 161 MB | FP16 | NPU | [Swin-Small.so](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.so) |
43
- | Swin-Small | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 23.63 ms | 1 - 787 MB | FP16 | NPU | [Swin-Small.onnx](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.onnx) |
44
- | Swin-Small | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 9.771 ms | 0 - 231 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
45
- | Swin-Small | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 12.58 ms | 1 - 161 MB | FP16 | NPU | Use Export Script |
46
- | Swin-Small | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 20.44 ms | 0 - 318 MB | FP16 | NPU | [Swin-Small.onnx](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.onnx) |
47
- | Swin-Small | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 18.668 ms | 0 - 3 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
48
- | Swin-Small | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 20.113 ms | 1 - 2 MB | FP16 | NPU | Use Export Script |
49
- | Swin-Small | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 18.669 ms | 0 - 3 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
50
- | Swin-Small | SA8255 (Proxy) | SA8255P Proxy | QNN | 20.593 ms | 1 - 2 MB | FP16 | NPU | Use Export Script |
51
- | Swin-Small | SA8775 (Proxy) | SA8775P Proxy | TFLITE | 18.712 ms | 0 - 3 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
52
- | Swin-Small | SA8775 (Proxy) | SA8775P Proxy | QNN | 20.645 ms | 1 - 2 MB | FP16 | NPU | Use Export Script |
53
- | Swin-Small | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 18.756 ms | 0 - 3 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
54
- | Swin-Small | SA8650 (Proxy) | SA8650P Proxy | QNN | 20.743 ms | 1 - 2 MB | FP16 | NPU | Use Export Script |
55
- | Swin-Small | SA8295P ADP | SA8295P | TFLITE | 26.993 ms | 0 - 215 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
56
- | Swin-Small | SA8295P ADP | SA8295P | QNN | 28.889 ms | 1 - 6 MB | FP16 | NPU | Use Export Script |
57
- | Swin-Small | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 24.173 ms | 0 - 510 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
58
- | Swin-Small | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 25.947 ms | 1 - 156 MB | FP16 | NPU | Use Export Script |
59
- | Swin-Small | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 21.225 ms | 1 - 1 MB | FP16 | NPU | Use Export Script |
60
- | Swin-Small | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 37.962 ms | 118 - 118 MB | FP16 | NPU | [Swin-Small.onnx](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.onnx) |
61
 
62
 
63
 
@@ -121,8 +120,8 @@ Profiling Results
121
  Swin-Small
122
  Device : Samsung Galaxy S23 (13)
123
  Runtime : TFLITE
124
- Estimated inference time (ms) : 18.8
125
- Estimated peak memory usage (MB): [0, 3]
126
  Total # Ops : 1563
127
  Compute Unit(s) : NPU (1563 ops)
128
  ```
@@ -143,13 +142,29 @@ in memory using the `jit.trace` and then call the `submit_compile_job` API.
143
  import torch
144
 
145
  import qai_hub as hub
146
- from qai_hub_models.models.swin_small import
147
 
148
  # Load the model
 
149
 
150
  # Device
151
  device = hub.Device("Samsung Galaxy S23")
152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
 
154
  ```
155
 
 
35
 
36
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
37
  |---|---|---|---|---|---|---|---|---|
38
+ | Swin-Small | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 19.274 ms | 0 - 39 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
39
+ | Swin-Small | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 19.387 ms | 0 - 39 MB | FP16 | NPU | [Swin-Small.so](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.so) |
40
+ | Swin-Small | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 31.28 ms | 0 - 114 MB | FP16 | NPU | [Swin-Small.onnx](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.onnx) |
41
+ | Swin-Small | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 13.075 ms | 0 - 160 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
42
+ | Swin-Small | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 12.854 ms | 0 - 160 MB | FP16 | NPU | [Swin-Small.so](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.so) |
43
+ | Swin-Small | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 21.0 ms | 1 - 750 MB | FP16 | NPU | [Swin-Small.onnx](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.onnx) |
44
+ | Swin-Small | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 10.193 ms | 0 - 162 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
45
+ | Swin-Small | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 11.813 ms | 0 - 168 MB | FP16 | NPU | Use Export Script |
46
+ | Swin-Small | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 19.323 ms | 0 - 40 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
47
+ | Swin-Small | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 17.41 ms | 1 - 2 MB | FP16 | NPU | Use Export Script |
48
+ | Swin-Small | SA7255P ADP | SA7255P | TFLITE | 181.559 ms | 0 - 165 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
49
+ | Swin-Small | SA7255P ADP | SA7255P | QNN | 177.676 ms | 1 - 8 MB | FP16 | NPU | Use Export Script |
50
+ | Swin-Small | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 19.365 ms | 0 - 39 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
51
+ | Swin-Small | SA8255 (Proxy) | SA8255P Proxy | QNN | 17.659 ms | 1 - 2 MB | FP16 | NPU | Use Export Script |
52
+ | Swin-Small | SA8295P ADP | SA8295P | TFLITE | 27.412 ms | 0 - 154 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
53
+ | Swin-Small | SA8295P ADP | SA8295P | QNN | 25.482 ms | 1 - 6 MB | FP16 | NPU | Use Export Script |
54
+ | Swin-Small | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 19.368 ms | 0 - 38 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
55
+ | Swin-Small | SA8650 (Proxy) | SA8650P Proxy | QNN | 17.645 ms | 1 - 2 MB | FP16 | NPU | Use Export Script |
56
+ | Swin-Small | SA8775P ADP | SA8775P | TFLITE | 26.082 ms | 0 - 165 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
57
+ | Swin-Small | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 24.588 ms | 0 - 155 MB | FP16 | NPU | [Swin-Small.tflite](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.tflite) |
58
+ | Swin-Small | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 24.434 ms | 1 - 157 MB | FP16 | NPU | Use Export Script |
59
+ | Swin-Small | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 37.922 ms | 100 - 100 MB | FP16 | NPU | [Swin-Small.onnx](https://huggingface.co/qualcomm/Swin-Small/blob/main/Swin-Small.onnx) |
 
60
 
61
 
62
 
 
120
  Swin-Small
121
  Device : Samsung Galaxy S23 (13)
122
  Runtime : TFLITE
123
+ Estimated inference time (ms) : 19.3
124
+ Estimated peak memory usage (MB): [0, 39]
125
  Total # Ops : 1563
126
  Compute Unit(s) : NPU (1563 ops)
127
  ```
 
142
  import torch
143
 
144
  import qai_hub as hub
145
+ from qai_hub_models.models.swin_small import Model
146
 
147
  # Load the model
148
+ torch_model = Model.from_pretrained()
149
 
150
  # Device
151
  device = hub.Device("Samsung Galaxy S23")
152
 
153
+ # Trace model
154
+ input_shape = torch_model.get_input_spec()
155
+ sample_inputs = torch_model.sample_inputs()
156
+
157
+ pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
158
+
159
+ # Compile model on a specific device
160
+ compile_job = hub.submit_compile_job(
161
+ model=pt_model,
162
+ device=device,
163
+ input_specs=torch_model.get_input_spec(),
164
+ )
165
+
166
+ # Get target model to run on-device
167
+ target_model = compile_job.get_target_model()
168
 
169
  ```
170