diff --git a/profiler/advisor/README.md b/profiler/advisor/README.md new file mode 100644 index 0000000000000000000000000000000000000000..722243cdc263433431ead52ef67a7257f6dfeb22 --- /dev/null +++ b/profiler/advisor/README.md @@ -0,0 +1,41 @@ +# 性能分析工具 + +性能分析工具是将Ascend PyTorch Profiler采集的性能数据进行分析,并输出性能调优建议的工具 。使用方式如下: + +下列以Windows环境下执行为例介绍。 + +1. 在环境下安装jupyter notebook工具。 + + ```bash + pip install jupyter notebook + ``` + + jupyter notebook工具的具体安装和使用指导请至jupyter notebook工具官网查找。 + +2. 在环境下安装ATT工具。 + + ``` + git clone https://gitee.com/ascend/att.git + ``` + + 安装环境下保存Ascend PyTorch Profiler采集的性能数据。 + +3. 进入att\profiler\advisor目录执行如下命令启动jupyter notebook工具。 + + ```bash + jupyter notebook + ``` + + 执行成功则自动启动浏览器读取att\profiler\advisor目录,如下示例: + + ![jupyter_report](img/jupyter_report.PNG) + + 若在Linux环境下则回显打印URL地址,即是打开jupyter notebook工具页面的地址,需要复制URL,并使用浏览器访问(若为远端服务器则需要将域名“**localhost**”替换为远端服务器的IP),进入jupyter notebook工具页面。 + +4. 每个.ipynb文件为一项性能数据分析任务,选择需要的.ipynb打开,并在*_path参数下拷贝保存Ascend PyTorch Profiler采集的性能数据的路径。如下示例: + + ![advisor_result](img/advisor_result.PNG) + +5. 单击运行按钮执行性能数据分析。 + + 分析结果详细内容会在.ipynb页面下展示。 diff --git a/profiler/advisor/img/advisor_result.PNG b/profiler/advisor/img/advisor_result.PNG new file mode 100644 index 0000000000000000000000000000000000000000..a9652f4ca53ff142a5ebd1033075aad54f8f0297 Binary files /dev/null and b/profiler/advisor/img/advisor_result.PNG differ diff --git a/profiler/advisor/img/jupyter_report.PNG b/profiler/advisor/img/jupyter_report.PNG new file mode 100644 index 0000000000000000000000000000000000000000..baa860a7893e1801337916aea37475ea69bbaf04 Binary files /dev/null and b/profiler/advisor/img/jupyter_report.PNG differ diff --git a/profiler/cluster_analyse/README.md b/profiler/cluster_analyse/README.md index f3a8b71cb9f822e8cd066aec174e495c23b71885..7cdb2d2c1e68da2cbbc00629ddf06b2ae48a28c2 100644 --- a/profiler/cluster_analyse/README.md +++ b/profiler/cluster_analyse/README.md @@ -14,12 +14,12 @@ experimental_config = torch_npu.profiler._ExperimentalConfig( 打开采集到的某张卡数据(*ascend_pt结尾的文件夹),可用的数据应该具备: -- **./profiler_info_x.json**, -- **./ASCEND_PROFILER_OUTPUT/step_trace_time.csv**, -- **./ASCEND_PROFILER_OUTPUT/trace_view.json**, -- **./ASCEND_PROFILER_OUTPUT/kernel_details.csv**, +- ./profiler_info_x.json, +- ./ASCEND_PROFILER_OUTPUT/step_trace_time.csv, +- ./ASCEND_PROFILER_OUTPUT/trace_view.json, +- ./ASCEND_PROFILER_OUTPUT/kernel_details.csv, - ./ASCEND_PROFILER_OUTPUT/communication.json, -- ./ASCEND_PROFILER_OUTPUT/communication_matrix.csv +- ./ASCEND_PROFILER_OUTPUT/communication_matrix.json 确认这几个文件生成后,继续下面的集群分析。 @@ -28,18 +28,23 @@ experimental_config = torch_npu.profiler._ExperimentalConfig( 将所有卡的数据拷贝并汇集到一个目录下,在本目录下运行以下命令即可生成cluster_analysis_output文件夹。 ```shell -python3 cluster_analysis.py -d {cluster profiling data path} +python3 cluster_analysis.py -d {cluster profiling data path} -m {mode} ``` ### 参数说明 -| 参数名 | 说明 | -| ---------------------- | --------------------------------------- | -| --collection_path或-d | 性能数据汇集目录,运行分析脚本之后会在该目录下自动创建cluster_analysis_output文件夹,保存分析数据。 | +| 参数名 | 说明 | 是否必选 | +| ---------------------- | --------------------------------------- | --------------------------------------- | +| --collection_path或-d | 性能数据汇集目录,运行分析脚本之后会在该目录下自动创建cluster_analysis_output文件夹,保存分析数据。 | 是 | +| --mode或-m | 数据解析模式。取值为:communication_matrix(解析通信矩阵数据)、communication_time(解析通信耗时数据)、all(同时解析通信矩阵和通信耗时数据),默认值为all。 | 否 | ## 交付件 +集群分析工具的交付件通过Ascend Insight工具展示,详见《MindStudio 可视化调优工具指南(Ascend Insight)》。 + ### cluster_step_trace_time.csv +数据解析模式为communication_matrix、communication_time或all时均生成。 + A列: Step数,是采集性能数据时设置的,一般来说集群性能数据采集一个step足够,如果采集多个step,需要先筛选一下。 B列: Type,主要分两种,rank和stage, 和后面的index强相关,可以理解为一个是单卡rank,一个是rank group(pp 并行的stage),如果type为stage,则后面D-K列信息为rank group下的最大值。 @@ -76,6 +81,8 @@ K列:Communication(Not Overlapped and Exclude Receive)指剔除recieve算 ### cluster_communication_matrix.json +数据解析模式为communication_matrix或all时生成。 + 直接打开json(vscode或json查看器), 搜索"Total", 会有多个搜索结果,一般来说链路带宽信息的结构: ```bash @@ -91,3 +98,9 @@ K列:Communication(Not Overlapped and Exclude Receive)指剔除recieve算 - "LOCAL"是片内拷贝,速率非常快,不需要考虑。 - “HCCS”或“PCIE”是节点内片间拷贝,速度在18GB左右或以上比较正常。 - “RDMA”是节点间拷贝,910A速度在12GB左右或以上。 + +### cluster_communication.json + +数据解析模式为communication_time或all时生成。 + +主要为通信耗时数据。