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

Does CodeCarbon provide the emissions per process? #261

Open
DLfreak opened this issue Oct 18, 2021 · 3 comments · May be fixed by #316
Open

Does CodeCarbon provide the emissions per process? #261

DLfreak opened this issue Oct 18, 2021 · 3 comments · May be fixed by #316
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@DLfreak
Copy link

DLfreak commented Oct 18, 2021

Hello,

Sorry this is not really an issue but I wanted to ask if there are different experiments running on the server, will codecarbon return the emissions for the whole server or just for my experiment with my Process ID? and is it a feature you might add in the future?

Thanks :)

@vict0rsch
Copy link
Contributor

Hey @DLfreak it's a great question, simple answer, complicated fix: no it won't separate. Assuming you're using a Linux-based shared infrastructure, we read RAPL files which are written by CPU chips not cores, therefore if you use 10 cores out of the 80 in the machine there's no way to disentangle the energy consumption of your cores.

We are thinking of fixing this issue by looking at such references https://medium.com/teads-engineering/estimating-aws-ec2-instances-power-consumption-c9745e347959 to map cpu usage to energy consumption.

Would you want to help us out on that front and contribute?

@mrchrisadams
Copy link

vict0rsch - I know that per-process emissions is a trick that Scaphandre, a somewhat similar project written in Rust uses.

I've documented how it works below:

https://github.com/hubblo-org/scaphandre/blob/main/docs_src/explanations/how-scaph-computes-per-process-power-consumption.md

I'm not too familiar with the codecarbon codebase yet, so I'm not sure how the energy figures are pulled from the RAPL and other chips.

If you're able to read figures from the scaphandre binary I think this would provide per process level figures as outlined, but I think you'd need to:

a) introduce the scaphandre binary into the package
b) figure out how to read data from it

If you could point me to the class responsible for reading RAPL readings, I'd be up for at least writing some docs on how it might work as a potential piece of work later in the year, and trying to raise some funding to pay for dev time to implement it.

@benoit-cty benoit-cty self-assigned this Apr 5, 2023
@benoit-cty
Copy link
Contributor

Thanks @mrchrisadams for this documentation, I have an open PR to use CPU load to estimate a per process emissions : #316

@benoit-cty benoit-cty added the documentation Improvements or additions to documentation label Apr 5, 2023
@inimaz inimaz linked a pull request Aug 23, 2023 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants