-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathconfig_vae_encoder.json
More file actions
125 lines (125 loc) · 4.41 KB
/
Copy pathconfig_vae_encoder.json
File metadata and controls
125 lines (125 loc) · 4.41 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
{
"input_model": {
"type": "PyTorchModel",
"model_path": "CompVis/stable-diffusion-v1-4",
"model_loader": "vae_encoder_load",
"model_script": "user_script.py",
"io_config": {
"input_names": [ "sample", "return_dict" ],
"output_names": [ "latent_sample" ],
"dynamic_axes": {
"sample": { "0": "encoder_batch", "1": "encoder_channels", "2": "encoder_height", "3": "encoder_width" }
}
},
"dummy_inputs_func": "vae_encoder_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": "vae_encoder_data_loader", "batch_size": 1 }
},
{
"name": "quantize_data_config",
"user_script": "user_script.py",
"load_dataset_config": { "type": "local_dataset" },
"dataloader_config": { "type": "vae_encoder_quantize_data_loader", "data_num": 100 }
}
],
"evaluators": {
"common_evaluator": {
"metrics": [
{
"name": "latency",
"type": "latency",
"data_config": "latency_data_config",
"sub_types": [ { "name": "avg" } ]
}
]
}
},
"passes": {
"convert": { "type": "OnnxConversion", "target_opset": 17 },
"ov_convert": {
"type": "OpenVINOConversion",
"user_script": "user_script.py",
"example_input_func": "vae_encoder_conversion_inputs",
"output_model": "vae_encoder"
},
"optimize": {
"type": "OrtTransformersOptimization",
"model_type": "vae",
"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": "vae",
"opt_level": 0,
"float16": true,
"use_gpu": true,
"keep_io_types": false
},
"dynamic_shape_to_fixed": {
"type": "DynamicToFixedShape",
"dim_param": [
"encoder_batch",
"encoder_channels",
"encoder_height",
"encoder_width",
"Addlatent_sample_dim_0",
"Addlatent_sample_dim_1",
"Addlatent_sample_dim_2",
"Addlatent_sample_dim_3"
],
"dim_value": [ 1, 3, 512, 512, 1, 4, 64, 64 ]
},
"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/vae_encoder"
}