Source-linked AI summary

Eco2AI: carbon emissions tracking of machine learning models as the first step towards sustainable AI

Semen Budennyy, Vladimir Lazarev, Nikita Zakharenko, Alexey Korovin, Olga Plosskaya, Denis Dimitrov, Vladimir Arkhipkin, Ivan Oseledets, Ivan Barsola, Ilya Egorov, Aleksandra Kosterina, Leonid Zhukov

arXiv:2208.00406v2cs.LGcs.AIcs.CEcs.CY

TL;DR

Growing deep-neural-network complexity raises the energy and equivalent CO2 costs of training and inference. The paper introduces eco2AI, an open-source tracker emphasizing device-energy measurement and regional emissions accounting, and reports about 10% lower equivalent CO2 emissions with 4-bit GELU.

  • Problem

    Increasing AI complexity raises energy consumption and equivalent CO2 emissions, creating a need to measure models’ environmental impact alongside prediction accuracy.

  • Method

    The paper develops eco2AI, an open-source library that tracks CPU, GPU, and RAM energy consumption and applies regional CO2-emission coefficients.

  • Results

    About 10% lower equivalent CO2 emissions were demonstrated when using 4-bit GELU in the Malevich model.

  • Takeaways & Limitations

    eco2AI supports monitoring model-training and inference emissions while motivating optimization toward lower computational cost within the Sustainable AI pathway.

  • Takeaways & Limitations

    The energy accounting focuses on GPU, CPU, and RAM, excluding storage and neglecting terminating-process tail effects because their total impact is considered relatively small.

Abstract

from arXiv · show

The size and complexity of deep neural networks continue to grow exponentially, significantly increasing energy consumption for training and inference by these models. We introduce an open-source package eco2AI to help data scientists and researchers to track energy consumption and equivalent CO2 emissions of their models in a straightforward way. In eco2AI we put emphasis on accuracy of energy consumption tracking and correct regional CO2 emissions accounting. We encourage research community to search for new optimal Artificial Intelligence (AI) architectures with a lower computational cost. The motivation also comes from the concept of AI-based green house gases sequestrating cycle with both Sustainable AI and Green AI pathways.

1 Introduction

The paper frames AI sustainability around measuring AI’s growing energy and carbon impact, introducing eco2AI as an open-source tracker within an AI-based GHG sequestrating cycle.

  • 1 Introduction: Growing AI and ML complexity increases electricity use and equivalent CO2 emissions, making ecological-impact tracking important for Sustainable AI.The paper links transparent impact measurement with searching for computationally efficient architectures.
  • 1 Introduction: The proposed AI-based GHG sequestrating cycle separates demand for energy-optimized models from AI applications supporting sustainability goals.The paper names these paths “Towards Sustainable AI” and “Towards Green AI,” respectively.
  • 1 Introduction: eco2AI is introduced as an open-source Python library for evaluating equivalent CO2 emissions during ML-model training.The contribution positions the library within the broader GHG sequestrating-cycle concept.
  • 1 Introduction: The paper reports practical eco2AI cases as an efficiency-optimization tracker for fusion-model learning.The paper is organized around prior CO2-assessment solutions, calculation methodology, library use cases, and conclusions.

2 Related work

Related work surveys approaches for estimating AI-related energy and carbon emissions, then positions eco2AI among open-source tracking tools through training-focused and regional-accounting features.

  • 2 Related work: Existing studies estimate environmental costs across large deep-learning and NLP architectures and identify multiple routes toward greater training energy efficiency.Reported routes include sparse activation, distillation, pruning, quantization, efficient coding, fine-tuning, transfer learning, and regional energy selection.
  • 2 Related work: Open-source trackers share the goal of monitoring CO2 emissions during model training, while differing in supported environments, measurements, and reporting features.Examples include cloud-use estimation, program-level tracking, prediction-supported intervention, hardware and grid-region information, and device-level measurement.
  • 2 Related work: eco2AI focuses on model-training-related system processes to avoid over-estimation and maintains regional emission coefficients for 365 territorial objects.Its database also includes information on 3278 CPU models.
  • 2 Related work: The surveyed tools cover cloud-provider utilization, general computer programs, predictive training-cost control, and computation across CPUs, GPUs, servers, and desktops.These capabilities illustrate the breadth of existing carbon-footprint tracking software.

3 Methododology

