查看调优结果
执行调优结果如下所示,代表调优完成并且性能有提升。
<xxxx> process finished. Performance improved by xx% //xxxx:调优任务名称,xx%:性能提升的比例。
调优后的自定义知识库和om模型请参见自定义知识库和om模型,调优结果文件请参见算子调优结果文件和子图调优结果文件。
自定义知识库和om模型
- 针对子图调优,会存储到TUNE_BANK_PATH环境变量中指定的路径。若不设置此配置选项,默认存储到${HOME}/Ascend/latest/data/aoe/custom/graph/${soc_version}目录下。
- 针对算子调优,会存储到TUNE_BANK_PATH环境变量中指定的路径/${soc_version}目录,若不设置此环境变量,默认存储到${HOME}/Ascend/latest/data/aoe/custom/op/${soc_version}路径下。
- ${WORK_PATH}:调优工作目录
- ${model_name}:模型名字
- ${timestamp}:时间戳
算子调优结果文件
调优过程中,会在执行调优的工作目录下实时生成命名为“aoe_result_opat_{timestamp}_{pidxxx}.json”的文件,记录调优过程中被调优的算子信息。
其中{timestamp}为时间戳,格式为:年月日时分秒毫秒,“{pidxxx}”中的“xxx”为进程ID。
内容格式如下所示,各字段含义请参见表1。
[
{
"basic": {
"tuning_name": "调优任务名",
"tuning_time(s)": 1827
}
},
{
"OPAT": {
"model_baseline_performance(ms)": 113.588725,
"model_performance_improvement": "0.31%",
"model_result_performance(ms)": 113.236731,
"opat_tune_result": "tune success",
"repo_modified_operators": {
"add_repo_operators": [
{
"op_name": "strided_slice_10",
"op_type": "stridedsliced",
"performance_after_tune(us)": 99,
"performance_before_tune(us)": 134,
"performance_improvement": "35.35%"
},
{
"op_name": "strided_slice_7",
"op_type": "stridedsliced",
"performance_after_tune(us)": 14,
"performance_before_tune(us)": 124,
"performance_improvement": "785.71%"
}
],
"update_repo_operators": [
{
"op_name": "test/conv3/conv3_1/Conv2Dtest/conv3/conv3_1/Relu",
"op_type": "conv2d",
"performance_after_tune(us)": 4891.762,
"performance_before_tune(us)": 5008.928,
"performance_improvement": "2.40%"
},
{
"op_name": "test/conv1/conv1_2/Conv2Dtest/conv1/conv1_2/Relu",
"op_type": "conv2d",
"performance_after_tune(us)": 13114.24,
"performance_before_tune(us)": 13446.145,
"performance_improvement": "2.53%"
}
}
]
},
"repo_summary": {
"repo_add_num": 2,
"repo_hit_num": 17,
"repo_reserved_num": 15,
"repo_unsatisfied_num": 0,
"repo_update_num": 2,
"total_num": 19
}
}
}
]
调优失败时(即opat_tune_result显示为"tune failed"时),还会显示调优失败的算子的op_name列表。
"tune_failed_operators": [
"res4a_branch1"
]
字段名称 |
含义 |
|||
|---|---|---|---|---|
basic |
||||
- |
tuning_name |
- |
- |
调优任务名称。 |
- |
tuning_time(s) |
- |
- |
调优耗费的时长,单位:s。 |
OPAT 说明:
没有可调优的算子时,该段信息不存在。 |
||||
- |
model_baseline_performance(ms) |
- |
- |
调优前模型执行时间,单位:ms。 |
- |
model_performance_improvement |
- |
- |
调优后模型执行时间减少百分比。 |
- |
model_result_performance(ms) |
- |
- |
调优后模型执行时间,单位:ms。 |
- |
opat_tune_result |
- |
- |
调优结果,成功时显示为"tune success",失败时显示为"tune failed"。 |
- |
repo_modified_operators |
- |
- |
调优后,调优策略有增加和更新的算子详细信息。 |
- |
- |
add_repo_operators |
- |
调优后增加调优策略的算子,可以没有,也可以有多个。 |
- |
- |
- |
op_name |
算子名称。 |
- |
- |
- |
op_type |
算子类型。可以有一个,也可以有多个。当有多个的时候,需要使用[]将多个算子类型括起来。 |
- |
- |
- |
performance_after_tune(us) |
调优后算子执行时间,单位:us。 |
- |
- |
- |
performance_before_tune(us) |
调优前算子执行时间,单位:us。 |
- |
- |
- |
performance_improvement |
调优后算子执行时间减少百分比。 |
- |
- |
update_repo_operators |
- |
调优后更新调优策略的算子,可以没有,也可以有多个。 |
- |
- |
- |
op_name |
算子名称。 |
- |
- |
- |
op_type |
算子类型。 |
- |
- |
- |
performance_after_tune(us) |
调优后算子执行时间,单位:us。 |
- |
- |
- |
performance_before_tune(us) |
调优前算子执行时间,单位:us。 |
- |
- |
- |
performance_improvement |
调优后算子执行时间减少百分比。 |
- |
repo_summary |
- |
- |
记录调优任务中不同状态算子的个数。 |
- |
- |
repo_add_num |
- |
调优前调优策略不在知识库中,调优后调优策略追加到知识库中的算子的个数。 |
- |
- |
repo_hit_num |
- |
调优过程中调优策略在知识库中的算子的个数。 |
- |
- |
repo_reserved_num |
- |
调优前调优策略在知识库中,调优后知识库中的调优策略无变化的算子的个数。 |
- |
- |
repo_unsatisfied_num |
- |
调优前调优策略不在知识库,调优后也未写入知识库的算子个数。 |
- |
- |
repo_update_num |
- |
调优前调优策略在知识库中,调优后知识库中的调优策略有更新的算子个数。 |
- |
- |
total_num |
- |
调优任务中被调优的算子总数。
|
- |
tune_failed_operators |
- |
- |
调优失败的算子的op_name列表。 说明:
可选,当opat_tune_result显示"tune failed"时才记录该字段。 |
子图调优结果文件
调优过程中,会在执行调优的工作目录下实时生成命名为“aoe_result_sgat_{timestamp}_{pidxxx}.json”的文件,记录调优过程中被调优的子图信息。
其中{timestamp}为时间戳,格式为:年月日时分秒毫秒,“{pidxxx}”中的“xxx”为进程ID。
内容格式如下所示,各字段含义请参见表2。
[
{
"basic": {
"tuning_name": "调优任务名",
"tuning_time(s)": 78
}
},
{
"SGAT": {
"model_baseline_performance(ms)": 5.600486,
"model_performance_improvement": "55.11%",
"model_result_performance(ms)": 3.610442,
"repo_modified_subgraphs": {
"add_repo_subgraphs": [
{
"performance_after_tune(ms)": 3.573203,
"performance_before_tune(ms)": 5.58434,
"performance_improvement": "56.28%",
"repo_key": "1024942313106047484"
}
]
"update_repo_subgraphs": [
{
"performance_after_tune(ms)": 2.573203,
"performance_before_tune(ms)": 4.58434,
"performance_improvement": "78.15%",
"repo_key": "1024942313106057586"
}
]
},
"repo_summary": {
"repo_add_num": 1,
"repo_hit_num": 1,
"repo_reserved_num": 0,
"repo_unsatisfied_num": 0,
"repo_update_num": 1,
"total_num": 2
}
}
}
]
字段名称 |
含义 |
|||
|---|---|---|---|---|
basic |
||||
- |
tuning_name |
- |
- |
调优任务名称。 |
- |
tuning_time(s) |
- |
- |
调优耗费的时长,单位:s。 |
SGAT 说明:
子图调优失败时,该段信息不存在。 |
||||
- |
model_baseline_performance(ms) |
- |
- |
调优前模型执行时间,单位: ms。 |
- |
model_performance_improvement |
- |
- |
调优后模型执行时间减少百分比。 |
- |
model_result_performance(ms) |
- |
- |
调优后模型执行时间,单位: ms。 |
- |
repo_modified_subgraphs |
- |
- |
调优后,调优策略有增加和更新的子图详细信息。 |
- |
- |
add_repo_subgraphs |
- |
调优后调优策略有增加的子图,可以没有,也可以有多个。 |
- |
- |
- |
performance_before_tune(ms) |
调优前子图执行时间,单位: ms。 |
- |
- |
- |
performance_after_tune(ms) |
调优后子图执行时间,单位:ms。 |
- |
- |
- |
performance_improvement |
调优后子图执行时间减少百分比。 |
- |
- |
- |
repo_key |
调优后子图的key值,用于调优知识库查询。 |
- |
- |
update_repo_subgraphs |
- |
调优后调优策略有更新的子图,可以没有,也可以有多个。 |
- |
- |
- |
performance_before_tune(ms) |
调优前子图执行时间,单位: ms。 |
- |
- |
- |
performance_after_tune(ms) |
调优后子图执行时间,单位:ms。 |
- |
- |
- |
performance_improvement |
调优后子图执行时间减少百分比。 |
- |
- |
- |
repo_key |
调优后子图的key值,用于调优知识库查询。 |
- |
repo_summary |
- |
- |
记录调优过程中不同状态子图的个数。 |
- |
- |
repo_add_num |
- |
调优前调优策略不在知识库中,调优后调优策略追加到知识库中的子图的个数。 |
- |
- |
repo_hit_num |
- |
调优过程中调优策略在知识库中的子图的个数。 |
- |
- |
repo_reserved_num |
- |
调优前调优策略在知识库中,调优后知识库中的调优策略无变化的子图的个数。 |
- |
- |
repo_unsatisfied_num |
- |
调优前调优策略不在知识库,调优后也未写入知识库的子图个数。 |
- |
- |
repo_update_num |
- |
调优前调优策略在知识库中,调优后知识库中的调优策略有更新的子图个数。 |
- |
- |
total_num |
- |
调优任务中调优的子图总数。
|