eco2AI is a python library which accumulates statistics about power consumption and CO2 emission during running code.
Alternatives To Eco2ai
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Tensorflow179,2503277811 hours ago46October 23, 20192,109apache-2.0C++
An Open Source Machine Learning Framework for Everyone
Transformers116,568642,48411 hours ago125November 15, 2023916apache-2.0Python
🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
Pytorch73,2753,3418,27211 hours ago39November 15, 202313,125otherPython
Tensors and Dynamic neural networks in Python with strong GPU acceleration
Cs Video Courses61,557
25 days ago2
List of Computer Science courses with video lectures.
Keras59,97769112 hours ago86November 28, 2023134apache-2.0Python
Deep Learning for humans
D2l Zh51,463113 days ago51August 18, 202362apache-2.0Python
14 days ago19gpl-3.0Python
Deepfakes Software For All
Yolov543,71622 days ago3June 08, 2022209agpl-3.0Python
YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
a month ago547gpl-3.0Python
DeepFaceLab is the leading software for creating deepfakes.
Tensorflow Examples42,312
a year ago218otherJupyter Notebook
TensorFlow Tutorial and Examples for Beginners (support TF v1 & v2)
Alternatives To Eco2ai
Select To Compare

Alternative Project Comparisons

PyPI Downloads PyPI all Downloads

PyPI - Downloads PyPI - Downloads DOI telegram support


About Eco2AI 📋

The Eco2AI is a python library for CO2 emission tracking. It monitors energy consumption of CPU & GPU devices and estimates equivalent carbon emissions taking into account the regional emission coefficient. The Eco2AI is applicable to all python scripts and all you need is to add the couple of strings to your code. All emissions data and information about your devices are recorded in a local file.

Every single run of Tracker() accompanies by a session description added to the log file, including the following elements:

  • project_name
  • experiment_description
  • start_time
  • duration(s)
  • power_consumption(kWTh)
  • CO2_emissions(kg)
  • CPU_name
  • GPU_name
  • OS
  • country


To install the eco2AI library, run the following command:

pip install eco2ai

Use examples

Example usage eco2AI Open In Collab You can also find eco2AI tutorial on youtube utube

The eco2AI interface is quite simple. Here is the simplest usage example:

import eco2ai

tracker = eco2ai.Tracker(project_name="YourProjectName", experiment_description="training the <your model> model")


<your gpu &(or) cpu calculations>


The eco2AI also supports decorators. As soon as the decorated function is executed, the information about the emissions will be written to the emission.csv file:

from eco2ai import track

def train_func(model, dataset, optimizer, epochs):

train_func(your_model, your_dataset, your_optimizer, your_epochs)

For your convenience, every time you instantiate the Tracker object with your custom parameters, these settings will be saved until the library is deleted. Each new tracker will be created with your custom settings (if you create a tracker with new parameters, they will be saved instead of the old ones). For example:

import eco2ai

tracker = eco2ai.Tracker(
    experiment_description="training <your model> model",

<your gpu &(or) cpu calculations>


# now, we want to create a new tracker for new calculations
tracker = eco2ai.Tracker()
# now, it's equivalent to:
# tracker = eco2ai.Tracker(
#     project_name="YourProjectName", 
#     experiment_description="training the <your model> model",
#     file_name="emission.csv"
# )
<your gpu &(or) cpu calculations>

You can also set parameters using the set_params() function, as in the example below:

from eco2ai import set_params, Tracker

    experiment_description="We trained...",

tracker = Tracker()
# now, it's equivelent to:
# tracker = Tracker(
#     project_name="My_default_project_name",
#     experiment_description="We trained...",
#     file_name="my_emission_file.csv"
# )
<your code>

Important note

If for some reasons it is not possible to define country, then emission coefficient is set to 436.529kg/MWh, which is global average. Global Electricity Review

For proper calculation of gpu and cpu power consumption, you should create a "Tracker" before any gpu or CPU usage.

Create a new Tracker for every new calculation.

Usage of Eco2AI

An example of using the library is given in the publication. It the paper we presented experiments of tracking equivalent CO2 emissions using eco2AI while training ruDALL-E models with with 1.3 billion (Malevich, ruDALL-E XL 1.3B) and 12 billion parameters (Kandinsky, ruDALL-E XL 12B). These are multimodal pre-trained transformers that learn the conditional distribution of images with by some string of text capable of generating arbitrary images from a russian text prompt that describes the desired result. Properly accounted carbon emissions and power consumption Malevich and Kandinsky fine-tuning Malevich and Kandinsky on the Emojis dataset is given in the table below.

Model Train time Power, kWh CO2, kg GPU CPU Batch Size
Malevich 4h 19m 1.37 0.33 A100 Graphics, 1 AMD EPYC 7742 64-Core 4
Kandinsky 9h 45m 24.50 5.89 A100 Graphics, 8 AMD EPYC 7742 64-Core 12

Also we presented results for training of Malevich with optimized variation of GELU activation function. Training of the Malevich with the 8-bit version of GELU allows us to spent about 10% less energy and, consequently, produce less equivalent CO2 emissions.

Citing Eco2AI


The Eco2AI is licensed under a Apache licence 2.0.

Please consider citing the following paper in any research manuscript using the Eco2AI library:

  title={Eco2ai: carbon emissions tracking of machine learning models as the first step towards sustainable ai},
  author={Budennyy, SA and Lazarev, VD and Zakharenko, NN and Korovin, AN and Plosskaya, OA and Dimitrov, DV and Akhripkin, VS and Pavlov, IV and Oseledets, IV and Barsola, IS and others},
  booktitle={Doklady Mathematics},

In collaboration with

Popular Machine Learning Projects
Popular Deep Learning Projects
Popular Machine Learning Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Machine Learning
Deep Learning
Artificial Intelligence