eco2AI estimates ML energy use from GPU, CPU, and RAM activity, then converts consumption into equivalent CO2 using region-specific emission intensity and PUE.

  • 3.1 Electric energy consumption: The methodology quantifies electricity consumption for GPU, CPU, and RAM because these components directly and significantly affect ML processes.GPU monitoring uses NVIDIA devices; CPU tracking isolates the current model-training process, while RAM consumption is estimated from allocated memory.
  • 3.1 Electric energy consumption: GPU energy equals the time integral of total active-device power, with zero GPU consumption when no device is detected.eco2AI monitors NVIDIA GPU power and loading time through Pynvml.
  • 3.1 Electric energy consumption: CPU energy uses process-specific utilization and processor TDP, defaulting to 100 W when the CPU model cannot be matched.The tracker divides CPU utilization by the number of cores to estimate the current process contribution.
  • 3.1 Electric energy consumption: RAM energy is estimated as allocated memory integrated over time using a specific consumption of 0.375 W/Gb.The estimate applies to memory allocated by the current running process and is based on DDR3 and DDR4 modules.
  • 3.2 Emission intensity: The emission intensity coefficient γ weights kilograms of CO2 per MWh according to each region’s energy-source mix.Renewable energy lowers γ, whereas greater hydrocarbon shares increase it; eco2AI maintains coefficients for 365 regions.
  • 3.3 Equivalent carbon emissions: Carbon footprint is calculated as CF = γ ·PUE ·(ECPU +EGPU +ERAM), with PUE optional and defaulting to 1.PUE represents data-center power usage effectiveness for cloud-based learning and is manually defined in eco2AI.

4 Experiments

The experiments apply eco2AI to fine-tune large multimodal text-to-image models and to compare regular GELU with a 4-bit GELU variant during Malevich training. The 4-bit variant preserves nearly the same validation loss while reducing energy use and equivalent CO2 emissions.

  • 4.1 Fine-tuning of multimodal models: Malevich and Kandinsky were fine-tuned on the Emojis dataset, producing the Emojich XL and Emojich XXL models.The models generate images from text prompts, and the fine-tuning results were assessed visually against their corresponding pretrained models.
  • 4.1 Fine-tuning of multimodal models: The experiments tracked characteristics including equivalent CO2 emissions and power consumption during fine-tuning.Malevich and Kandinsky are multimodal pretrained transformers with 1.3 billion and 12 billion parameters, respectively.
  • 4.1 Fine-tuning of multimodal models: eco2AI supports straightforward energy-consumption control while training large models on one or multiple GPUs, including distributed-training settings such as DeepSpeed ZeRO-3.This positions the library as a monitoring tool for both single-GPU and multi-GPU workflows.
  • 4.2 Pre-training of multimodal models: GELU 4-bit stores model gradients at 4-bit resolution, reducing GPU memory allocation and computational resources relative to regular GELU.The comparison used the same optimizer, scheduler, and training strategy, with a fixed random seed and a 250000-sample dataset.
  • 4.2 Pre-training of multimodal models: GELU 4-bit produced almost the same validation losses as regular GELU while accumulating less CO2 at the same training step and achieved model loss.The study also reports about 10% lower power consumption for the 4-bit variant.
  • 4.2 Pre-training of multimodal models: eco2AI can monitor power consumption and carbon footprint in real time while supporting memory- and power-optimization methods such as activation-function gradient quantization.The GELU 4-bit experiment illustrates this optimization-tracking use case.

5 Conclusions

eco2AI is an open-source library for tracking equivalent CO2 emissions from Python-based AI model training and inference. Its examples show how the tool can quantify emissions changes from model-component optimization.

  • eco2AI tracks equivalent carbon emissions during training and inference by measuring CPU, GPU, and RAM energy consumption.It emphasizes precise process-loading measurements and regional emission coefficients for accurate accounting.
  • The library supports emission tracking for fine-tuning large text-to-image models, including Malevich and Kandinsky.
  • About 10% lower equivalent CO2 emissions were demonstrated when using a 4-bit GELU activation in Malevich.

Appendix. Usage of eco2AI library

The eco2AI appendix describes installation, session tracking, decorators, encrypted output, result files, and project-level summaries. Users can record resource usage and calculate associated financial costs.

  • Users frame a tracking session with tracker.start() before computations and tracker.stop() afterward.The tracker is configured with a project name and experiment description.
  • A decorator can record emission information each time a marked training function executes.The appendix illustrates this with the @track decorator applied to a training function.
  • Each recorded session can include duration, power consumption, CO2 emissions, hardware names, operating system, and country.Results are stored in a local CSV file, with project and experiment identifiers and a timestamp.
  • Encrypted recording can be enabled with the tracker’s encode property when authenticity of training-session results is required.
  • The summary function aggregates CSV results by project name and can additionally calculate financial costs from kWh price information.
Loading 2208.00406v2…