Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification on Power vs. Energy in CodeCarbon Calculations #654

Open
RafiullahOmar opened this issue Sep 6, 2024 · 7 comments
Open

Clarification on Power vs. Energy in CodeCarbon Calculations #654

RafiullahOmar opened this issue Sep 6, 2024 · 7 comments

Comments

@RafiullahOmar
Copy link
Contributor

RafiullahOmar commented Sep 6, 2024

Description

How does CodeCarbon differentiate between 'power' and 'energy' in its calculations? Could someone clarify how CodeCarbon handles these two concepts?

What I Did

After a quick search, I got the feeling that these terms are used interchangeably in some contexts.

@benoit-cty
Copy link
Contributor

benoit-cty commented Sep 8, 2024

Thanks for reporting this.

We try to consistently use Energy = Power * Time and Power = Energy / Time , can you tell where there still have mistake ?

@RafiullahOmar
Copy link
Contributor Author

Actually, after a quick review, I couldn't find out if they are dealt with differently and what the tracker returns: power or energy. I assumed power, but for confirmation, I had a quick review and couldn't find it

@benoit-cty
Copy link
Contributor

We return the sum of energy, we also return power but it will be the last power, not the mean of all measured power :

total_emissions = EmissionsData(

@RafiullahOmar
Copy link
Contributor Author

Is there any possibility to get the mean of all power for a specific task same like we get the energy?

@benoit-cty
Copy link
Contributor

You could divide the energy by the duration to get the mean power. So I don't know if implementing a mean by adding a sum and a counter make sense.

@headscott
Copy link

According to the question about mean power: isn't cpu_power, gpu_power and ram_power the average use of Watt per second? So if I add these 3 values, I am getting the average power for gpu, cpu and ram per second?

@benoit-cty
Copy link
Contributor

Looking at the code, I think it's only the last measured power that is stored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants