-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathvit_qnn_fp32_ctx.json
More file actions
115 lines (115 loc) · 4.58 KB
/
Copy pathvit_qnn_fp32_ctx.json
File metadata and controls
115 lines (115 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{
"input_model": {
"type": "HfModel",
"model_path": "google/vit-base-patch16-224",
"task": "image-classification",
"io_config": {
"input_names": [ "pixel_values" ],
"input_shapes": [ [ 1, 3, 224, 224 ] ],
"output_names": [ "logits" ]
}
},
"systems": {
"qnn_system": {
"type": "LocalSystem",
"accelerators": [ { "device": "npu", "execution_providers": [ "QNNExecutionProvider" ] } ]
}
},
"data_configs": [
{
"name": "quantize_data_config",
"type": "HuggingfaceContainer",
"user_script": "imagenet.py",
"load_dataset_config": {
"data_name": "imagenet-1k",
"split": "validation",
"streaming": true,
"trust_remote_code": true
},
"pre_process_data_config": { "type": "dataset_pre_process", "size": 256, "cache_key": "imagenet256" },
"post_process_data_config": { "type": "dataset_post_process" }
}
],
"evaluators": {
"common_evaluator": {
"metrics": [
{
"name": "accuracy_qnn",
"type": "accuracy",
"data_config": "quantize_data_config",
"sub_types": [
{
"name": "accuracy_score",
"priority": 1,
"metric_config": { "task": "multiclass", "num_classes": 1000 }
}
],
"user_config": {
"inference_settings": {
"onnx": {
"session_options": {
"extra_session_config": { "session.disable_cpu_ep_fallback": "0" }
},
"execution_provider": "QNNExecutionProvider",
"provider_options": [
{
"backend_path": "QnnHtp.dll",
"htp_performance_mode": "burst",
"htp_graph_finalization_optimization_mode": "3",
"enable_htp_fp16_precision": "1"
}
]
}
}
}
},
{
"name": "latency_qnn",
"type": "latency",
"data_config": "quantize_data_config",
"sub_types": [ { "name": "avg", "priority": 2 } ],
"user_config": {
"inference_settings": {
"onnx": {
"session_options": {
"extra_session_config": { "session.disable_cpu_ep_fallback": "0" }
},
"execution_provider": "QNNExecutionProvider",
"provider_options": [
{
"backend_path": "QnnHtp.dll",
"htp_performance_mode": "burst",
"htp_graph_finalization_optimization_mode": "3",
"enable_htp_fp16_precision": "1"
}
]
}
}
}
}
]
}
},
"passes": {
"conversion": { "type": "OnnxConversion", "target_opset": 20 },
"surgery": { "type": "GraphSurgeries", "surgeries": [ { "surgeon": "MatMulAddToGemm" } ] },
"cb": {
"type": "EPContextBinaryGenerator",
"provider_options": {
"htp_graph_finalization_optimization_mode": "3",
"soc_model": "60",
"htp_arch": "73",
"vtcm_mb": "8",
"enable_htp_fp16_precision": "1"
}
},
"add_metadata": { "type": "AddOliveMetadata", "graph_name": "vit-base-patch16-224" }
},
"host": "qnn_system",
"target": "qnn_system",
"evaluator": "common_evaluator",
"output_dir": "models/vit-base-patch16-224/fp32_ctx",
"clean_cache": false,
"cache_dir": "cache/vit-base-patch16-224",
"evaluate_input_model": false
}