-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathconfig_unet.json
More file actions
164 lines (164 loc) · 5.88 KB
/
Copy pathconfig_unet.json
File metadata and controls
164 lines (164 loc) · 5.88 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
{
"input_model": {
"type": "PyTorchModel",
"model_path": "CompVis/stable-diffusion-v1-4",
"model_loader": "unet_load",
"model_script": "user_script.py",
"io_config": {
"input_names": [ "sample", "timestep", "encoder_hidden_states", "return_dict" ],
"output_names": [ "out_sample" ],
"dynamic_axes": {
"sample": {
"0": "unet_sample_batch",
"1": "unet_sample_channels",
"2": "unet_sample_height",
"3": "unet_sample_width"
},
"timestep": { "0": "unet_time_batch" },
"encoder_hidden_states": { "0": "unet_hidden_batch", "1": "unet_hidden_sequence" }
}
},
"dummy_inputs_func": "unet_conversion_inputs"
},
"systems": {
"local_system": {
"type": "LocalSystem",
"accelerators": [ { "device": "gpu", "execution_providers": [ "CUDAExecutionProvider" ] } ]
}
},
"data_configs": [
{
"name": "latency_data_config",
"user_script": "user_script.py",
"load_dataset_config": { "type": "local_dataset" },
"dataloader_config": { "type": "unet_data_loader", "batch_size": 1 }
},
{
"name": "quantize_data_config",
"user_script": "user_script.py",
"load_dataset_config": { "type": "local_dataset" },
"dataloader_config": { "type": "unet_quantize_data_loader", "data_num": 200 }
}
],
"evaluators": {
"common_evaluator": {
"metrics": [
{
"name": "latency",
"type": "latency",
"data_config": "latency_data_config",
"sub_types": [ { "name": "avg" } ]
}
]
}
},
"passes": {
"convert": {
"type": "OnnxConversion",
"target_opset": 17,
"save_as_external_data": true,
"all_tensors_to_one_file": true,
"external_data_name": "weights.pb"
},
"ov_convert": {
"type": "OpenVINOConversion",
"user_script": "user_script.py",
"example_input_func": "get_unet_ov_example_input",
"output_model": "unet"
},
"optimize": {
"type": "OrtTransformersOptimization",
"model_type": "unet",
"opt_level": 0,
"float16": true,
"use_gpu": true,
"keep_io_types": false,
"optimization_options": {
"enable_gelu": true,
"enable_layer_norm": true,
"enable_attention": true,
"use_multi_head_attention": true,
"enable_skip_layer_norm": false,
"enable_embed_layer_norm": true,
"enable_bias_skip_layer_norm": false,
"enable_bias_gelu": true,
"enable_gelu_approximation": false,
"enable_qordered_matmul": false,
"enable_shape_inference": true,
"enable_gemm_fast_gelu": false,
"enable_nhwc_conv": false,
"enable_group_norm": true,
"enable_bias_splitgelu": false,
"enable_packed_qkv": true,
"enable_packed_kv": true,
"enable_bias_add": false,
"group_norm_channels_last": false
},
"force_fp32_ops": [ "RandomNormalLike" ],
"force_fp16_inputs": { "GroupNorm": [ 0, 1, 2 ] }
},
"optimize_cuda": {
"type": "OrtTransformersOptimization",
"model_type": "unet",
"opt_level": 0,
"float16": true,
"use_gpu": true,
"keep_io_types": false
},
"dynamic_shape_to_fixed": {
"type": "DynamicToFixedShape",
"dim_param": [
"unet_sample_batch",
"unet_sample_channels",
"unet_sample_height",
"unet_sample_width",
"unet_time_batch",
"unet_hidden_batch",
"unet_hidden_sequence"
],
"dim_value": [ 1, 4, 64, 64, 1, 1, 77 ],
"save_as_external_data": true
},
"optimize_qdq": {
"type": "OrtTransformersOptimization",
"model_type": "unet",
"opt_level": 0,
"optimization_options": {
"enable_gelu": true,
"enable_layer_norm": true,
"enable_attention": false,
"use_multi_head_attention": false,
"enable_skip_layer_norm": false,
"enable_embed_layer_norm": false,
"enable_bias_skip_layer_norm": false,
"enable_bias_gelu": false,
"enable_gelu_approximation": false,
"enable_qordered_matmul": false,
"enable_shape_inference": true,
"enable_gemm_fast_gelu": false,
"enable_nhwc_conv": false,
"enable_group_norm": false,
"enable_bias_splitgelu": false,
"enable_packed_qkv": false,
"enable_packed_kv": false,
"enable_bias_add": false,
"group_norm_channels_last": false
}
},
"quantization": {
"type": "OnnxStaticQuantization",
"data_config": "quantize_data_config",
"activation_type": "uint16",
"precision": "uint8",
"calibrate_method": "MinMax",
"quant_preprocess": true
}
},
"log_severity_level": 0,
"evaluator": "common_evaluator",
"evaluate_input_model": false,
"host": "local_system",
"target": "local_system",
"cache_dir": "cache",
"output_dir": "footprints/unet"
}