BOINC AI Hub
  • 🌍BOINC AI Hub
  • 🌍Repositories
  • Getting Started with Repositories
  • Repository Settings
  • Pull Requests & Discussions
  • Notifications
  • Collections
  • 🌍Webhooks
    • How-to: Automatic fine-tuning with Auto-Train
    • How-to: Build a Discussion bot based on BLOOM
    • How-to: Create automatic metadata quality reports
  • Repository size recommendations
  • Next Steps
  • Licenses
  • 🌍Models
  • The Model Hub
  • 🌍Model Cards
    • Annotated Model Card
    • Carbon Emissions
    • Model Card Guidebook
    • Landscape Analysis
  • Gated Models
  • Uploading Models
  • Downloading Models
  • 🌍Integrated Libraries
    • Adapter Transformers
    • AllenNLP
    • Asteroid
    • Diffusers
    • ESPnet
    • fastai
    • Flair
    • Keras
    • ML-Agents
    • PaddleNLP
    • RL-Baselines3-Zoo
    • Sample Factory
    • Sentence Transformers
    • spaCy
    • SpanMarker
    • SpeechBrain
    • Stable-Baselines3
    • Stanza
    • TensorBoard
    • timm
    • Transformers
    • Transformers.js
  • 🌍Model Widgets
    • Widget Examples
  • Inference API docs
  • Frequently Asked Questions
  • 🌍Advanced Topics
    • Integrate a library with the Hub
    • Tasks
  • 🌍Datasets
  • Datasets Overview
  • Dataset Cards
  • Gated Datasets
  • Dataset Viewer
  • Using Datasets
  • Adding New Datasets
  • 🌍Spaces
  • 🌍Spaces Overview
    • Handling Spaces Dependencies
    • Spaces Settings
    • Using Spaces for Organization Cards
  • Spaces GPU Upgrades
  • Spaces Persistent Storage
  • Gradio Spaces
  • Streamlit Spaces
  • Static HTML Spaces
  • 🌍Docker Spaces
    • Your first Docker Spaces
    • Example Docker Spaces
    • Argilla on Spaces
    • Label Studio on Spaces
    • Aim on Space
    • Livebook on Spaces
    • Shiny on Spaces
    • ZenML on Spaces
    • Panel on Spaces
    • ChatUI on Spaces
    • Tabby on Spaces
  • Embed your Space
  • Run Spaces with Docker
  • Spaces Configuration Reference
  • Sign-In with BA button
  • Spaces Changelog
  • 🌍Advanced Topics
    • Using OpenCV in Spaces
    • More ways to create Spaces
    • Managing Spaces with Github Actions
    • Custom Python Spaces
    • How to Add a Space to ArXiv
    • Cookie limitations in Spaces
  • 🌍Other
  • 🌍Organizations
    • Managing Organizations
    • Organization Cards
    • Access Control in Organizations
  • Billing
  • 🌍Security
    • User Access Tokens
    • Git over SSH
    • Signing Commits with GPG
    • Single Sign-On (SSO)
    • Malware Scanning
    • Pickle Scanning
    • Secrets Scanning
  • Moderation
  • Paper Pages
  • Search
  • Digital Object Identifier (DOI)
  • Hub API Endpoints
  • Sign-In with BA
Powered by GitBook
On this page
  • Displaying carbon emissions for your model
  • Why is it beneficial to calculate the carbon emissions of my model?
  • What information should I include about the carbon footprint of my model?
  • Carbon footprint metadata
  • How is the carbon footprint of my model calculated? 🌎
  1. Model Cards

Carbon Emissions

PreviousAnnotated Model CardNextModel Card Guidebook

Last updated 1 year ago

Displaying carbon emissions for your model

Why is it beneficial to calculate the carbon emissions of my model?

Training ML models is often energy-intensive and can produce a substantial carbon footprint, as described by . It’s therefore important to track and report the emissions of models to get a better idea of the environmental impacts of our field.

What information should I include about the carbon footprint of my model?

If you can, you should include information about:

  • where the model was trained (in terms of location)

  • the hardware used β€” e.g. GPU, TPU, or CPU, and how many

  • training type: pre-training or fine-tuning

  • the estimated carbon footprint of the model, calculated in real-time with the package or after training using the .

Carbon footprint metadata

You can add the carbon footprint data to the model card metadata (in the README.md file). The structure of the metadata should be:

Copied

---
co2_eq_emissions:
  emissions: number (in grams of CO2)
  source: "source of the information, either directly from AutoTrain, code carbon or from a scientific article documenting the model"
  training_type: "pre-training or fine-tuning"
  geographical_location: "as granular as possible, for instance Quebec, Canada or Brooklyn, NY, USA. To check your compute's electricity grid, you can check out https://app.electricitymap.org."
  hardware_used: "how much compute and what kind, e.g. 8 v100 GPUs"
---

How is the carbon footprint of my model calculated? 🌎

Considering the computing hardware, location, usage, and training time, you can estimate how much CO2 the model produced.

The math is pretty simple! βž•

Then, you take the power consumption of the GPU during training using the pynvml library.

Finally, you multiply the power consumption and carbon intensity by the training time of the model, and you have an estimate of the CO2 emission.

Keep in mind that this isn’t an exact number because other factors come into play β€” like the energy used for data center heating and cooling β€” which will increase carbon emissions. But this will give you a good idea of the scale of CO2 emissions that your model is producing!

To add Carbon Emissions metadata to your models:

  1. If you are using AutoTrain, this is tracked for you πŸ”₯

  2. Otherwise, use a tracker like Code Carbon in your training code, then specify

Copied

co2_eq_emissions: 
  emissions: 1.2345

in your model card metadata, where 1.2345 is the emissions value in grams.

First, you take the carbon intensity of the electric grid used for the training β€” this is how much CO2 is produced by KwH of electricity used. The carbon intensity depends on the location of the hardware and the used at that location β€” whether it’s renewable energy like solar 🌞, wind 🌬️ and hydro πŸ’§, or non-renewable energy like coal ⚫ and natural gas πŸ’¨. The more renewable energy gets used for training, the less carbon-intensive it is!

To learn more about the carbon footprint of Transformers, check out the , part of the BOINC AI Course!

🌍
Strubell et al.
Code Carbon
ML CO2 Calculator
energy mix
video