@@ -798,46 +798,46 @@ solver = ppsci.solver.Solver(
798798
799799## 3 . 使用 Nsight 进行性能分析
800800
801- Nsight是NVIDIA面相开发者提供的开发工具套件,能提供深入的跟踪、调试、评测和分析,以优化跨 NVIDIA GPU和CPU的复杂计算应用程序。
801+ Nsight是NVIDIA面相开发者提供的开发工具套件,能提供深入的跟踪、调试、评测和分析,以优化跨 NVIDIA GPU和CPU的复杂计算应用程序。详细文档可参考:[Nsight Systems Document](https://docs.nvidia.com/nsight-systems/index.html)
802802
803- PaddleScience 初步支持使用 Nsight 进行性能分析,以 linux 开发环境为例,按照如下步骤进行 。
803+ PaddleScience 初步支持使用 Nsight 进行性能分析,以 linux 开发环境 + laplace 2 d 案例为例,按照如下步骤使用 nsight 工具生成性能分析报告并查看分析结果 。
804804
805- 1 . 安装 nsight 工具
805+ 1 . 安装 nsight-system
806806
807- 开发机上下载 linux nsight-system 软件:nsight-systems/2023 .4 .1 ,并添加到环境变量 `PATH` 中:`PATH=/nsight-systems/2023 .4 .1 /bin:$PATH `,并在 windows 机器下载并安装 nsight-system 软件
807+ 开发机上下载 linux nsight-system 软件:nsight-systems/2023 .4 .1 ,并将 nsight 添加到环境变量 `PATH` 中:
808+
809+ 执行:`PATH=/path/to/nsight-systems/2023 .4 .1 /bin:$PATH `,同时在 windows 机器上安装**相同版本**的 nsight-system 软件。
808810
8098112 . 用 nsys 命令运行程序,生成性能分析文件
810812
811813 ``` sh
812- {++ NVTX=1 nsys profile -t cuda,nvtx --stats=true -o laplace2 d++} python laplace2 d.py
814+ {== NVTX=1 nsys profile -t cuda,nvtx --stats=true -o==} {++ laplace2 d++} python laplace2 d.py
813815 ```
814816
815- 详细文档可参考:[Nsight Systems Document](https://docs.nvidia.com/nsight-systems/index.html)
816-
8178173 . 查看分析结果
818818
819- 程序结束后,在终端内会打印出性能分析数据, 如下所示
819+ 程序结束后,在终端内会打印出性能分析数据( 如下所示),同时在上述 `-o` 参数指定的相对文件路径生成 `{++laplace 2 d++}.nsys-rep` 和 `{++laplace 2 d++}.sqlite` 两个文件。
820820
821- ``` log
822- ...
823- ...
824- Only run 25 steps when 'NVTX' is set in environment for nsight analysis. Exit now ......
825- Generating '/tmp/nsys-report-18 e4 .qdstrm'
826- [1 /7 ] [========================100 %] laplace2 d.nsys-rep
827- [2 /7 ] [========================100 %] laplace2 d.sqlite
828- [3 /7 ] Executing 'nvtx_sum' stats report
829-
830- Time (%) Total Time (ns) Instances Avg (ns) Med (ns) Min (ns) Max (ns) StdDev (ns) Style Range
831- -------- --------------- --------- ------------- ------------- ----------- ----------- ------------- ------- ------------------------------------
832- 15 .1 794 ,212 ,341 25 31 ,768 ,493 .6 5 ,446 ,410 .0 5 ,328 ,471 661 ,841 ,104 131 ,265 ,333 .9 PushPop Loss computation
833- 14 .5 766 ,452 ,142 25 30 ,658 ,085 .7 4 ,369 ,873 .0 4 ,281 ,927 659 ,795 ,434 131 ,070 ,475 .4 PushPop Constraint EQ
834- 13 .0 687 ,324 ,359 1 ,300 528 ,711 .0 32 ,567 .5 21 ,218 641 ,625 ,892 17 ,794 ,532 .4 PushPop matmul dygraph
835- 12 .9 678 ,475 ,194 1 678 ,475 ,194 .0 678 ,475 ,194 .0 678 ,475 ,194 678 ,475 ,194 0 .0 PushPop Training iteration 1
836- 12 .8 673 ,614 ,062 1 ,300 518 ,164 .7 19 ,802 .5 14 ,499 641 ,525 ,121 17 ,792 ,027 .2 PushPop matmul compute
837- 3 .9 203 ,945 ,648 25 8 ,157 ,825 .9 8 ,029 ,819 .0 7 ,797 ,185 9 ,119 ,496 359 ,173 .3 PushPop Loss backward
838- ...
839- ...
840- ```
821+ 在 windows 上使用 NVIDIA Nsight Systems 软件打开 `laplace2 d.nsys-rep`,即可在图形化的界面上查看性能分析数据。
841822
842- 其次会在程序运行的目录下,生成 `laplace2 d.nsys-rep` 和 `laplace2 d.sqlite` 两个文件,在 windows 上使用 NVIDIA Nsight Systems 软件打开 `laplace2 d.nsys-rep`,
843- 即可在图形化的界面上查看性能分析数据。
823+ ``` log
824+ ...
825+ ...
826+ Only run 25 steps when 'NVTX' is set in environment for nsight analysis. Exit now ......
827+
828+ Generating '/tmp/nsys-report-18 e4 .qdstrm'
829+ [1 /7 ] [========================100 %] laplace2 d.nsys-rep
830+ [2 /7 ] [========================100 %] laplace2 d.sqlite
831+ [3 /7 ] Executing 'nvtx_sum' stats report
832+
833+ Time (%) Total Time (ns) Instances Avg (ns) Med (ns) Min (ns) Max (ns) StdDev (ns) Style Range
834+ -------- --------------- --------- ------------- ------------- ----------- ----------- ------------- ------- ------------------------------------
835+ 15 .1 794 ,212 ,341 25 31 ,768 ,493 .6 5 ,446 ,410 .0 5 ,328 ,471 661 ,841 ,104 131 ,265 ,333 .9 PushPop Loss computation
836+ 14 .5 766 ,452 ,142 25 30 ,658 ,085 .7 4 ,369 ,873 .0 4 ,281 ,927 659 ,795 ,434 131 ,070 ,475 .4 PushPop Constraint EQ
837+ 13 .0 687 ,324 ,359 1 ,300 528 ,711 .0 32 ,567 .5 21 ,218 641 ,625 ,892 17 ,794 ,532 .4 PushPop matmul dygraph
838+ 12 .9 678 ,475 ,194 1 678 ,475 ,194 .0 678 ,475 ,194 .0 678 ,475 ,194 678 ,475 ,194 0 .0 PushPop Training iteration 1
839+ 12 .8 673 ,614 ,062 1 ,300 518 ,164 .7 19 ,802 .5 14 ,499 641 ,525 ,121 17 ,792 ,027 .2 PushPop matmul compute
840+ 3 .9 203 ,945 ,648 25 8 ,157 ,825 .9 8 ,029 ,819 .0 7 ,797 ,185 9 ,119 ,496 359 ,173 .3 PushPop Loss backward
841+ ...
842+ ...
843+ ```
0 commit comments