powerapi-ng / pyJoules

A Python library to capture the energy consumption of code snippets
MIT License
69 stars 8 forks source link

Confusion on the output #32

Open hafizuriu opened 8 months ago

hafizuriu commented 8 months ago

@altor @rouvoy @chakib-belgaid @danglotb

I have some confusion about the outputs that pyJoules returns.

It return as follows: begin timestamp : 1675697491.336882; tag : foo; duration : 3.7640533447265625; package_0 : 153976351.0; core_0 : 127869606.0; uncore_0 : 0.0; nvidia_gpu_0 : 192276

My question is, if I want to measure the CPU energy consumption, what values should I take into account? What is the unit of package 0?

I think package_0 return energy in uJ (1e-6J) and Nvidia_gpu return in mJ (1e-3J) Could you please help me clarify this issue?

My machine details: 11th Gen Intel® Core™ i9-11900 @ 2.50GHz × 16 NVIDIA GeForce RTX 3060

chakib-belgaid commented 8 months ago

Dear @hafizuriu,

I ll start with the second part: you are right, the energy consumption of Nvidia_gpu is in mJ (1e-3J) unlike all the other devices which are n uJ (1e-6J), it is a display bug that will be corrected in the next version.

As for the first part, the core is composed only with the cpu cores no other components whilst the package include all the extra components that are directly related with the processor such as the Cache memory, the integrated GPU ..etc

The following figure will help you understand better the scope. image

hope i brought some clarity, and feel free to ask more questions if you feel free to reach us. Best regards

hafizuriu commented 8 months ago

Thank you for your response, @chakib-belgaid. So, what will be the power for the CPU in my case?

begin timestamp : 1675697491.336882; tag : foo; duration : 3.7640533447265625; package_0 : 153976351.0; core_0 : 127869606.0; uncore_0 : 0.0; nvidia_gpu_0 : 192276