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

how add new chipset #524

Open mkbane opened 2 months ago

mkbane commented 2 months ago

codecarbon WARNING @ 21:31:54] No CPU tracking mode found. Falling back on CPU constant mode. [codecarbon WARNING @ 21:31:55] We saw that you have a 13th Gen Intel(R) Core(TM) i9-13900 but we don't know it. Please contact us. [codecarbon INFO @ 21:31:55] CPU Model on constant consumption mode: 13th Gen Intel(R) Core(TM) i9-13900 [codecarbon INFO @ 21:31:55] >>> Tracker's metadata: [codecarbon INFO @ 21:31:55] Platform system: Linux-6.1.0-0.deb11.13-amd64-x86_64-with-glibc2.31 [codecarbon INFO @ 21:31:55] Python version: 3.9.2 [codecarbon INFO @ 21:31:55] CodeCarbon version: 2.3.4 [codecarbon INFO @ 21:31:55] Available RAM : 125.504 GB [codecarbon INFO @ 21:31:55] CPU count: 32 [codecarbon INFO @ 21:31:55] CPU model: 13th Gen Intel(R) Core(TM) i9-13900 [codecarbon INFO @ 21:31:55] GPU count: 1 [codecarbon INFO @ 21:31:55] GPU model: 1 x NVIDIA Graphics Device

what info is required so this chipset can be added?

I do have RAPL enabled. Turning on debug I get the following output:

codecarbon INFO @ 21:35:34] [setup] RAM Tracking... [codecarbon INFO @ 21:35:34] [setup] GPU Tracking... [codecarbon INFO @ 21:35:34] Tracking Nvidia GPU via pynvml [codecarbon DEBUG @ 21:35:34] GPU available. Starting setup [codecarbon INFO @ 21:35:34] [setup] CPU Tracking... [codecarbon DEBUG @ 21:35:34] Not using PowerGadget, an exception occurred while instantiating IntelPowerGadget : Platform not supported by Intel Power Gadget [codecarbon DEBUG @ 21:35:34] Not using the RAPL interface, an exception occurred while instantiating IntelRAPL : Unable to read Intel RAPL files for CPU power, we will use a constant for your CPU power. Please view https://github.com/mlco2/codecarbon/issues/244 for workarounds : [Errno 13] Permission denied: '/sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj' [codecarbon DEBUG @ 21:35:34] Not using PowerMetrics, an exception occurred while instantiating Powermetrics : Platform not supported by Powermetrics [codecarbon WARNING @ 21:35:34] No CPU tracking mode found. Falling back on CPU constant mode. [codecarbon WARNING @ 21:35:35] We saw that you have a 13th Gen Intel(R) Core(TM) i9-13900 but we don't know it. Please contact us. [codecarbon INFO @ 21:35:35] CPU Model on constant consumption mode: 13th Gen Intel(R) Core(TM) i9-13900 [codecarbon INFO @ 21:35:35] >>> Tracker's metadata: [codecarbon INFO @ 21:35:35] Platform system: Linux-6.1.0-0.deb11.13-amd64-x86_64-with-glibc2.31 [codecarbon INFO @ 21:35:35] Python version: 3.9.2 [codecarbon INFO @ 21:35:35] CodeCarbon version: 2.3.4 [codecarbon INFO @ 21:35:35] Available RAM : 125.504 GB [codecarbon INFO @ 21:35:35] CPU count: 32 [codecarbon INFO @ 21:35:35] CPU model: 13th Gen Intel(R) Core(TM) i9-13900 [codecarbon INFO @ 21:35:35] GPU count: 1 [codecarbon INFO @ 21:35:35] GPU model: 1 x NVIDIA Graphics Device [codecarbon DEBUG @ 21:35:36] Not running on AWS [codecarbon DEBUG @ 21:35:37] Not running on Azure [codecarbon DEBUG @ 21:35:38] Not running on GCP

mkbane commented 2 months ago

okay, so I'm confused between files sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/energy_uj: ASCII text /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:0/energy_uj: ASCII text

I had originally set the bottom one as readable by all but it was the top one whose permissions needed amending in order for codecarbon to work:

CodeCarbon is going in an infinite loop to monitor this machine. [codecarbon INFO @ 21:44:04] [setup] RAM Tracking... [codecarbon INFO @ 21:44:04] [setup] GPU Tracking... [codecarbon INFO @ 21:44:04] Tracking Nvidia GPU via pynvml [codecarbon INFO @ 21:44:04] [setup] CPU Tracking... [codecarbon INFO @ 21:44:04] Tracking Intel CPU via RAPL interface [codecarbon INFO @ 21:44:05] >>> Tracker's metadata: [codecarbon INFO @ 21:44:05] Platform system: Linux-6.1.0-0.deb11.13-amd64-x86_64-with-glibc2.31 [codecarbon INFO @ 21:44:05] Python version: 3.9.2 [codecarbon INFO @ 21:44:05] CodeCarbon version: 2.3.4 [codecarbon INFO @ 21:44:05] Available RAM : 125.504 GB [codecarbon INFO @ 21:44:05] CPU count: 32 [codecarbon INFO @ 21:44:05] CPU model: 13th Gen Intel(R) Core(TM) i9-13900 [codecarbon INFO @ 21:44:05] GPU count: 1 [codecarbon INFO @ 21:44:05] GPU model: 1 x NVIDIA Graphics Device [codecarbon INFO @ 21:44:08] ApiClient Successfully registered your run on the API.

Run ID: 4e120824-dea3-4fd8-b869-55d0f8eb27c4 Experiment ID: 2115ae64-89a6-4ab8-b3e2-f8c45deafa08

[codecarbon INFO @ 21:44:18] Energy consumed for RAM : 0.000131 kWh. RAM Power : 47.0641565322876 W [codecarbon INFO @ 21:44:18] Energy consumed for all GPUs : 0.000013 kWh. Total GPU Power : 4.7892582677205855 W [codecarbon INFO @ 21:44:18] Energy consumed for all CPUs : 0.000017 kWh. Total CPU Power : 5.960711673119232 W [codecarbon INFO @ 21:44:18] 0.000161 kWh of electricity used since the beginning. :[codecarbon INFO @ 21:44:25] Energy consumed for RAM : 0.000211 kWh. RAM Power : 47.0641565322876 W [codecarbon INFO @ 21:44:25] Energy consumed for all GPUs : 0.000021 kWh. Total GPU Power : 4.577921241572093 W [codecarbon INFO @ 21:44:25] Energy consumed for all CPUs : 0.000027 kWh. Total CPU Power : 5.995664096069255 W [codecarbon INFO @ 21:44:25] 0.000259 kWh of electricity used since the beginning.

inimaz commented 2 months ago

Hello @mkbane !

[codecarbon WARNING @ 21:31:55] We saw that you have a 13th Gen Intel(R) Core(TM) i9-13900 but we don't know it. Please contact us.

When codecarbon is not able to detect the power of your CPU, it goes into constant mode. This means it will use as an approximation for the power consumption, the 50% of the TDP of your CPU. We keep a list of all the TDPs of CPUs we know of (https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/hardware/cpu_power.csv). More info on the methodology here.

TL;DR, codecarbon does not know the TDP of your CPU 13th Gen Intel(R) Core(TM) i9-13900. Could you create a PR and add the TDP to the list? Like this it will appear in future versions.

Here you have an example of a PR https://github.com/mlco2/codecarbon/pull/498. Thanks a lot!