Carbon Emissions
Last updated
Last updated
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.
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 .
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
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:
If you are using AutoTrain, this is tracked for you π₯
Otherwise, use a tracker like Code Carbon in your training code, then specify
Copied
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!