Conversation
benoit-cty
left a comment
There was a problem hiding this comment.
Hello,
Thanks for the contribution. Can you add a documentation in https://github.com/mlco2/codecarbon/blob/master/docs/edit/usage.rst ?
| @@ -73,17 +89,18 @@ def init(): | |||
| @click.option( | |||
| "--api/--no-api", default=True, help="Choose to call Code Carbon API or not. (yes)" | |||
There was a problem hiding this comment.
Note to myself : document the "--no-api" parameter and remove the beta mention for the API.
| measure_power_secs=measure_power_secs, | ||
| api_call_interval=api_call_interval, | ||
| save_to_api=api, | ||
| tracking_mode="process", |
There was a problem hiding this comment.
Not sure if it works with process. It need a test with a process that consume RAM to see the difference with machine because process does not work for GPU and CPU yet.
There was a problem hiding this comment.
I confirm launching it like this does not work sadly. For instrumenting a process, it needs to be in the same process it is instrumenting. It will be cool in the future to do something like "instrument process 1234" passing the id.
For now I suggest to have codecarbon monitor to measure whole machine only but start/stop when the process starts/stops. See #1004 .
What do you think @jennydaman ?
|
@benoit-cty besides documentation, is there any other blocker on this PR ? |
It has to be tested to ensure it works as expected. |
|
Was just looking for this feature! Hope it can get merged eventually. |
|
Thanks for this PR @jennydaman, it is a good idea! interested in applying those changes? Sorry I started the change in #1004 without knowing of the existence of this branch. My bad :( We have moved the cli from click to typer, this is why you see this many conflicts in this PR. |
|
Hi @inimaz worry not about "stealing" work! This PR is a bit stale, I'll keep it in mind but it might take me some weekends to get to. |
|
I close this PR as the sub-process monitoring has been done in #1004 |
Resolves #382
This PR adds functionality to the
codecarbon monitorcommand.When you run
codecarbon monitor, the previous behavior is kept the same.When you run
codecarbon monitor -- some positional --arguments -lah, the positional arguments are ran as a subprocess and monitored with the optiontracking_mode="process".