mirror of https://github.com/vladmandic/automatic
84 lines
2.0 KiB
JSON
84 lines
2.0 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": {
|
|
"convert": {
|
|
"type": "OnnxConversion",
|
|
"config": {
|
|
"target_opset": 14,
|
|
"save_as_external_data": true,
|
|
"all_tensors_to_one_file": true,
|
|
"external_data_name": "weights.pb"
|
|
}
|
|
}
|
|
},
|
|
"pass_flows": [["convert"]],
|
|
"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"]
|
|
}
|
|
}
|