Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -35,29 +35,31 @@ 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-Base | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE |
|
| 39 |
-
| Swin-Base | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN |
|
| 40 |
-
| Swin-Base | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX |
|
| 41 |
-
| Swin-Base | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE |
|
| 42 |
-
| Swin-Base | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN |
|
| 43 |
-
| Swin-Base | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX |
|
| 44 |
-
| Swin-Base | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 16.
|
| 45 |
-
| Swin-Base | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN |
|
| 46 |
-
| Swin-Base | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX |
|
| 47 |
-
| Swin-Base | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE |
|
| 48 |
-
| Swin-Base | QCS8550 (Proxy) | QCS8550 Proxy | QNN |
|
| 49 |
-
| Swin-Base |
|
| 50 |
-
| Swin-Base |
|
| 51 |
-
| Swin-Base |
|
| 52 |
-
| Swin-Base |
|
| 53 |
-
| Swin-Base |
|
| 54 |
-
| Swin-Base |
|
| 55 |
-
| Swin-Base |
|
| 56 |
-
| Swin-Base |
|
| 57 |
-
| Swin-Base |
|
| 58 |
-
| Swin-Base |
|
| 59 |
-
| Swin-Base |
|
| 60 |
-
| Swin-Base |
|
|
|
|
|
|
|
| 61 |
|
| 62 |
|
| 63 |
|
|
@@ -121,8 +123,8 @@ Profiling Results
|
|
| 121 |
Swin-Base
|
| 122 |
Device : Samsung Galaxy S23 (13)
|
| 123 |
Runtime : TFLITE
|
| 124 |
-
Estimated inference time (ms) :
|
| 125 |
-
Estimated peak memory usage (MB): [0,
|
| 126 |
Total # Ops : 1568
|
| 127 |
Compute Unit(s) : NPU (1568 ops)
|
| 128 |
```
|
|
@@ -143,13 +145,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_base 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-Base | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 26.392 ms | 0 - 40 MB | FP16 | NPU | [Swin-Base.tflite](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.tflite) |
|
| 39 |
+
| Swin-Base | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 26.202 ms | 0 - 46 MB | FP16 | NPU | [Swin-Base.so](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.so) |
|
| 40 |
+
| Swin-Base | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 43.136 ms | 0 - 194 MB | FP16 | NPU | [Swin-Base.onnx](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.onnx) |
|
| 41 |
+
| Swin-Base | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 18.329 ms | 0 - 201 MB | FP16 | NPU | [Swin-Base.tflite](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.tflite) |
|
| 42 |
+
| Swin-Base | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 17.993 ms | 0 - 201 MB | FP16 | NPU | [Swin-Base.so](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.so) |
|
| 43 |
+
| Swin-Base | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 29.943 ms | 1 - 802 MB | FP16 | NPU | [Swin-Base.onnx](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.onnx) |
|
| 44 |
+
| Swin-Base | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 16.682 ms | 0 - 202 MB | FP16 | NPU | [Swin-Base.tflite](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.tflite) |
|
| 45 |
+
| Swin-Base | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 16.586 ms | 0 - 208 MB | FP16 | NPU | Use Export Script |
|
| 46 |
+
| Swin-Base | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 27.271 ms | 0 - 300 MB | FP16 | NPU | [Swin-Base.onnx](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.onnx) |
|
| 47 |
+
| Swin-Base | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 26.291 ms | 0 - 43 MB | FP16 | NPU | [Swin-Base.tflite](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.tflite) |
|
| 48 |
+
| Swin-Base | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 23.602 ms | 1 - 2 MB | FP16 | NPU | Use Export Script |
|
| 49 |
+
| Swin-Base | SA7255P ADP | SA7255P | TFLITE | 307.272 ms | 0 - 205 MB | FP16 | NPU | [Swin-Base.tflite](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.tflite) |
|
| 50 |
+
| Swin-Base | SA7255P ADP | SA7255P | QNN | 303.06 ms | 1 - 6 MB | FP16 | NPU | Use Export Script |
|
| 51 |
+
| Swin-Base | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 26.172 ms | 0 - 45 MB | FP16 | NPU | [Swin-Base.tflite](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.tflite) |
|
| 52 |
+
| Swin-Base | SA8255 (Proxy) | SA8255P Proxy | QNN | 23.641 ms | 1 - 2 MB | FP16 | NPU | Use Export Script |
|
| 53 |
+
| Swin-Base | SA8295P ADP | SA8295P | TFLITE | 36.807 ms | 0 - 191 MB | FP16 | NPU | [Swin-Base.tflite](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.tflite) |
|
| 54 |
+
| Swin-Base | SA8295P ADP | SA8295P | QNN | 34.696 ms | 1 - 6 MB | FP16 | NPU | Use Export Script |
|
| 55 |
+
| Swin-Base | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 26.369 ms | 0 - 45 MB | FP16 | NPU | [Swin-Base.tflite](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.tflite) |
|
| 56 |
+
| Swin-Base | SA8650 (Proxy) | SA8650P Proxy | QNN | 23.763 ms | 1 - 2 MB | FP16 | NPU | Use Export Script |
|
| 57 |
+
| Swin-Base | SA8775P ADP | SA8775P | TFLITE | 35.687 ms | 0 - 206 MB | FP16 | NPU | [Swin-Base.tflite](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.tflite) |
|
| 58 |
+
| Swin-Base | SA8775P ADP | SA8775P | QNN | 33.079 ms | 0 - 5 MB | FP16 | NPU | Use Export Script |
|
| 59 |
+
| Swin-Base | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 33.515 ms | 0 - 192 MB | FP16 | NPU | [Swin-Base.tflite](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.tflite) |
|
| 60 |
+
| Swin-Base | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 33.69 ms | 1 - 189 MB | FP16 | NPU | Use Export Script |
|
| 61 |
+
| Swin-Base | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 24.377 ms | 1 - 1 MB | FP16 | NPU | Use Export Script |
|
| 62 |
+
| Swin-Base | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 50.182 ms | 175 - 175 MB | FP16 | NPU | [Swin-Base.onnx](https://huggingface.co/qualcomm/Swin-Base/blob/main/Swin-Base.onnx) |
|
| 63 |
|
| 64 |
|
| 65 |
|
|
|
|
| 123 |
Swin-Base
|
| 124 |
Device : Samsung Galaxy S23 (13)
|
| 125 |
Runtime : TFLITE
|
| 126 |
+
Estimated inference time (ms) : 26.4
|
| 127 |
+
Estimated peak memory usage (MB): [0, 40]
|
| 128 |
Total # Ops : 1568
|
| 129 |
Compute Unit(s) : NPU (1568 ops)
|
| 130 |
```
|
|
|
|
| 145 |
import torch
|
| 146 |
|
| 147 |
import qai_hub as hub
|
| 148 |
+
from qai_hub_models.models.swin_base import Model
|
| 149 |
|
| 150 |
# Load the model
|
| 151 |
+
torch_model = Model.from_pretrained()
|
| 152 |
|
| 153 |
# Device
|
| 154 |
device = hub.Device("Samsung Galaxy S23")
|
| 155 |
|
| 156 |
+
# Trace model
|
| 157 |
+
input_shape = torch_model.get_input_spec()
|
| 158 |
+
sample_inputs = torch_model.sample_inputs()
|
| 159 |
+
|
| 160 |
+
pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
|
| 161 |
+
|
| 162 |
+
# Compile model on a specific device
|
| 163 |
+
compile_job = hub.submit_compile_job(
|
| 164 |
+
model=pt_model,
|
| 165 |
+
device=device,
|
| 166 |
+
input_specs=torch_model.get_input_spec(),
|
| 167 |
+
)
|
| 168 |
+
|
| 169 |
+
# Get target model to run on-device
|
| 170 |
+
target_model = compile_job.get_target_model()
|
| 171 |
|
| 172 |
```
|
| 173 |
|