communityfix.org

Paris, France

#00157

OngoingGlobal

Implements

#00165 Measure the emissions of compute you run yourself by sampling hardware power and applying local grid carbon intensity

Implementer

Initially developed by collaborators from Mila, BCG GAMMA, Haverford College, Comet.ml, and Data For Good France volunteers; now stewarded by Code Carbon, a French non-profit

Timeline

Since Dec 1, 2020

Location

Paris, France48.8566, 2.3522

Description

CodeCarbon is an open-source Python package that estimates CO2 from code execution. An EmissionsTracker (used as a context manager or decorator) samples CPU energy via Intel RAPL, GPU energy via NVIDIA NVML, and RAM energy over a run, multiplies by region-specific grid carbon intensity, and logs the result locally or to a dashboard. Released 2020-12-01 by Mila, BCG GAMMA, Haverford College, and Comet.ml, with Data For Good France volunteers. When RAPL is unavailable, it falls back to an estimation mode. It does not separately model disk I/O, network, cooling, or data-centre PUE.

Lessons learned

  • Measuring self-run compute is tractable because power can be sampled directly from hardware counters; the dominant uncertainty is the grid carbon-intensity factor, not the energy measurement itself.
  • Scoping to CPU, GPU and RAM keeps instrumentation overhead low and adoption easy, at the cost of omitting disk, network, cooling and embodied hardware impacts. This is a conscious trade-off to document when adopting this approach.

communityfix.org