dl-training-energy-estimation
Science Score: 75.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 3 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
✓Institutional organization owner
Organization gaissa-upc has institutional domain (gaissa.upc.edu) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.4%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: GAISSA-UPC
- License: apache-2.0
- Language: Jupyter Notebook
- Default Branch: main
- Size: 120 MB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 5
- Releases: 2
Metadata Files
README.md
Replication package
This repository contains the source code and data used in the paper "Estimating Deep Learning energy consumption based on model architecture and training environment".
Training data
We do not share the Chesslive dataset. However, you can use the Caltech101 and Stanford Dogs datasets to train the Inception V3 model. To use this datasets with the rest of the models you can extend each of the models' base class located in src/models/dl and adding it to the model_factory.
Collected data
All the data collected and produced during the study can be found in the data.zip file in the Releases section.
The folder is expected to be extracted at the root of the project and the metrics collected can be found inside the data/metrics folder. The data is organized in the following structure:
text
.
├── auxiliary
├── raw
├── interim
└── processed
The auxiliary folder contains a the list of raw measurements that have been processed. These are used to speed up the processing of new raw data.
The raw folder contains the raw measurements collected during the experiment.
The interim folder contains the processed data that is used to generate the final dataset.
The processed folder contains the final data used to perform the analysis.
Replicating the experiments
We do not provide a Docker container for the experiments since it is not possible to collect energy measurements inside a container. Nevertheless, we provide all the raw data and the source code used to run the experiments.
If you want to reproduce the experiments, you can use the provided scripts and configuration files.
Set up the environment
To set up the environment, you need to create a virtual environment and install the required dependencies. We use uv to manage the dependencies. To install the dependencies, you can run the following command:
bash
uv sync
If you want to use any other dependency manager, you can look at the pyproject.toml file for the required dependencies. Alternatively, you can use the requirements.txt file to install the dependencies using pip:
bash
pip install -r requirements.txt
MLflow configuration
We use MLflow to keep track of the different experiments. By default, its usage is disabled. If you want to use MLflow, you need to:
Configure your own tracking server.
Activate MLflow logging in the corresponding experiment_#.yaml configuration file.
Create a
.envfile in the project root with the following structure:
text
MLFLOW_TRACKING_URI = https://url/to/your/tracking/server
MLFLOW_TRACKING_USERNAME = tracking_server_username
MLFLOW_TRACKING_PASSWORD = tracking_server_password
If you do not need users credentials for MLflow leave the fields empty.
Resources configuration
This package uses a resources configuration to manage the GPU memory limit allowed and the use of cache.
We do not share this file since each machine has its own hardware specifications.
You will need to create a resources.yaml file inside the config folder with the following structure:
```yaml GPU: MEM_LIMIT: 2048
USE_CACHE: true ```
The GPU memory limit must be specified in Megabytes. If you do not want to set a GPU memory limit, leave the field empty.
WARNING! The memory limit value is just an example. Do not take it as a reference.
Running the experiment
Once the environment is set up, you can run the experiment by executing the following command:
```console $ python -m runexperiments [-h] [--experiment-name EXPERIMENT_NAME] {desktop,server} {experiment1.yaml,experiment2.yaml,experiment3.yaml}
positional arguments: {desktop,server} The environment to run the profiling in. {experiment1.yaml,experiment2.yaml,experiment_3.yaml} The name of the configuration file to use.
options: -h, --help show this help message and exit --experiment-name EXPERIMENT_NAME The name of the MLflow experiment. ```
The raw measurements for each architecture will be saved in the data/metrics/raw/{desktop, server}/architecture_name folder.
If MLflow is enabled, the measurements will also be saved in the MLflow tracking server, together with the trained models.
If not, the trained models will be saved in the models folder and the training history will be saved with the raw measurements as performance-%Y%m%dT%H%M%S.csv.
You can also train a single model by executing the following command:
```console $ python -m runner [-h] [--warmup] {desktop,server} {experiment1.yaml,experiment2.yaml,experiment_3.yaml} {single-run} ...
positional arguments: {desktop,server} The type of training environment. {experiment1.yaml,experiment2.yaml,experiment_3.yaml} The configuration file to use. {single-run} sub-command help single-run Single training help
options: -h, --help show this help message and exit --warmup Warmup the GPU. ```
The training history and the model will be saved following the same rules as the profiling script.
Data analysis
The data analysis is done using Jupyter Notebooks and R markdown notebooks. You can find the analysis inside the notebooks folder. All the plots generated are saved in the reports/figures folder.
Running the data analysis from a Docker container
We provide a Docker image you can use to reproduce the data analysis. You can get it from Docker Hub:
bash
docker pull santidr/dl-training-energy-estimation:1.0
The image uses the appuser user to run the container and all the necessary files are located at /home/appuser/workspace. This user does not have root privileges, so you may need to adjust file permissions if you want to install additional packages.
To create and start the container for the first time, you can use the following command:
bash
docker run -it santidr/dl-training-energy-estimation:1.0
Running the data analysis from source
If you prefer to run the data analysis directly on your machine, you can do so by following the steps in the Replicating the experiments section and the following additional steps.
Install R dependencies
To run the data analysis, you will need to install R and the required packages. You can use the install_packages.R script to install the required packages.
To run the script, you can execute the following command:
bash
Rscript install_packages.R
Install required fonts
This project uses the Computer Modern Unicode font for the plots. You can install it in Ubuntu-based systems by running the following command:
bash
sudo apt install fonts-cmu
License
The software under this project is licensed under the terms of the Apache 2.0 license. See the LICENSE file for more information.
The data used in this project is licensed under the terms of the CC BY 4.0 license. See the LICENSE in the data/LICENSE file for more information.
Owner
- Name: GAISSA
- Login: GAISSA-UPC
- Kind: organization
- Website: https://gaissa.upc.edu/
- Twitter: GAISSA_UPC
- Repositories: 1
- Profile: https://github.com/GAISSA-UPC
Towards green AI‐based software systems: an architecture‐centric approach (GAISSA)
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: >-
Effects of model architecture and training environment on Deep Learning training energy consumption - Replication package
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Santiago
family-names: del Rey
email: santiago.del.rey@upc.edu
affiliation: Universitat Politècnica de Catalunya
orcid: 'https://orcid.org/0000-0003-4979-414X'
identifiers:
- type: doi
value: 10.5281/zenodo.11505891
repository-code: >-
https://github.com/GAISSA-UPC/dl-training-energy-estimation
keywords:
- Green AI
- energy efficiency
- neural networks
- software engineering
- sustainable computing
license: Apache-2.0
version: v1.0
date-released: '2024-06-06'
GitHub Events
Total
- Push event: 27
- Pull request event: 2
- Create event: 4
Last Year
- Push event: 27
- Pull request event: 2
- Create event: 4
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 1
- Total pull requests: 8
- Average time to close issues: N/A
- Average time to close pull requests: 29 days
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.38
- Merged pull requests: 0
- Bot issues: 1
- Bot pull requests: 7
Past Year
- Issues: 1
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 1
- Bot pull requests: 0
Top Authors
Issue Authors
- dependabot[bot] (1)
Pull Request Authors
- dependabot[bot] (7)
- santidrj (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- 301 dependencies
- black <25.0 develop
- deptry <0.17 develop
- dvc ^3.50.1 develop
- ipympl <0.10 develop
- isort <5.15 develop
- jupyter <=1.0.0 develop
- pre-commit <3.8 develop
- pylint <3.3 develop
- tensorboard <2.15 develop
- cliffs-delta <=1.0.0
- flask ^3.0.3
- joblib ^1.4.2
- matplotlib <3.9
- mlflow <3.0
- numpy <1.27
- opencv-python <4.10
- pandas <=2.3
- pingouin <0.6
- psutil <6.0
- pysftp <0.3
- python >=3.9,<3.11
- python-dotenv <1.1
- pyyaml <6.1
- scikit-learn <1.6
- scikit-posthocs <0.10
- scipy <1.12
- seaborn <0.14
- statsmodels <0.15
- stumpy <1.13
- tensorflow =2.14.1
- tensorflow-datasets <5.0
- tqdm <4.67
- tslearn <0.7
- typeguard <4.3
- ydata-profiling <4.9
- absl-py ==1.4.0
- alembic ==1.13.1
- array-record ==0.5.0
- astunparse ==1.6.3
- bcrypt ==4.1.2
- blinker ==1.7.0
- cachetools ==5.3.2
- certifi ==2024.2.2
- cffi ==1.16.0
- charset-normalizer ==3.3.2
- click ==8.1.7
- cliffs-delta ==1.0.0
- cloudpickle ==3.0.0
- colorama ==0.4.6
- contourpy ==1.2.0
- cryptography ==42.0.4
- cycler ==0.12.1
- dm-tree ==0.1.8
- docker ==7.0.0
- entrypoints ==0.4
- etils ==1.5.2
- flask ==3.0.2
- flatbuffers ==23.5.26
- fonttools ==4.49.0
- fsspec ==2024.2.0
- gast ==0.5.4
- gitdb ==4.0.11
- gitpython ==3.1.42
- google-auth ==2.28.1
- google-auth-oauthlib ==1.0.0
- google-pasta ==0.2.0
- googleapis-common-protos ==1.62.0
- greenlet ==3.0.3
- grpcio ==1.62.0
- gunicorn ==21.2.0
- h5py ==3.10.0
- idna ==3.6
- importlib-metadata ==7.0.1
- importlib-resources ==6.1.1
- itsdangerous ==2.1.2
- jinja2 ==3.1.3
- joblib ==1.3.2
- keras ==2.14.0
- kiwisolver ==1.4.5
- libclang ==16.0.6
- llvmlite ==0.41.1
- mako ==1.3.2
- markdown ==3.5.2
- markupsafe ==2.1.5
- matplotlib ==3.8.3
- ml-dtypes ==0.2.0
- mlflow ==2.10.2
- numba ==0.58.1
- numpy ==1.25.2
- oauthlib ==3.2.2
- opencv-python ==4.9.0.80
- opt-einsum ==3.3.0
- packaging ==23.2
- pandas ==2.2.0
- pandas-flavor ==0.6.0
- paramiko ==3.4.0
- patsy ==0.5.6
- pillow ==10.2.0
- pingouin ==0.5.4
- promise ==2.3
- protobuf ==3.20.3
- psutil ==5.9.8
- pyarrow ==15.0.0
- pyasn1 ==0.5.1
- pyasn1-modules ==0.3.0
- pycparser ==2.21
- pynacl ==1.5.0
- pyparsing ==3.1.1
- pysftp ==0.2.9
- python-dateutil ==2.8.2
- python-dotenv ==1.0.1
- pytz ==2023.4
- pywin32 ==306
- pyyaml ==6.0.1
- querystring-parser ==1.2.4
- requests ==2.31.0
- requests-oauthlib ==1.3.1
- rsa ==4.9
- scikit-learn ==1.4.1.post1
- scikit-posthocs ==0.9.0
- scipy ==1.11.4
- seaborn ==0.12.2
- setuptools ==69.1.0
- six ==1.16.0
- smmap ==5.0.1
- sqlalchemy ==2.0.27
- sqlparse ==0.4.4
- statsmodels ==0.14.1
- stumpy ==1.12.0
- tabulate ==0.9.0
- tensorboard ==2.14.1
- tensorboard-data-server ==0.7.2
- tensorflow ==2.14.1
- tensorflow-datasets ==4.9.3
- tensorflow-estimator ==2.14.0
- tensorflow-io-gcs-filesystem ==0.36.0
- tensorflow-metadata ==1.14.0
- termcolor ==2.4.0
- threadpoolctl ==3.3.0
- toml ==0.10.2
- tqdm ==4.66.2
- tslearn ==0.6.3
- typeguard ==4.1.5
- typing-extensions ==4.9.0
- tzdata ==2024.1
- urllib3 ==2.2.1
- waitress ==2.1.2
- werkzeug ==3.0.1
- wheel ==0.42.0
- wrapt ==1.14.1
- xarray ==2024.2.0
- zipp ==3.17.0