mlco2 / codecarbon

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

Power measurement interval #451

Closed somas193 closed 3 months ago

somas193 commented 9 months ago

I use the tracker.start_task() and tracker.stop_task() functionality to track emissions for each iteration within a loop. I would like to know if the measure_power_secs parameter is retained as set in the tracker initialization or if a different value is used for tracker.start_task() and tracker.stop_task() methods?

benoit-cty commented 9 months ago

Hello, When you call tracker.start_task(), the scheduler is stopped so measure_power_secs become useless.

somas193 commented 9 months ago

Does that mean the power stats. are measured only when tracker.start_task() and tracker.stop_task() are called? There's no measurement in between?

benoit-cty commented 9 months ago

No, there's no measurement. We read energy counter from GPU and CPU so it is still accurate.