OPTKIT is a highly customizable C++11 library and toolset designed for measuring energy consumption, detecting performance bottlenecks, and tuning hardware parameters at runtime to improve overall energy efficiency. Its overhead remains low, primarily depending on the frequency of measurements and the number of monitored regions.
OPTKIT integrates seamlessly into the development workflow like any other library. It can assist developers during development by providing energy and performance bottleneck-related insights to guide code improvements and refactoring, or it can be embedded into production environments to dynamically optimize hardware settings for greater energy efficiency.
The library provides comprehensive monitoring capabilities for CPUs, GPUs, and I/O systems across multiple architectures including Intel, AMD, ARM, and NVIDIA platforms. It supports real-time frequency control, energy monitoring via RAPL, performance monitoring through PMU events, and includes a rich set of utility tools for performance analysis and optimization.
| Feature | Intel | AMD | ARM Neoverse | RISC-V | Nvidia GPU | AMD GPU |
|---|---|---|---|---|---|---|
| PMU | P6, WSM, NHM, SNB, IVB, HSW, BDW, SKL, KBL, CFL, CML, ICL, TGL, RKL, ADL, RPL, MTL, SPR, EMR, GRN | Zen+ | N1, V1, N2, V2 | SG2042/4 | GPM | - |
| Energy | RAPL | RAPL | HWMON | PDU | NVML | AMD/ROCm SMI |
| Temperature | HWMON | HWMON | HWMON | HWMON | NVML | AMD/ROCm SMI |
| Frequency Scaling | SYSFS - MSR | SYSFS | SYSFS | SYSFS | NVML | AMD/ROCm SMI |
git clone https://github.com/Osmanyasal/OPTKIT.git
cd ./OPTKIT
git submodule update --force --recursive --init --remote
cd lib/premake5; make -f Bootstrap.mak linux; cd ./bin/release; alias premake5=$(pwd)/premake5; cd ..; cd ..; cd ..;cd ..; ## (optional: if premake5 is not installed)
premake5 carm #(optional to build carm roofline; defaults to OPTKIT_CARM_NUM_RUNS=256)
# OPTKIT_CARM_NUM_RUNS=1024 premake5 carm # best accuracy, slower run
# OPTKIT_CARM_ARGS="--isa avx512" premake5 carm # optional extra run.py args
premake5 gmake
## To create libraries:
make -j$(nproc) config=release optkit_static # for static
make -j$(nproc) config=release optkit_dynamic # for dynamic
make -j$(nproc) config=release optkit_py # for python interface
make -j$(nproc) config=release optkit_c # for C interface
## To compile tools
cd tools
cd optkit-cli; make -j$(nproc); alias optkit-cli=$(pwd)/optkit; cd ..
cd optkit-setenv; make -j$(nproc); alias optkit-setenv=$(pwd)/optkit-setenv; cd ..
cd ..
## To Run Tests:
make -j$(nproc) config=test optkit_static ## this converts some private or protected fields to public and being tested
make -j$(nproc) config=debug optkit_test ## no optimization in tests, raw results are viewed.
./bin/Debug/optkit_test
For quick introduction check out the Introduction Slide For more details and tutorials, check out the OPTKIT Wiki