Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/GreenAI-Uppa/AIPowerMeter
https://github.com/GreenAI-Uppa/AIPowerMeter
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/GreenAI-Uppa/AIPowerMeter
- Owner: GreenAI-Uppa
- Created: 2021-06-15T15:40:32.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-25T14:55:38.000Z (8 months ago)
- Last Synced: 2024-08-03T09:01:57.158Z (3 months ago)
- Language: Jupyter Notebook
- Size: 7.15 MB
- Stars: 22
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-green-ai - AIPowerMeter - black?style=flat&logo=linux) ![GPU](https://img.shields.io/badge/GPU-black?style=flat&logo=nvidia) (🛠Tools / Code-Based Tools)
README
# Measure the efficiency of your deep learning
Record the energy consumption of your cpu and gpu. Check [our documentation](https://greenai-uppa.github.io/AIPowerMeter/) for usage.
This repo is largely inspired from this [experiment Tracker](https://github.com/Breakend/experiment-impact-tracker)
## Requirements
Running Average Power Limit (RAPL) and its linux interface : powercap
RAPL is introduced in the Intel processors starting with the Sandy bridge architecture in 2011.
Your linux os supports RAPL if the following folder is not empty:
```
/sys/class/powercap/intel-rapl/
```Empty folder? If your cpu is very recent, it is worth to check the most recent linux kernels.
## Installation
```
pip install -r requirements.txt
pip install --force-reinstall --no-cache-dir .
```You need to authorize the reading of the rapl related files:
```
sudo chmod -R 755 /sys/class/powercap/intel-rapl/
```> some examples requires pytorch or tensorflow.
## UsageSee `examples/example_exp_deep_learning.py`.
Essentially, you instantiate an experiment and place the code you want to measure between a start and stop signal.
```
from deep_learning_power_measure.power_measure import experiment, parsersdriver = parsers.JsonParser("output_folder")
exp = experiment.Experiment(driver)p, q = exp.measure_yourself(period=2)
###################
# place here the code that you want to profile
################
q.put(experiment.STOP_MESSAGE)```
This will save the recordings as json file in the `output_folder`. You can display them with:
```
from deep_learning_power_measure.power_measure import experiment, parsers
driver = parsers.JsonParser(output_folder)
exp_result = experiment.ExpResults(driver)
exp_result.print()
```