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
.csvfile 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
tmuxif 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 |
|
Run pipeline |
|
Sort results |
|
Plot results |
|