mirror of https://github.com/vladmandic/automatic
109 lines
2.8 KiB
JSON
109 lines
2.8 KiB
JSON
{
|
|
"input_model": {
|
|
"type": "PyTorchModel",
|
|
"config": {
|
|
"model_path": "",
|
|
"model_loader": "unet_load",
|
|
"model_script": "modules/olive.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",
|
|
"config": {
|
|
"accelerators": ["gpu"]
|
|
}
|
|
}
|
|
},
|
|
"evaluators": {
|
|
"common_evaluator": {
|
|
"metrics": [
|
|
{
|
|
"name": "latency",
|
|
"type": "latency",
|
|
"sub_types": [{ "name": "avg" }],
|
|
"user_config": {
|
|
"user_script": "modules/olive.py",
|
|
"dataloader_func": "unet_data_loader",
|
|
"batch_size": 2
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"passes": {
|
|
"optimize": {
|
|
"type": "OrtTransformersOptimization",
|
|
"disable_search": true,
|
|
"config": {
|
|
"model_type": "unet",
|
|
"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]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"engine": {
|
|
"search_strategy": {
|
|
"execution_order": "joint",
|
|
"search_algorithm": "exhaustive"
|
|
},
|
|
"evaluator": "common_evaluator",
|
|
"evaluate_input_model": false,
|
|
"host": "local_system",
|
|
"target": "local_system",
|
|
"cache_dir": "cache",
|
|
"output_name": "unet",
|
|
"output_dir": "footprints",
|
|
"execution_providers": ["DmlExecutionProvider"]
|
|
}
|
|
}
|