Usage Guideยถ

This guide walks you through the steps to use the Energy Pipeline for detecting energy regressions in your codebase.


๐Ÿงฉ Overviewยถ

The pipeline automates:

  • Cloning and checking out each commit

  • Running your tests N times per commit

  • Measuring energy with Intel RAPL

  • Plotting energy consumption trends and detecting regressions


๐Ÿ“ 1. Prepare a Configuration Fileยถ

You need to create a config file in YAML format that follows your config.schema.yml structure. This includes:

  • Repository URL

  • Branch or tags to analyze

  • Number of commits, runs, and repetitions

  • Test command to run

  • Output paths

Example:

TODO add example


๐Ÿ› ๏ธ 2. System Preparationยถ

Ensure:

  • Youโ€™re in a TTY session (not desktop environment)

  • Minimal background services are running

  • Battery is full and charging

  • Auto-brightness, CPU autoscaling, Wi-Fi etc. are disabled

Run the system setup:

sudo ./system_setup.sh first-setup
reboot
sudo ./system_setup.sh setup

You can later revert changes:

sudo ./system_setup.sh revert-setup

๐Ÿš€ 3. Run the Pipelineยถ

Run a Stability Testยถ

Before real measurements:

python main.py stability-test

This checks system temperature and performance counter stability.


Run Measurementยถ

python main.py measure --config path/to/config.yml
  • This runs the entire pipeline

  • Output is a .csv file in the same folder as the config


๐Ÿ“Š 4. Sort the Results (Optional)ยถ

To ensure results follow Git commit order:

python main.py sort path/to/results.csv /path/to/repo sorted_results.csv

๐Ÿ“ˆ 5. Generate Plotsยถ

To visualize energy trends and regressions:

python main.py plot path/to/sorted_results.csv

This creates one PNG per energy metric (energy-pkg, energy-core, energy-gpu), with:

  • Error bars and medians

  • Violin plots (distribution)

  • Change point detection

  • Breaking commit markers

  • Normality tests per commit


๐Ÿณ Optional: Run in Dockerยถ

You can use Docker to isolate the environment:

docker buildx build -t pipeline .
docker run -it --privileged pipeline:latest

Make sure to mount required volumes and copy your config + repo path into the container.


๐Ÿง  Tipsยถ

  • Run in tmux if on a server:

tmux new -s energy
# [run your pipeline]
# Detach with Ctrl+B D
# Reattach with: tmux attach -t energy
  • Log files will be written to the working directory


โœ… Outputยถ

  • CSV with energy data: [commit, energy-pkg, energy-core, energy-gpu]

  • PNG plots in same folder as CSV

  • Plots include short commit hashes and markers for regressions


๐Ÿ“Œ Recapยถ

Step

Command

Stability test

python main.py stability-test

Run pipeline

python main.py measure --config config.yml

Sort results

python main.py sort results.csv /path/to/repo sorted.csv

Plot results

python main.py plot sorted.csv