Generating the roofline chart of an application:
- Collect and generate roofline HTML plot using
AMDuProfPcm.
$ AMDuProfPcm roofline -O /tmp -- /tmp/myapp.exeAn output directory is created in the specified dir (/tmp) in the format
AMDuProfPcm-Roofline-<date>-<time>which contains the HTML report (report.html). Open the HTML report and view the roofline graph located in the ββ tab.On AMD βZen 4β and later processors, if the Linux kernel version doesn't support accessing DF counters, use the following command with root privilege$ AMDuProfPcm roofline --msr -O /tmp/ -- /tmp/myapp.exe - To generate the PDF roofline chart, run the following command (to be
deprecated).
$ AMDuProfModelling.py -i /tmp/myapp-roofline.csv -o /tmp/ --memspeed 3200 -a myappThe roofline chart is saved in the file /tmp/AMDuProf_roofline-yyyy-mm-dd-hhmmss.pdf
A few pointers for generating the roofline chart.
- Use option
--read-smbiosto get memory speed and the number of memory channels from the SMBIOS table. This requires root privileges - While collecting the data, if the AMDuProfPcm is launched with non-root
privilege, specify the DRAM speed using
-memspeedoption with the AMDuProfModelling.py script. You can usedmidecodeorlshwcommand to get the memory speed. - To plot additional computational horizontal peaks line, use the following
options with AMDuProfModelling.py script:
-
--sp-roofs: Plot maximum peak roof for single-precision noSIMD and noFMA -
--dp-roofs: Plot maximum peak roof for double-precision noSIMD and noFMA
-
Example
$ AMDuProfModelling.py -i /tmp/myapp-roofline.csv -o /tmp/ --memspeed 3200 -a myapp -dp-roofs
- Use
-a <appname>option with AMDuProfModelling.py script to specify the application name to print in the graph chart - As this tool uses the maximum theoretical peaks for memory traffic and
floating-point performance, you can use benchmarks such as STREAM to get the
peak memory bandwidth and HPL or GEMM for peak FLOPS. Those scores can be used
to plot the roofline charts. Use the following options with
AMDuProfModelling.py script:
-
--stream <STREAM score> -
--hpl <HPL score> -
--gemm <SGEMM | DGEMM score>
-
Figure 1. Sample Roofline Chart