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

Unable to track CPU for offline emissions #418

Closed huskyfire closed 11 months ago

huskyfire commented 1 year ago

Code Carbon is able to track GPU consumption but not CPU for offline emissions tracking, CPU falls back on constant consumption mode, is there a way to fix this?

[codecarbon INFO @ 13:49:45] [setup] CPU Tracking... [codecarbon WARNING @ 13:49:45] No CPU tracking mode found. Falling back on CPU constant mode. [codecarbon WARNING @ 13:49:46] We saw that you have a Intel(R) Xeon(R) W-2275 CPU @ 3.30GHz but we don't know it. Please contact us. [codecarbon INFO @ 13:49:46] CPU Model on constant consumption mode: Intel(R) Xeon(R) W-2275 CPU @ 3.30GHz [codecarbon INFO @ 13:49:46] CPU count: 28 [codecarbon INFO @ 13:49:46] CPU model: Intel(R) Xeon(R) W-2275 CPU @ 3.30GHz [codecarbon INFO @ 13:49:46] GPU count: 2 [codecarbon INFO @ 13:49:46] GPU model: 2 x NVIDIA GeForce RTX 3090 [codecarbon INFO @ 13:49:46] Energy consumed for RAM : 0.000000 kWh. RAM Power : 47.068817138671875 W [codecarbon INFO @ 13:49:46] Energy consumed for all GPUs : 0.000000 kWh. Total GPU Power : 686.0880000000001 W [codecarbon INFO @ 13:49:46] Energy consumed for all CPUs : 0.000000 kWh. Total CPU Power : 42.5 W

inimaz commented 1 year ago

Hi @huskyfire, thanks for reporting this. Unfortunately, we do not know all CPU's TDP. We have a file containing all the TDPs Link. If the CPU is not on the list, we go into constant mode. Maybe you could add yours TDP to that csv?

According to https://ark.intel.com/content/www/us/en/ark/products/198010/intel-xeon-w2275-processor-19-25m-cache-3-30-ghz.html it should be 165 W

huskyfire commented 1 year ago

thank you. I have edited the csv locally but output is still constant. or do i have to reinstall the entire package?

benoit-cty commented 1 year ago

Hello, If you clone the project, you need to do 'pip install -e .' to install you local code.

I've made a commit to add it in the next release : https://github.com/mlco2/codecarbon/pull/422/files#diff-c249a89d94122afdb5bbd103eb2e54c63f74eb2fc01c69549ac861444406e33aR2130

inimaz commented 11 months ago

This should be solved by now, included in https://github.com/mlco2/codecarbon/releases/tag/v2.2.5