查看调优结果
本节介绍调优完成后,如何查看调优结果,包括屏幕打印信息和生成的自定义知识库、om模型、算子调优结果文件和子图调优结果文件。
执行调优结果如下所示,代表调优完成并且性能有提升。
1 | <xxxx> process finished. Performance improved by xx% //xxxx:调优任务名称,xx%:性能提升的比例。 |
调优后的自定义知识库和om模型请参见自定义知识库和om模型,调优结果文件请参见算子调优结果文件和子图调优结果文件。
自定义知识库和om模型
调优完成后,若满足自定义知识库生成条件(请参见图2和图3),则会生成自定义知识库。生成自定义知识库存放路径如下。
- ${WORK_PATH}:调优工作目录,默认为执行aoe命令的目录。
- ${model_name}:模型名字
- ${timestamp}:时间戳
- ${os}_${arch}:操作系统及架构。动态shape场景或者“--virtual_type=1”且包括13.1.2.23-3中算子的场景下,会出现该字段。若om文件名中包含操作系统及架构,则该om文件只能在该操作系统及架构的运行环境中使用。如果想要在其他操作系统及架构的运行环境使用,请使用ATC重新转换模型(需要带"--host_env_os"和"--host_env_cpu"参数),详见《ATC工具使用指南》。
算子调优结果文件
算子调优结果文件的存放路径优先级为:ASCEND_WORK_PATH > 默认(执行调优的工作目录),若未配置ASCEND_WORK_PATH(可以使用env命令查询是否配置,ASCEND_WORK_PATH详细信息请参考《环境变量参考》),算子调优结果文件存放在默认路径(执行调优的工作目录)。
调优过程中,实时生成的结果文件命名为“aoe_result_opat_${timestamp}_${pidxxx}.json”,记录了调优过程中被调优的算子信息。其中${timestamp}为时间戳,格式为:年月日时分秒毫秒,“${pidxxx}”中的“xxx”为进程ID。
[
{
"basic": {
"tuning_name": "调优任务名",
"tuning_time(s)": 1494
}
},
{
"OPAT": {
"model_baseline_performance(ms)": 113.588725,
"model_performance_improvement": "0.31%",
"model_result_performance(ms)": 113.236731,
"opat_tuning_result": "tuning successful",
"repo_modified_operators": [
{
"op_name": "softmax",
"op_type": "SoftmaxV2",
"tune_performance": {
"Format": {
"performance_after_tune(us)": 99,
"performance_before_tune(us)": 134,
"performance_improvement": "35.35%",
"update_mode": "add"
}
}
},
.......
{
"op_name": "Conv_125",
"op_type": "Conv2D",
"tune_performance": {
"Schedule": {
"performance_after_tune(us)": 72.046,
"performance_before_tune(us)": 72.055,
"performance_improvement": "0.01%",
"update_mode": "add"
}
}
}
],
"repo_summary": {
"repo_add_num": 19,
"repo_hit_num": 0,
"repo_reserved_num": 0,
"repo_unsatisfied_num": 2,
"repo_update_num": 0,
"total_num": 21
}
}
}
]
调优失败时(即opat_tuning_result显示为"tuning failed"时),还会显示调优失败的算子的op_name列表。
"tuning_failed_operators": [
"res4a_branch1"
]
字段名称 |
含义 |
|||
|---|---|---|---|---|
basic |
||||
- |
tuning_name |
- |
- |
调优任务名称。 |
- |
tuning_time(s) |
- |
- |
调优耗费的时长,单位:s。 调优中断场景下(比如coredump、oom)不记录该字段。 |
OPAT 说明:
没有可调优的算子时,该段信息不存在。 |
||||
- |
model_baseline_performance(ms) |
- |
- |
调优前模型执行时间,单位:ms。 |
- |
model_performance_improvement |
- |
- |
调优后模型执行时间减少百分比。 调优中断场景下(比如coredump、oom)不记录该字段。 |
- |
model_result_performance(ms) |
- |
- |
调优后模型执行时间,单位:ms。 调优中断场景下(比如coredump、oom)不记录该字段。 |
- |
opat_tuning_result |
- |
- |
调优结果,成功时显示为"tuning successful",失败时显示为"tuning failed",调优未完成、异常中断退出时显示为"tuning incomplete"。 |
- |
repo_modified_operators |
- |
- |
调优后,调优策略有增加和更新的算子详细信息。 |
- |
- |
op_name |
- |
算子名称。 |
- |
- |
op_type |
- |
算子类型。可以有一个,也可以有多个。当有多个的时候,需要使用[]将多个算子类型括起来。 |
- |
- |
tune_performance |
- |
算子性能提升具体信息。 |
- |
- |
Format或者Schedule或者Impl |
- |
算子的调优模式,包括如下取值:
|
- |
- |
- |
performance_after_tune(us) |
调优后算子执行时间,单位:us。 |
- |
- |
- |
performance_before_tune(us) |
调优前算子执行时间,单位:us。 |
- |
- |
- |
performance_improvement |
调优后算子执行时间减少百分比。 |
- |
- |
- |
update_mode |
算子调优策略更新模式,取值如下。
|
说明:
针对每个调优策略有新增或者更新的算子,都会包括如上op_name~update_mode的信息。 |
||||
- |
repo_summary |
- |
- |
记录调优任务中不同状态算子的信息。 |
- |
- |
repo_add_num |
- |
调优前调优策略不在知识库中,调优后调优策略追加到知识库中的调优策略个数。 |
- |
- |
repo_hit_num |
- |
调优过程中调优策略在知识库中的调优策略个数。 |
- |
- |
repo_reserved_num |
- |
调优前调优策略在知识库中,调优后知识库中的调优策略无变化的调优策略个数。 |
- |
- |
repo_unsatisfied_num |
- |
调优前调优策略不在知识库,调优后也未写入知识库的调优策略个数。 |
- |
- |
repo_update_num |
- |
调优前调优策略在知识库中,调优后知识库中的调优策略有更新的调优策略个数。 |
- |
- |
total_num |
- |
调优任务中被调优的调优策略总数。
|
- |
tuning_failed_operators |
- |
- |
调优失败的算子的op_name列表。 说明:
可选,当opat_tuning_result显示"tuning failed"时才记录该字段。 |
子图调优结果文件
子图调优结果文件的存放路径优先级为:ASCEND_WORK_PATH > 默认(执行调优的工作目录),若未配置ASCEND_WORK_PATH(可以使用env命令查询是否配置,ASCEND_WORK_PATH详细信息请参考《环境变量参考》),子图调优结果文件存放在默认路径(执行调优的工作目录)。
调优过程中,实时生成的结果文件命名为“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 |
- |
调优任务中调优的子图总数。
|