bhushans commited on
Commit
9870567
·
verified ·
1 Parent(s): d414da7

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +33 -16
README.md CHANGED
@@ -35,19 +35,20 @@ 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
- | VIT | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 20.106 ms | 0 - 3 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
39
- | VIT | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 15.399 ms | 0 - 193 MB | FP16 | NPU | [VIT.onnx](https://huggingface.co/qualcomm/VIT/blob/main/VIT.onnx) |
40
- | VIT | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 14.711 ms | 0 - 384 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
41
- | VIT | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 11.118 ms | 1 - 150 MB | FP16 | NPU | [VIT.onnx](https://huggingface.co/qualcomm/VIT/blob/main/VIT.onnx) |
42
- | VIT | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 13.71 ms | 0 - 208 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
43
- | VIT | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 10.634 ms | 1 - 112 MB | FP16 | NPU | [VIT.onnx](https://huggingface.co/qualcomm/VIT/blob/main/VIT.onnx) |
44
- | VIT | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 19.818 ms | 0 - 3 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
45
- | VIT | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 20.416 ms | 0 - 3 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
46
- | VIT | SA8775 (Proxy) | SA8775P Proxy | TFLITE | 20.342 ms | 0 - 3 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
47
- | VIT | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 19.95 ms | 0 - 3 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
48
- | VIT | SA8295P ADP | SA8295P | TFLITE | 27.983 ms | 0 - 192 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
49
- | VIT | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 25.148 ms | 0 - 365 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
50
- | VIT | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 21.682 ms | 171 - 171 MB | FP16 | NPU | [VIT.onnx](https://huggingface.co/qualcomm/VIT/blob/main/VIT.onnx) |
 
51
 
52
 
53
 
@@ -111,8 +112,8 @@ Profiling Results
111
  VIT
112
  Device : Samsung Galaxy S23 (13)
113
  Runtime : TFLITE
114
- Estimated inference time (ms) : 20.1
115
- Estimated peak memory usage (MB): [0, 3]
116
  Total # Ops : 1579
117
  Compute Unit(s) : NPU (1579 ops)
118
  ```
@@ -133,13 +134,29 @@ in memory using the `jit.trace` and then call the `submit_compile_job` API.
133
  import torch
134
 
135
  import qai_hub as hub
136
- from qai_hub_models.models.vit import
137
 
138
  # Load the model
 
139
 
140
  # Device
141
  device = hub.Device("Samsung Galaxy S23")
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
 
144
  ```
145
 
 
35
 
36
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
37
  |---|---|---|---|---|---|---|---|---|
38
+ | VIT | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 17.366 ms | 0 - 41 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
39
+ | VIT | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 14.796 ms | 0 - 193 MB | FP16 | NPU | [VIT.onnx](https://huggingface.co/qualcomm/VIT/blob/main/VIT.onnx) |
40
+ | VIT | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 12.003 ms | 101 - 158 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
41
+ | VIT | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 10.637 ms | 0 - 101 MB | FP16 | NPU | [VIT.onnx](https://huggingface.co/qualcomm/VIT/blob/main/VIT.onnx) |
42
+ | VIT | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 11.388 ms | 0 - 59 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
43
+ | VIT | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 10.273 ms | 0 - 73 MB | FP16 | NPU | [VIT.onnx](https://huggingface.co/qualcomm/VIT/blob/main/VIT.onnx) |
44
+ | VIT | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 16.928 ms | 0 - 47 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
45
+ | VIT | SA7255P ADP | SA7255P | TFLITE | 258.719 ms | 0 - 58 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
46
+ | VIT | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 17.288 ms | 0 - 41 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
47
+ | VIT | SA8295P ADP | SA8295P | TFLITE | 27.633 ms | 0 - 53 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
48
+ | VIT | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 17.409 ms | 0 - 44 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
49
+ | VIT | SA8775P ADP | SA8775P | TFLITE | 24.636 ms | 0 - 58 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
50
+ | VIT | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 24.509 ms | 0 - 54 MB | FP16 | NPU | [VIT.tflite](https://huggingface.co/qualcomm/VIT/blob/main/VIT.tflite) |
51
+ | VIT | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 20.418 ms | 170 - 170 MB | FP16 | NPU | [VIT.onnx](https://huggingface.co/qualcomm/VIT/blob/main/VIT.onnx) |
52
 
53
 
54
 
 
112
  VIT
113
  Device : Samsung Galaxy S23 (13)
114
  Runtime : TFLITE
115
+ Estimated inference time (ms) : 17.4
116
+ Estimated peak memory usage (MB): [0, 41]
117
  Total # Ops : 1579
118
  Compute Unit(s) : NPU (1579 ops)
119
  ```
 
134
  import torch
135
 
136
  import qai_hub as hub
137
+ from qai_hub_models.models.vit import Model
138
 
139
  # Load the model
140
+ torch_model = Model.from_pretrained()
141
 
142
  # Device
143
  device = hub.Device("Samsung Galaxy S23")
144
 
145
+ # Trace model
146
+ input_shape = torch_model.get_input_spec()
147
+ sample_inputs = torch_model.sample_inputs()
148
+
149
+ pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
150
+
151
+ # Compile model on a specific device
152
+ compile_job = hub.submit_compile_job(
153
+ model=pt_model,
154
+ device=device,
155
+ input_specs=torch_model.get_input_spec(),
156
+ )
157
+
158
+ # Get target model to run on-device
159
+ target_model = compile_job.get_target_model()
160
 
161
  ```
162