bhushans commited on
Commit
ff68173
·
verified ·
1 Parent(s): a1f5c7b

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +34 -17
README.md CHANGED
@@ -35,20 +35,21 @@ 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
- | FastSam-X | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 46.347 ms | 4 - 22 MB | FP16 | NPU | [FastSam-X.so](https://huggingface.co/qualcomm/FastSam-X/blob/main/FastSam-X.so) |
39
- | FastSam-X | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 48.131 ms | 0 - 1260 MB | FP16 | NPU | [FastSam-X.onnx](https://huggingface.co/qualcomm/FastSam-X/blob/main/FastSam-X.onnx) |
40
- | FastSam-X | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 34.644 ms | 5 - 64 MB | FP16 | NPU | [FastSam-X.so](https://huggingface.co/qualcomm/FastSam-X/blob/main/FastSam-X.so) |
41
- | FastSam-X | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 34.945 ms | 0 - 157 MB | FP16 | NPU | [FastSam-X.onnx](https://huggingface.co/qualcomm/FastSam-X/blob/main/FastSam-X.onnx) |
42
- | FastSam-X | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 27.041 ms | 5 - 63 MB | FP16 | NPU | Use Export Script |
43
- | FastSam-X | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 31.76 ms | 0 - 76 MB | FP16 | NPU | [FastSam-X.onnx](https://huggingface.co/qualcomm/FastSam-X/blob/main/FastSam-X.onnx) |
44
- | FastSam-X | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 43.152 ms | 5 - 6 MB | FP16 | NPU | Use Export Script |
45
- | FastSam-X | SA8255 (Proxy) | SA8255P Proxy | QNN | 43.517 ms | 5 - 6 MB | FP16 | NPU | Use Export Script |
46
- | FastSam-X | SA8775 (Proxy) | SA8775P Proxy | QNN | 43.704 ms | 5 - 8 MB | FP16 | NPU | Use Export Script |
47
- | FastSam-X | SA8650 (Proxy) | SA8650P Proxy | QNN | 43.486 ms | 5 - 6 MB | FP16 | NPU | Use Export Script |
48
- | FastSam-X | SA8295P ADP | SA8295P | QNN | 83.059 ms | 0 - 5 MB | FP16 | NPU | Use Export Script |
49
- | FastSam-X | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 88.07 ms | 4 - 65 MB | FP16 | NPU | Use Export Script |
50
- | FastSam-X | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 44.416 ms | 5 - 5 MB | FP16 | NPU | Use Export Script |
51
- | FastSam-X | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 49.553 ms | 139 - 139 MB | FP16 | NPU | [FastSam-X.onnx](https://huggingface.co/qualcomm/FastSam-X/blob/main/FastSam-X.onnx) |
 
52
 
53
 
54
 
@@ -113,8 +114,8 @@ Profiling Results
113
  FastSam-X
114
  Device : Samsung Galaxy S23 (13)
115
  Runtime : QNN
116
- Estimated inference time (ms) : 46.3
117
- Estimated peak memory usage (MB): [4, 22]
118
  Total # Ops : 418
119
  Compute Unit(s) : NPU (418 ops)
120
  ```
@@ -135,13 +136,29 @@ in memory using the `jit.trace` and then call the `submit_compile_job` API.
135
  import torch
136
 
137
  import qai_hub as hub
138
- from qai_hub_models.models.fastsam_x import
139
 
140
  # Load the model
 
141
 
142
  # Device
143
  device = hub.Device("Samsung Galaxy S23")
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
 
146
  ```
147
 
 
35
 
36
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
37
  |---|---|---|---|---|---|---|---|---|
38
+ | FastSam-X | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | QNN | 45.029 ms | 5 - 20 MB | FP16 | NPU | [FastSam-X.so](https://huggingface.co/qualcomm/FastSam-X/blob/main/FastSam-X.so) |
39
+ | FastSam-X | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 46.786 ms | 0 - 157 MB | FP16 | NPU | [FastSam-X.onnx](https://huggingface.co/qualcomm/FastSam-X/blob/main/FastSam-X.onnx) |
40
+ | FastSam-X | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | QNN | 34.74 ms | 5 - 66 MB | FP16 | NPU | [FastSam-X.so](https://huggingface.co/qualcomm/FastSam-X/blob/main/FastSam-X.so) |
41
+ | FastSam-X | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 35.254 ms | 14 - 173 MB | FP16 | NPU | [FastSam-X.onnx](https://huggingface.co/qualcomm/FastSam-X/blob/main/FastSam-X.onnx) |
42
+ | FastSam-X | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | QNN | 30.954 ms | 3 - 61 MB | FP16 | NPU | Use Export Script |
43
+ | FastSam-X | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 31.566 ms | 15 - 92 MB | FP16 | NPU | [FastSam-X.onnx](https://huggingface.co/qualcomm/FastSam-X/blob/main/FastSam-X.onnx) |
44
+ | FastSam-X | QCS8550 (Proxy) | QCS8550 Proxy | QNN | 42.922 ms | 5 - 6 MB | FP16 | NPU | Use Export Script |
45
+ | FastSam-X | SA7255P ADP | SA7255P | QNN | 2095.966 ms | 4 - 9 MB | FP16 | NPU | Use Export Script |
46
+ | FastSam-X | SA8255 (Proxy) | SA8255P Proxy | QNN | 44.325 ms | 5 - 10 MB | FP16 | NPU | Use Export Script |
47
+ | FastSam-X | SA8295P ADP | SA8295P | QNN | 82.797 ms | 1 - 7 MB | FP16 | NPU | Use Export Script |
48
+ | FastSam-X | SA8650 (Proxy) | SA8650P Proxy | QNN | 43.338 ms | 5 - 6 MB | FP16 | NPU | Use Export Script |
49
+ | FastSam-X | SA8775P ADP | SA8775P | QNN | 85.641 ms | 1 - 7 MB | FP16 | NPU | Use Export Script |
50
+ | FastSam-X | QCS8450 (Proxy) | QCS8450 Proxy | QNN | 89.247 ms | 4 - 61 MB | FP16 | NPU | Use Export Script |
51
+ | FastSam-X | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN | 44.45 ms | 5 - 5 MB | FP16 | NPU | Use Export Script |
52
+ | FastSam-X | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 49.475 ms | 139 - 139 MB | FP16 | NPU | [FastSam-X.onnx](https://huggingface.co/qualcomm/FastSam-X/blob/main/FastSam-X.onnx) |
53
 
54
 
55
 
 
114
  FastSam-X
115
  Device : Samsung Galaxy S23 (13)
116
  Runtime : QNN
117
+ Estimated inference time (ms) : 45.0
118
+ Estimated peak memory usage (MB): [5, 20]
119
  Total # Ops : 418
120
  Compute Unit(s) : NPU (418 ops)
121
  ```
 
136
  import torch
137
 
138
  import qai_hub as hub
139
+ from qai_hub_models.models.fastsam_x import Model
140
 
141
  # Load the model
142
+ torch_model = Model.from_pretrained()
143
 
144
  # Device
145
  device = hub.Device("Samsung Galaxy S23")
146
 
147
+ # Trace model
148
+ input_shape = torch_model.get_input_spec()
149
+ sample_inputs = torch_model.sample_inputs()
150
+
151
+ pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
152
+
153
+ # Compile model on a specific device
154
+ compile_job = hub.submit_compile_job(
155
+ model=pt_model,
156
+ device=device,
157
+ input_specs=torch_model.get_input_spec(),
158
+ )
159
+
160
+ # Get target model to run on-device
161
+ target_model = compile_job.get_target_model()
162
 
163
  ```
164