Skip to content

Commit

Permalink
Support olive-ai 0.5.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
lshqqytiger committed May 5, 2024
1 parent 674c5ca commit a92b859
Show file tree
Hide file tree
Showing 20 changed files with 414 additions and 510 deletions.
25 changes: 13 additions & 12 deletions configs/olive/sd/text_encoder.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
"systems": {
"local_system": {
"type": "LocalSystem",
"config": { "accelerators": ["gpu"] }
"config": {
"accelerators": [
{
"device": "gpu",
"execution_providers": ["DmlExecutionProvider"]
}
]
}
}
},
"evaluators": {
Expand All @@ -38,7 +45,6 @@
"passes": {
"optimize_CPUExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "clip",
"opt_level": 0,
Expand All @@ -49,7 +55,6 @@
},
"optimize_DmlExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "clip",
"opt_level": 0,
Expand Down Expand Up @@ -78,12 +83,13 @@
"group_norm_channels_last": false
},
"force_fp32_ops": ["RandomNormalLike"],
"force_fp16_inputs": { "GroupNorm": [0, 1, 2] }
"force_fp16_inputs": {
"GroupNorm": [0, 1, 2]
}
}
},
"optimize_CUDAExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "clip",
"opt_level": 0,
Expand All @@ -94,7 +100,6 @@
},
"optimize_ROCMExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "clip",
"opt_level": 0,
Expand All @@ -117,17 +122,13 @@
},
"pass_flows": [["optimize_AutoExecutionProvider"]],
"engine": {
"search_strategy": {
"execution_order": "joint",
"search_algorithm": "exhaustive"
},
"log_severity_level": 0,
"evaluator": "common_evaluator",
"evaluate_input_model": false,
"host": "local_system",
"target": "local_system",
"cache_dir": "cache",
"output_name": "text_encoder",
"output_dir": "footprints",
"execution_providers": ["DmlExecutionProvider"]
"output_dir": "footprints"
}
}
25 changes: 13 additions & 12 deletions configs/olive/sd/unet.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@
"systems": {
"local_system": {
"type": "LocalSystem",
"config": { "accelerators": ["gpu"] }
"config": {
"accelerators": [
{
"device": "gpu",
"execution_providers": ["DmlExecutionProvider"]
}
]
}
}
},
"evaluators": {
Expand All @@ -55,7 +62,6 @@
"passes": {
"optimize_CPUExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "clip",
"opt_level": 0,
Expand All @@ -66,7 +72,6 @@
},
"optimize_DmlExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "unet",
"opt_level": 0,
Expand Down Expand Up @@ -95,12 +100,13 @@
"group_norm_channels_last": false
},
"force_fp32_ops": ["RandomNormalLike"],
"force_fp16_inputs": { "GroupNorm": [0, 1, 2] }
"force_fp16_inputs": {
"GroupNorm": [0, 1, 2]
}
}
},
"optimize_CUDAExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "unet",
"opt_level": 0,
Expand All @@ -111,7 +117,6 @@
},
"optimize_ROCMExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "unet",
"opt_level": 0,
Expand All @@ -134,17 +139,13 @@
},
"pass_flows": [["optimize_AutoExecutionProvider"]],
"engine": {
"search_strategy": {
"execution_order": "joint",
"search_algorithm": "exhaustive"
},
"log_severity_level": 0,
"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"]
"output_dir": "footprints"
}
}
25 changes: 13 additions & 12 deletions configs/olive/sd/vae_decoder.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
"systems": {
"local_system": {
"type": "LocalSystem",
"config": { "accelerators": ["gpu"] }
"config": {
"accelerators": [
{
"device": "gpu",
"execution_providers": ["DmlExecutionProvider"]
}
]
}
}
},
"evaluators": {
Expand All @@ -45,7 +52,6 @@
"passes": {
"optimize_CPUExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "clip",
"opt_level": 0,
Expand All @@ -56,7 +62,6 @@
},
"optimize_DmlExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "vae",
"opt_level": 0,
Expand Down Expand Up @@ -85,12 +90,13 @@
"group_norm_channels_last": false
},
"force_fp32_ops": ["RandomNormalLike"],
"force_fp16_inputs": { "GroupNorm": [0, 1, 2] }
"force_fp16_inputs": {
"GroupNorm": [0, 1, 2]
}
}
},
"optimize_CUDAExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "vae",
"opt_level": 0,
Expand All @@ -101,7 +107,6 @@
},
"optimize_ROCMExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "vae",
"opt_level": 0,
Expand All @@ -124,17 +129,13 @@
},
"pass_flows": [["optimize_AutoExecutionProvider"]],
"engine": {
"search_strategy": {
"execution_order": "joint",
"search_algorithm": "exhaustive"
},
"log_severity_level": 0,
"evaluator": "common_evaluator",
"evaluate_input_model": false,
"host": "local_system",
"target": "local_system",
"cache_dir": "cache",
"output_name": "vae_decoder",
"output_dir": "footprints",
"execution_providers": ["DmlExecutionProvider"]
"output_dir": "footprints"
}
}
25 changes: 13 additions & 12 deletions configs/olive/sd/vae_encoder.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
"systems": {
"local_system": {
"type": "LocalSystem",
"config": { "accelerators": ["gpu"] }
"config": {
"accelerators": [
{
"device": "gpu",
"execution_providers": ["DmlExecutionProvider"]
}
]
}
}
},
"evaluators": {
Expand All @@ -45,7 +52,6 @@
"passes": {
"optimize_CPUExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "clip",
"opt_level": 0,
Expand All @@ -56,7 +62,6 @@
},
"optimize_DmlExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "vae",
"opt_level": 0,
Expand Down Expand Up @@ -85,12 +90,13 @@
"group_norm_channels_last": false
},
"force_fp32_ops": ["RandomNormalLike"],
"force_fp16_inputs": { "GroupNorm": [0, 1, 2] }
"force_fp16_inputs": {
"GroupNorm": [0, 1, 2]
}
}
},
"optimize_CUDAExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "vae",
"opt_level": 0,
Expand All @@ -101,7 +107,6 @@
},
"optimize_ROCMExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "vae",
"opt_level": 0,
Expand All @@ -124,17 +129,13 @@
},
"pass_flows": [["optimize_AutoExecutionProvider"]],
"engine": {
"search_strategy": {
"execution_order": "joint",
"search_algorithm": "exhaustive"
},
"log_severity_level": 0,
"evaluator": "common_evaluator",
"evaluate_input_model": false,
"host": "local_system",
"target": "local_system",
"cache_dir": "cache",
"output_name": "vae_encoder",
"output_dir": "footprints",
"execution_providers": ["DmlExecutionProvider"]
"output_dir": "footprints"
}
}
17 changes: 7 additions & 10 deletions configs/olive/sdxl/text_encoder.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@
"local_system": {
"type": "LocalSystem",
"config": {
"accelerators": ["gpu"]
"accelerators": [
{
"device": "gpu",
"execution_providers": ["DmlExecutionProvider"]
}
]
}
}
},
Expand All @@ -73,7 +78,6 @@
"passes": {
"optimize_DmlExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "clip",
"opt_level": 0,
Expand Down Expand Up @@ -109,7 +113,6 @@
},
"optimize_CUDAExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "clip",
"opt_level": 0,
Expand All @@ -120,7 +123,6 @@
},
"optimize_ROCMExecutionProvider": {
"type": "OrtTransformersOptimization",
"disable_search": true,
"config": {
"model_type": "clip",
"opt_level": 0,
Expand All @@ -132,17 +134,12 @@
},
"pass_flows": [["optimize_AutoExecutionProvider"]],
"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": "text_encoder",
"output_dir": "footprints",
"execution_providers": ["DmlExecutionProvider"]
"output_dir": "footprints"
}
}
Loading

0 comments on commit a92b859

Please sign in to comment.