mperf是一个面向移动/嵌入式平台的算子性能调优工具箱
Release Notes | Roadmap | Apps | 中文
mperf is a modular micro-benchmark/toolkit for kernel performance analysis.
mperf support CMake build system and require CMake version upper than 3.15.2, you can compile the mperf follow the step:
git clone https://github.com/MegEngine/mperf.git
git submodule update --init --recursive
NDK_ROOT env to the path of extracted NDK directoryPATH envandroid_build.sh to build it./android_build.sh -h
./android_build.sh -m armeabi-v7a
./android_build.sh [-m arm64-v8a] // default march is arm64-v8a
./android_build.sh -g mali [arm64-v8a, armeabi-v7a]
./android_build.sh -g adreno [arm64-v8a, armeabi-v7a]
./android_build.sh -p [arm64-v8a, armeabi-v7a]
./android_build.sh -d [arm64-v8a, armeabi-v7a]
./android_build.sh -i /your/custom/cmake/install/prefix [arm64-v8a, armeabi-v7a]
e.g.: ./android_build.sh -i ~/mperf_install [-m arm64-v8a] // default march is arm64-v8a
-DMPERF_ENABLE_PFM=ON to cmake commandcmake -S . -B "build-x86" -DMPERF_ENABLE_PFM=ON
cmake --build "build-x86" --config Release
cmake --build --target install
e.g.: cmake --build ./build-arm64-v8a/ --target install
find_package command to import the installed mperf, and use likeset(mperf_DIR /path/to/your/installed/mperfConfig.cmake) # Note, it's the dirname of mperfConfig.cmake, e.g. set(mperf_DIR ~/mperf_install/lib/cmake/mperf/)
find_package(mperf REQUIRED)
target_link_libraries(your_target mperf::mperf)
add_subdirectory(mperf) will incorporate the library directly in to your's CMake project.mperf::CpuCounterSet cpuset = "CYCLES,INSTRUCTIONS,...";
mperf::XPMU xpmu(cpuset);
xpmu.run();
... // add your function to be measured
xpmu.sample();
xpmu.stop();
please see cpu_pmu / mali_pmu / adreno_pmu for more details.mperf::tma::MPFTMA mpf_tma(mperf::MPFXPUType::A55);
mpf_tma.init(
{"Frontend_Bound", "Bad_Speculation", "Backend_Bound", "Retiring", ...});
size_t gn = mpf_tma.group_num();
for (size_t i = 0; i < gn; ++i) {
mpf_tma.start(i);
for (size_t j = 0; j < iter_num; ++j) {
... // add your function to be measured
}
mpf_tma.sample_and_stop(iter_num);
}
mpf_tma.deinit();
please see arm_cpu_tma for more details.apps Various user examples, please see apps doc for more details.eca A module for collecting and analyzing PMU events data(Including TMA analysis).uarch A set of low-level micro-benchmarks to investigate the basic micro-architectural parameters(uarch) of the target CPU/GPU.doc Some documents about roofline and tma usage, please see index for the list.cmake Some cmake relative files.common Some common helper functions.third_party Some dependent libraries.linter OpenCL Linter [TBD].mperf is licensed under the Apache-2.0 license.
No open issues yet, or sync has not completed.