Experiments
Download models
Power measurements
All experiments are run with the script
scripts/main.py
On laptop with CPU
To run the experiment on a laptop, run
python src/scripts/main.py platform=laptop backend=cpu
and to run the experiment with three different power trackers: CodeCarbon, PyJoules, and Zeus, do
python src/scripts/main.py -m platform=laptop backend=cpu power_tracker=codecarbon,pyjoules,zeus
Only CodeCarbon works on a Raspberry Pi, and PyJoules and Zeus does not support running on the Raspberry Pi.
On Raspberry Pi with CPU
python src/scripts/main.py platform=rpi backend=cpu power_tracker=codecarbon
On Rasperry Pi with Hailo
python src/scripts/main.py platform=rpi backend=hailo power_tracker=codecarbon
Workflow of power experiments
Library tests
Close all programs on the laptop and run
python src/scripts/main.py -m platform=laptop backend=cpu power_tracker=codecarbon,pyjoules,zeus
Hardware tests
The setup looks like this:
- Turn on power supply
- Run
src/scripts/siglent_record_current.py
- Turn on power supply current with 5.1V for the Raspberry Pi 5
- Run
ssh pi@10.200.2.51 'cd Documents/green-ai-bench && . .venv/bin/activate && python src/scripts/main.py -m backend=cpu,hailo power_tracker=codecarbon platform=rpi model=resnet run.inference_loops=100'
Compare to laptop CPU, first close all programs and then run
python src/scripts/main.py platform=laptop backend=cpu power_tracker=codecarbon run.inference_loops=100
Visualization and analysis of results
Run the notebooks for the analysis of results.
notebooks/compare_siglent_and_library.ipynb
notebooks/library_measurements.ipynb