mlco2 / codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.
https://mlco2.github.io/codecarbon
MIT License
1.01k stars 158 forks source link

Monitor subprocess #431

Open jennydaman opened 11 months ago

jennydaman commented 11 months ago

Resolves https://github.com/mlco2/codecarbon/issues/382

This PR adds functionality to the codecarbon monitor command.

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 option tracking_mode="process".

SaboniAmine commented 1 month ago

@benoit-cty besides documentation, is there any other blocker on this PR ?

benoit-cty commented 1 month ago

@benoit-cty besides documentation, is there any other blocker on this PR ?

It has to be tested to ensure it works as expected.