mlco2 / codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.
https://mlco2.github.io/codecarbon
MIT License
1.15k stars 173 forks source link

Unfair emission comparison due to different Country. Is it possible to ask for a specific country? Colab #388

Open NicolaCST opened 1 year ago

NicolaCST commented 1 year ago

Hi all, I am trying to track the emissions of some models. However it happens that the report ends up having different Country_ISO_Code, ie. different countries. Could this issue make my report less reliable? A model in SGP (Singapore) tends to have an higher value than a similar one in NLD (Netherlands), for example.

There are any ways to ask for a specific country? Otherwise my comparison would not be fair.

Thanks in advance

benoit-cty commented 1 year ago

That's what Code Carbon is made for : compare different places. I don't know how to fix the country in Colab, but you could use the kWh measure as a comparison for model consumption.

benoit-cty commented 1 year ago

You could get it with:

co2_emission_in_kg = tracker.stop()
energy_in_kwh = tracker.final_emissions_data.energy_consumed
RafiullahOmar commented 1 year ago

If Code Carbon works for Colab, then it also works in a multi-user environment. For example, I have created a virtual machine on a server and when I measure the energy consumption of a model training, other people also log in to their user on the same server. Does it affect my measurement?

benoit-cty commented 1 year ago

Hello, if the hardware is shared across users, yes the electric consumption of other users will be use for your emissions.

That's why we are working on https://github.com/mlco2/codecarbon/pull/316 that allow to set tracking_mode to process and monitor only the emissions of your process.

You can test it, it should work.