Experiments

Download models

https://github.com/hailo-ai/hailo_model_zoo/blob/master/docs/public_models/HAILO8L/HAILO8L_classification.rst

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:

  1. Turn on power supply
  2. Run src/scripts/siglent_record_current.py
  3. Turn on power supply current with 5.1V for the Raspberry Pi 5
  4. 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

(Optional) Power measurement on Hailo

https://github.com/hailo-ai/hailort/blob/301c3c6c9b875b0c22d3025a21a281d1d45056fe/hailort/libhailort/bindings/python/platform/hailo_tutorials/notebooks/HRT_4_Power_measurement_Tutorial.ipynb#L4

(Optional) HailoRT inference tutorials

https://github.com/hailo-ai/hailort/tree/master/hailort/libhailort/bindings/python/platform/hailo_tutorials/notebooks

Most importantly, https://github.com/hailo-ai/hailort/blob/301c3c6c9b875b0c22d3025a21a281d1d45056fe/hailort/libhailort/bindings/python/platform/hailo_tutorials/notebooks/HRT_2_Infer_Pipeline_Inference_Tutorial.ipynb#L4