-
Notifications
You must be signed in to change notification settings - Fork 158
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
Negative cpu_energy values #309
Comments
Hello, codecarbon/codecarbon/core/rapl.py Line 41 in 2a25fa9
Can you confirm that RAPL is used for mesuring ? You will have a log like this at codecarbon startup:
@vict0rsch I see that for power we use abs(), do you think it's a better idea ? |
That's surprising indeed. We had assumed the energy written in RAPL files would be strictly increasing. Not sure in what scenario it would not be the case. While using |
I can indeed confirm that RAPL is used for measuring. |
For further context: If I have time I will try to debug the issue a bit further. |
Well, setting |
I will experiment around with the parameter and see if I still get negative values. EDIT: changing Regarding why I set it that low (maybe I misunderstood something): So to sum up, I am not sure whether I would actually really appreciate it if somebody could clarify this for me. While we are on the subject I just wanna make sure that I correctly understand the difference between I assume And I assume that |
CodeCarbon was made originally for long training, so it's interesting to see you are using it for so short operation. |
Thanks for the explanation! I understand that codecarbon was built to measure long training-times. Yes, so for my use-case the shorter I can make the tracking duration the better, because overall compute time will be shorter. I am currently using codecarbon to track many short experiments. But it is possible for me to vary the duration of my experiments. But so far I can confirm that |
Hello, Could you try to execute the file https://github.com/mlco2/codecarbon/blob/f893556f4507126897c9227a3c790857ee360b54/examples/logging_to_file.py in your environment ? If you know how to do it you could test with the codecarbon branch |
@benoit-cty @vict0rsch CodeCarbon reads RAPL files to measure cpu_energy, when it runs, cpu_power increases quickly at the beginning, see logs. I think when other processes ready to run may lead to negative cpu_energy values. |
Fixed in previous release. |
Description
As before the update to 2.10 I used the tracker.start() and tracker.stop() way of measuring. I found that codecarbon sometimes measures negative energy values.
What I Did
Cannot really reproduce the scenario as all parameters of what I am measuring are random. Hardware is:
![negativ_energy](https://user-images.githubusercontent.com/58327873/168233407-f046a561-1951-4a27-a6d3-d18be089c03e.png)
Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
The text was updated successfully, but these errors were encountered: