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

Cannot control wandb metadata when running examples/seq2seq/finetune.py #5262

Closed
sshleifer opened this issue Jun 25, 2020 · 8 comments · Fixed by #5607
Closed

Cannot control wandb metadata when running examples/seq2seq/finetune.py #5262

sshleifer opened this issue Jun 25, 2020 · 8 comments · Fixed by #5607
Assignees

Comments

@sshleifer
Copy link
Contributor

sshleifer commented Jun 25, 2020

There is no easy way to control the wandb project_name kwarg.
How can we facilitate this without massive number of command line args?

@borisdayma
Copy link
Contributor

You should be able to do it with environment variables. See these docs
Let me know if that solves the issue.

The reason of the current implementation (and auto init of wandb) was to be able to instrument all example scripts without having to add custom wandb code.

There is documentation on W&B related to transformers that probably need to be updated to add this detail. We should probably also find a place to add documentation related to W&B integration in transformers repo. Let me know if I can be of any help.

@sshleifer
Copy link
Contributor Author

sshleifer commented Jun 30, 2020

You could make examples/wandb.md with information and link to it from examples/README.md? Or just link to this in examples/README.md

For the lightning WandbLogger integration, does $WANDB_PROJECT take precedence over passing WandbLogger(project='project_name')?

@borisdayma
Copy link
Contributor

Thanks, that's a great idea!

For the lightning integration, any parameter you pass explicitly in WandbLogger should take precedence.

@borisdayma
Copy link
Contributor

@sshleifer it seems that the pytorch-lightning integration is commonly used so I also added a reference to it in my PR.
Just curious, is it because you cannot do distributed computing with Trainer on multiple machines?

Would it make sense to add an easier integration on lightning_base with a similar logic to Trainer and TFTrainer, ie by using WandbLogger on generic_train whenever wandb is installed and logged in (and ignore it otherwise)?

@sshleifer
Copy link
Contributor Author

As long as we can avoid
(1) generating a lot of logs when I run the unittests on my local machine
(2) enabling gradient watching by default

That sounds like a good change to me. @patil-suraj what do you think? do you use wandb?

@patil-suraj
Copy link
Contributor

Yes, adding wandb integration on lightning_base makes sense to me given wandb is enabled by default in Trainer and TFTraner , this will enable wandb logging for run_pl_ner and run_pl_glue

With Trainer I can disable logging when I'm testing using WANDB_DISABLED env variable and gradient watching by setting
WANDB_WATCH .

env variables should avoid excessive command line args

@borisdayma
Copy link
Contributor

Thanks for the feedback @sshleifer and @patil-suraj
I can try to propose something similar for lightning_base. I'll wait for PR #5607 to be closed (feel free to comment if you think it's missing details) and I'll update the README accordingly when adding this functionality.

@sshleifer
Copy link
Contributor Author

Awesome. I had no idea that PR existed. Tag me next time and sorry for being so slow.

julien-c added a commit that referenced this issue Jul 14, 2020
* docs(wandb): explain how to use W&B integration

fix #5262

* Also mention TensorBoard

Co-authored-by: Julien Chaumond <chaumond@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants