mlco2 / codecarbon

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

Having the same run-ids for different decorators? #563

Closed TECO-Octo closed 3 weeks ago

TECO-Octo commented 1 month ago

Description

When you implement different decorators for tracking, is it possible for them to have the same run-ids? (those you can see in the respective column in the .csv file).

inimaz commented 1 month ago

Hey @TECO-Octo thanks for using codecarbon! For now it is not possible, we assign a random uuid to each run. What is exactly your use case?

inimaz commented 4 weeks ago

I have just realized, @TECO-Octo we have the concept of experiment_id, but for now it is only in our API. For the .csv files there is an open PR ==> #463

Once that is merged, you can have different run_ids and a common experiment_id that you set up manually. Maybe that is what you need?

TECO-Octo commented 3 weeks ago

Thanks for the reply! Actually what I want to figure out is what's the impact of having different ids for the runs? Because I am afraid that I would have biased results in the process, emissions wise :( In my case, I invoke four decorators, respectively tracking a function, that are called one after another

inimaz commented 3 weeks ago

As long as they are run sequentially, you are fine. The only issue is if they are run in parallel, which might mean that some emissions are counted double.

Just so you know, we have an ongoing PR (#562) to prevent parallel instances of codecarbon. So in the future, instances run in parallel will not be allowed unless clearly specified by the user.

TECO-Octo commented 3 weeks ago

Ok! Thanks for the clarifications!

inimaz commented 3 weeks ago

Closing this as solved! Have a nice day