01 - Automatic Roofline Modeling (C/C++)
In the advanced tutorials, we take a look on our compiler collection, the Daisytuner Optimizing Compiler Collection (DOCC). The DOCC allows us to analyze the hotspots of the code at compile-time and instrument those parts for run-time. We will demonstrate this on the Roofline model, which is a performance model to estimate the optimization potentials of loops.
Step 1: Compiling with the DOCC
The DOCC is designed as a drop-in replacement for most recent clang and clang++ compilers.
To enable the analysis of hotspot regions, add the -mllvm -hotspot
and -ldaisy_rtl
flags.
This will add instrumentation calls to hotspot regions and link the necessary runtime library to collect performance data.
The -g
flag for debugging information is always encouraged.
on: push: branches: - main pull_request: types: [opened, reopened, synchronize, ready_for_review]
parameters: timeout: 10 partitions: - bellis5
steps: build: | docc -Xclang -no-opaque-pointers -g -O1 -mllvm -hotspot -o matmul.out matmul.c -ldaisy_rtl
run: matmul: command: ./matmul.out
Step 2: Performance Model
We can tell the runners to execute all necessary runs for the Roofline model, by enabling the loops
parameter for the benchmarl.
Note that the loops flag cannot be used, when the benchmark has not been compiled with DOCC as described aboved.
run: matmul: command: ./matmul.out measurements: 2 loops: true
You can find the resulting Roofline model under the Loops
Tab in the Daisytuner App.