分析Profiling数据

Profiling数据结果文件可以用于分析算子性能问题。以下以推荐的E2E Profiling方式为例,说明几种常见的Profiling数据分析性能瓶颈的要点。

采集数据说明

PyTorch性能数据采集生成的数据文件汇总如下。各数据文件详细文件介绍请参见《性能分析工具》。

表1 device/timeline目录文件介绍

timeline文件名

说明

msprof*.json

timeline数据总表。对采集到的timeline性能数据按照迭代粒度进行性能展示。

ai_stack_time_*.json

各个组件(AscendCL,GE,Runtime,Task Scheduler)的耗时。

thread_group_*.json

AscendCL,GE,Runtime组件耗时数据。该文件内的各组件数据按照线程(Thread)粒度进行排列,方便查看各线程下各组件的耗时数据。当模型为动态Shape时自动采集并生成该文件。

task_time_*.json

Task Scheduler任务调度信息。

acl_*.json

AscendCL接口耗时数据。

runtime_api_*.json

Runtime接口耗时数据。

task_queue.json

msproftx数据,通过采集E2E profiling数据采集,需在PyTorch训练脚本内设置“use_e2e_profiler=True”

表2 host/timeline目录文件介绍

timeline文件名

说明

msprof_tx.json

msproftx timeline数据。对采集到的host msproftx timeline数据按线程进行拼接,并进行数据关联性展示。

msprof*.json

timeline数据总表。对采集到的timeline性能数据按照迭代粒度进行性能展示。

表3 device/summary目录文件介绍

summary文件名

说明

op_summary_*.csv

AI Core和AI CPU算子信息。

op_statistic_*.csv

AI Core和AI CPU算子调用次数及耗时,从算子类型维度找出耗时最大的算子类型。

ai_stack_time_*.csv

每个组件(AscendCL,GE,Runtime,Task Scheduler)的耗时。

runtime_api_*.csv

每个runtime api的调用时长。

task_time_*.csv

Task Scheduler的任务调度信息数据。

ge_op_execute_*.csv

算子下发各阶段耗时数据。当模型为动态Shape时自动采集并生成该文件。

acl_*.csv

AscendCL接口的耗时。

acl_statistic_*.csv

AscendCL接口调用次数及耗时。

prof_rule_0.json

调优建议。

表4 host/summary目录文件介绍

summary文件名

说明

pytorch_operator_view.csv

msproftx数据,通过采集E2E profiling数据采集,需在PyTorch训练脚本内设置“use_e2e_profiler=True”

msprof_tx.csv

msproftx summary数据。对采集到的host msproftx summary数据按线程进行拼接,并进行数据关联性展示。