Skip to content

KernelSampler

Vivek Kale edited this page Mar 26, 2024 · 4 revisions

Summary

The sampler intercepts functions of any Kokkos Tools connector, i.e., the tool callback events invoked by another connector and enables those functions only if the current invocation of a Kokkos kernel is to be sampled. The sampler allows for plugins from any data collection mechanisms.

Location

You can find this tool utility in the Kokkos Tools repo here: https://github.com/kokkos/kokkos-tools/tree/develop/common/kokkos-sampler

Compiling

Via make

One can use the Makefile provided in the source directory of the sampler in the Kokkos Tools repo. Simply type make inside the source directory. When compiling for specific platforms modify the simple Makefile to use the correct compiler and compiler flags.

Via CMake

One can also use the cmake build system. Create a build directory and go to that directory. Type ccmake .. to ensure that kp_kokkos_sampler is in the list of profilers. Then, type cmake ..; make -j; sudo make install to build the profiler.

Using

This is a tool which is used only with tool chaining. To use it, you must set the Kokkos tools libraries to be the sampler's library along with another Kokkos Tools connector that actually gathers data for profiling, debugging, tuning, analysis, etc. If you want to confirm that the sampler is taking samples and know which sample is being taken, set the environment variable KOKKOS_TOOLS_SAMPLER_VERBOSE to 1.