mlco2 / mlco2/codecarbon

How works CPU constant mode (when RAPL files are not found) ?

Open
#477 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
1.9k
Forks
323
Avg merge
1d 12h
Merged PRs (30d)
12

Description

Hello !

I am trying to use CodeCarbon on a Linux virtual machine. I don't have the RAPL module on it so the cpu tracking falls on constant mode.
If I understood well the methodology, in this case the cpu energy consumption = TDP * usage (constante=0,5) ?
If it's true, experimentally, the cpu_energy divided by the duration should be constant between different measures on the same machine. In practice, I made several measures on the same machine which are saved on a .csv, and then I calculated cpu_ernergy/duration on all the lines, I get close values but not equal, do you know why ?

I saw that you began to work on CPU load tracking with psutil, it is not merged yet, right ?
Do you know if it is possible to custom the kernel of a virtual machine so it is able to use RAPL files or it doesn't work on virtual environnements ?

Thank you for your help !

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the CPU tracking implementation for the constant mode used when RAPL files are unavailable, then compare how CPU energy, duration, and usage are calculated across the reported CSV measurements. Check the status of the mentioned psutil CPU-load work and whether virtual machines can expose RAPL files. Done means the constant-mode behavior and measurement variation are explained or reproduced, with any needed documentation or fix identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python
Domain
operating-systems, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.