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

Option to disable CodeCarbon #26036

Closed
nebrelbug opened this issue Sep 7, 2023 · 9 comments · Fixed by #26155
Closed

Option to disable CodeCarbon #26036

nebrelbug opened this issue Sep 7, 2023 · 9 comments · Fixed by #26155

Comments

@nebrelbug
Copy link
Contributor

Feature request

  • Allow disabling of CodeCarbon reporting, even when it's installed

Motivation

I'm running code using the Trainer class across several nodes in an HPC environment using SLURM. It seems to automatically use the CodeCarbon callback, but unfortunately doesn't work correctly in my multi-node environment and floods my log files with hundreds of distracting messages (mentioned earlier in mlco2/codecarbon#252).

image

Your contribution

I'd be happy to contribute and/or open a PR, given some guidance about where to start.

@amyeroberts
Copy link
Collaborator

Hi @nebrelbug, thanks for raising this issue!

Sounds like a good idea to me. @muellerzr will know more about it than me and can advise.

@muellerzr
Copy link
Contributor

That sounds fine to me as well @nebrelbug.

We have a few options here:

  1. Globally disable codecarbon via an environmental variable (similar to DISABLE_WANDB, or something along those lines)
  2. Have it as a TrainingArgument (don't quite like that solution)
  3. Or: don't add the codecarbon callback if we know we are in a multi-node scenario.

I think I'd prefer 3 if possible, otherwise 1 :) WDYT?

@nebrelbug
Copy link
Contributor Author

nebrelbug commented Sep 8, 2023

@muellerzr I don't think that CodeCarbon is necessarily broken for everyone using multiple nodes, so my personal preference would be option 1.

Would it be alright if I opened a PR to disable the callback when DISABLE_CODECARBON is set?

@muellerzr
Copy link
Contributor

@nebrelbug actually looking at this more, does using --report_to "none" give the desired result?

@muellerzr
Copy link
Contributor

If so, we should expand the doc on the report_to param in TrainingArguments to mention codecarbon

@nebrelbug
Copy link
Contributor Author

@muellerzr it does, actually! Setting report_to to either "none" or "wandb" results in CodeCarbon not running.

@muellerzr
Copy link
Contributor

Thanks for verifying! Lets go ahead and add it to the report_to doc string @nebrelbug

@nebrelbug
Copy link
Contributor Author

nebrelbug commented Sep 13, 2023

@muellerzr sweet! I actually think the doc string for report_to may be complete (though a little hard to find). Instead, I opened up a PR at #26155 to update the Callback doc page. Let me know if that sounds good!

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants