bhushans commited on
Commit
3ef545f
·
verified ·
1 Parent(s): e3e647d

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +35 -18
README.md CHANGED
@@ -36,21 +36,22 @@ 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
- | VITQuantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 5.485 ms | 0 - 30 MB | INT8 | NPU | [VITQuantized.so](https://huggingface.co/qualcomm/VITQuantized/blob/main/VITQuantized.so) |
40
- | VITQuantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 48.235 ms | 5 - 7 MB | INT8 | NPU | [VITQuantized.onnx](https://huggingface.co/qualcomm/VITQuantized/blob/main/VITQuantized.onnx) |
41
- | VITQuantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 3.643 ms | 0 - 55 MB | INT8 | NPU | [VITQuantized.so](https://huggingface.co/qualcomm/VITQuantized/blob/main/VITQuantized.so) |
42
- | VITQuantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 35.974 ms | 4 - 771 MB | INT8 | NPU | [VITQuantized.onnx](https://huggingface.co/qualcomm/VITQuantized/blob/main/VITQuantized.onnx) |
43
- | VITQuantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 3.428 ms | 0 - 72 MB | INT8 | NPU | Use Export Script |
44
- | VITQuantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 30.672 ms | 2 - 334 MB | INT8 | NPU | [VITQuantized.onnx](https://huggingface.co/qualcomm/VITQuantized/blob/main/VITQuantized.onnx) |
45
- | VITQuantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | QNN | 22.555 ms | 0 - 8 MB | INT8 | NPU | Use Export Script |
46
- | VITQuantized | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 4.961 ms | 0 - 2 MB | INT8 | NPU | Use Export Script |
47
- | VITQuantized | SA8255 (Proxy) | SA8255P Proxy | QNN | 4.972 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
48
- | VITQuantized | SA8775 (Proxy) | SA8775P Proxy | QNN | 4.975 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
49
- | VITQuantized | SA8650 (Proxy) | SA8650P Proxy | QNN | 4.96 ms | 0 - 2 MB | INT8 | NPU | Use Export Script |
50
- | VITQuantized | SA8295P ADP | SA8295P | QNN | 6.969 ms | 0 - 6 MB | INT8 | NPU | Use Export Script |
51
- | VITQuantized | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 6.261 ms | 0 - 58 MB | INT8 | NPU | Use Export Script |
52
- | VITQuantized | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 5.363 ms | 0 - 0 MB | INT8 | NPU | Use Export Script |
53
- | VITQuantized | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 60.097 ms | 226 - 226 MB | INT8 | NPU | [VITQuantized.onnx](https://huggingface.co/qualcomm/VITQuantized/blob/main/VITQuantized.onnx) |
 
54
 
55
 
56
 
@@ -114,8 +115,8 @@ Profiling Results
114
  VITQuantized
115
  Device : Samsung Galaxy S23 (13)
116
  Runtime : QNN
117
- Estimated inference time (ms) : 5.5
118
- Estimated peak memory usage (MB): [0, 30]
119
  Total # Ops : 903
120
  Compute Unit(s) : NPU (903 ops)
121
  ```
@@ -136,13 +137,29 @@ in memory using the `jit.trace` and then call the `submit_compile_job` API.
136
  import torch
137
 
138
  import qai_hub as hub
139
- from qai_hub_models.models.vit_quantized import
140
 
141
  # Load the model
 
142
 
143
  # Device
144
  device = hub.Device("Samsung Galaxy S23")
145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
 
147
  ```
148
 
 
36
 
37
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
38
  |---|---|---|---|---|---|---|---|---|
39
+ | VITQuantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 5.271 ms | 0 - 104 MB | INT8 | NPU | [VITQuantized.so](https://huggingface.co/qualcomm/VITQuantized/blob/main/VITQuantized.so) |
40
+ | VITQuantized | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 52.299 ms | 5 - 8 MB | INT8 | NPU | [VITQuantized.onnx](https://huggingface.co/qualcomm/VITQuantized/blob/main/VITQuantized.onnx) |
41
+ | VITQuantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 3.504 ms | 0 - 44 MB | INT8 | NPU | [VITQuantized.so](https://huggingface.co/qualcomm/VITQuantized/blob/main/VITQuantized.so) |
42
+ | VITQuantized | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 37.032 ms | 3 - 389 MB | INT8 | NPU | [VITQuantized.onnx](https://huggingface.co/qualcomm/VITQuantized/blob/main/VITQuantized.onnx) |
43
+ | VITQuantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 3.283 ms | 0 - 63 MB | INT8 | NPU | Use Export Script |
44
+ | VITQuantized | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 40.661 ms | 3 - 149 MB | INT8 | NPU | [VITQuantized.onnx](https://huggingface.co/qualcomm/VITQuantized/blob/main/VITQuantized.onnx) |
45
+ | VITQuantized | RB3 Gen 2 (Proxy) | QCS6490 Proxy | QNN | 21.635 ms | 0 - 8 MB | INT8 | NPU | Use Export Script |
46
+ | VITQuantized | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 4.739 ms | 0 - 2 MB | INT8 | NPU | Use Export Script |
47
+ | VITQuantized | SA7255P ADP | SA7255P | QNN | 38.83 ms | 0 - 6 MB | INT8 | NPU | Use Export Script |
48
+ | VITQuantized | SA8255 (Proxy) | SA8255P Proxy | QNN | 4.795 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
49
+ | VITQuantized | SA8295P ADP | SA8295P | QNN | 6.823 ms | 0 - 6 MB | INT8 | NPU | Use Export Script |
50
+ | VITQuantized | SA8650 (Proxy) | SA8650P Proxy | QNN | 4.771 ms | 0 - 1 MB | INT8 | NPU | Use Export Script |
51
+ | VITQuantized | SA8775P ADP | SA8775P | QNN | 6.279 ms | 0 - 6 MB | INT8 | NPU | Use Export Script |
52
+ | VITQuantized | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 5.993 ms | 0 - 46 MB | INT8 | NPU | Use Export Script |
53
+ | VITQuantized | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 5.136 ms | 0 - 0 MB | INT8 | NPU | Use Export Script |
54
+ | VITQuantized | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 72.436 ms | 85 - 85 MB | INT8 | NPU | [VITQuantized.onnx](https://huggingface.co/qualcomm/VITQuantized/blob/main/VITQuantized.onnx) |
55
 
56
 
57
 
 
115
  VITQuantized
116
  Device : Samsung Galaxy S23 (13)
117
  Runtime : QNN
118
+ Estimated inference time (ms) : 5.3
119
+ Estimated peak memory usage (MB): [0, 104]
120
  Total # Ops : 903
121
  Compute Unit(s) : NPU (903 ops)
122
  ```
 
137
  import torch
138
 
139
  import qai_hub as hub
140
+ from qai_hub_models.models.vit_quantized import Model
141
 
142
  # Load the model
143
+ torch_model = Model.from_pretrained()
144
 
145
  # Device
146
  device = hub.Device("Samsung Galaxy S23")
147
 
148
+ # Trace model
149
+ input_shape = torch_model.get_input_spec()
150
+ sample_inputs = torch_model.sample_inputs()
151
+
152
+ pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
153
+
154
+ # Compile model on a specific device
155
+ compile_job = hub.submit_compile_job(
156
+ model=pt_model,
157
+ device=device,
158
+ input_specs=torch_model.get_input_spec(),
159
+ )
160
+
161
+ # Get target model to run on-device
162
+ target_model = compile_job.get_target_model()
163
 
164
  ```
165