This file will introduce the step to get the roofline date through mperf and plot the roofline graph.
-
build mperf for arm64 cpu
./android_build.sh -m arm64-v8a
- copy the executable file
apps/cpu_spec_dram_bw
to your android phone and run it, you will get the GBPs for the cpu
- copy the executable file
apps/cpu_inst_gflops_latency
to your android phone and run it, you will get the GFLOPs for the cpu
- copy the executable file
-
build mperf for the adreno or mali
./android_build.sh -m arm64-v8a -g [adreno | mali]
- copy the executable file
apps/gpu_spec_dram_bw
to your android phone and run it, you will get the GBPs for the gpu
- copy the executable file
apps/gpu_inst_gflops_latency
to your android phone and run it, you will get the GFLOPs for the gpu
- copy the executable file
- enable the following metrics for mperf tma in cpu_tma_transpose
recompile, copy to your phone, and run it, you will get the memory and compute bandwidth for your function call. And in this case, the function is an neon transpose implement.
mpf_tma.init( {"Metric_GFLOPs_Use", "Metric_DRAM_BW_Use", "Metric_L3_BW_Use", "Metric_L2_BW_Use"});
- recompile mperf with mali gpu enabled, and copy the executable file
apps/gpu_mali_pmu_test
to your android phone and run it, you will get the GBPs and GFLOPs for your custom gpu kernel call on mali gpu.
- recompile mperf with adreno gpu enabled, and copy the executable file
apps/gpu_adreno_pmu_test
to your android phone and run it, you will get the GBPs and GFLOPs for your custom gpu kernel call on adreno gpu.
- now, you get all the data need to plot roofline, please edit these values into a roofline_data.txt file like roofline_data.txt, and you may need edit the params about axes coordinate range at plot_roofline.py according to values of the peak memory and compute bandwidth on your platform, and finally, plot it
see the roofline_readme for more details.
python3 plot_roofline.py ./roofline_data.txt