In short
Wrap your training script in an emissions tracker such as CodeCarbon, which estimates energy from your CPU, GPU and memory and converts it to carbon using the local grid. Count every run, including tuning and failures, record hardware, location and duration, and publish the result with the model. If you have no logs, a calculator such as Green Algorithms can estimate it afterwards.
Steps
- Add an emissions tracker to the training script and stop it in a finally block so it always closes.
- Give each run a project or experiment name so configurations can be compared.
- Record hardware, run time, location and the grid carbon intensity used.
- Count tuning, failed and abandoned runs as well as the final one.
- Put energy and emissions next to accuracy in your results table.
- Publish the figure in the model card or paper.
Measure while you train, not afterwards. Training figures that are logged run by run let you compare configurations on energy as well as accuracy, and give buyers and colleagues a number they can trust.
What determines the footprint?
Lacoste and colleagues identified the main factors in 2019: the location of the server and the energy grid it uses, the length of training, and the make and model of the hardware. Carbon is energy multiplied by the carbon intensity of the grid where and when the job ran.
Which tools should I use?
- CodeCarbon, an open-source Python package, estimates energy from processor, GPU and memory power and converts it with local grid data. Its tutorials show how to track each configuration and compare accuracy against emissions, and it has guidance for clusters whose compute nodes have no internet access.
- Green Algorithms, a calculator from Lannelongue, Grealey and Inouye, estimates a footprint from hardware, run time, memory and location, which suits jobs you didn't log.
- The Machine Learning CO2 Impact calculator from Lacoste and colleagues does a similar estimate from hardware, hours, provider and region.
How do I publish it?
Hugging Face model cards have a co2_eq_emissions field for emissions in grams, the source of the figure, the
training type (pre-training or fine-tuning), location and hardware used. Fill it in for every model you release.
Common mistakes
- Reporting only the final run. Hyperparameter searches and failed runs are often most of the total.
- Using one national yearly average when hourly regional data exists. See finding grid carbon intensity.
- Giving one number with no method. State the tool, version and boundary.
The full method is in how to measure AI energy.
Sources
- Comparing model efficiency with carbon tracking, CodeCarbon documentation (2025)
- Using CodeCarbon on SLURM, CodeCarbon documentation (2025)
- Green Algorithms: quantifying the carbon footprint of computation, Lannelongue, Grealey and Inouye, Advanced Science (2021)
- Quantifying the carbon emissions of machine learning, Lacoste, Luccioni, Schmidt and Dandres (2019)
- Displaying carbon emissions for your model, Hugging Face Hub documentation (2026)
Related
How do I report the energy use of my AI research?
What to put in a paper about compute and energy: hardware, GPU-hours for all runs, energy, location, carbon, inference cost and the boundary used.
How do I measure the energy AI uses on my own computer or GPU?
Measure local AI energy with hardware counters, GPU telemetry or a plug-in meter, sample over the whole job, and subtract the idle baseline.
How do I reduce the energy of training a model?
The main levers for cutting training energy: start pre-trained, right-size, use mixed precision, stop early, pick clean places and times, measure.
How to measure the energy and carbon of AI
A practical guide to metering or estimating the energy and carbon of AI work: tools, system boundaries, per-task metrics and honest uncertainty.