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

Trainer + wandb quality of life logging tweaks #6241

Merged
merged 3 commits into from
Aug 5, 2020
Merged

Conversation

TevenLeScao
Copy link
Contributor

As discussed on Slack, this PR adds the possibility for users to specify a name for the run in their wandb project, and logs the model config in addition to the trainer args in the wandb.init call (if there is a duplicate key, it is overriden by the trainer args)

@codecov
Copy link

codecov bot commented Aug 4, 2020

Codecov Report

Merging #6241 into master will decrease coverage by 0.03%.
The diff coverage is 55.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6241      +/-   ##
==========================================
- Coverage   79.61%   79.57%   -0.04%     
==========================================
  Files         146      146              
  Lines       26597    26600       +3     
==========================================
- Hits        21175    21167       -8     
- Misses       5422     5433      +11     
Impacted Files Coverage Δ
src/transformers/configuration_encoder_decoder.py 100.00% <ø> (ø)
src/transformers/modeling_encoder_decoder.py 92.20% <ø> (ø)
src/transformers/trainer.py 39.06% <0.00%> (-0.09%) ⬇️
src/transformers/trainer_tf.py 12.45% <0.00%> (-0.05%) ⬇️
src/transformers/training_args_tf.py 47.45% <ø> (ø)
src/transformers/benchmark/benchmark_args_utils.py 89.13% <100.00%> (ø)
src/transformers/tokenization_utils_base.py 93.84% <100.00%> (ø)
src/transformers/training_args.py 80.39% <100.00%> (+0.19%) ⬆️
src/transformers/generation_tf_utils.py 79.19% <0.00%> (-2.51%) ⬇️
src/transformers/file_utils.py 80.30% <0.00%> (+0.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5b0a0e...f588bd6. Read the comment docs.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! Could you copy the lines in setup for TFTrainer as well and the doc line in TFTrainingArguments? (no need to redefine it there with field as TFTrainingArguments subclasses TFTrainingArguments).

src/transformers/trainer.py Outdated Show resolved Hide resolved
src/transformers/training_args.py Outdated Show resolved Hide resolved
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

src/transformers/trainer.py Outdated Show resolved Hide resolved
src/transformers/training_args.py Outdated Show resolved Hide resolved
TevenLeScao and others added 2 commits August 4, 2020 18:47
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
@TevenLeScao
Copy link
Contributor Author

Updated the PR with your comments!

@TevenLeScao
Copy link
Contributor Author

But CI looks like it broke inbetween

@borisdayma
Copy link
Contributor

borisdayma commented Aug 4, 2020

I love the fact that more parameters are now auto logged.

For info the approach right now in this integration was to pass environment variables to configure wandb.init so you can set many more parameters: https://docs.wandb.com/library/environment-variables

You can also call wandb.init yourself before which will replace any future ones with a noop.

People use a lot of different init parameters so you can either add them manually (like with the run_name one) or could use a "kwargs" approach to accept more (and extract all the valid ones or even just the ones starting with wandb_).

@dsblank
Copy link
Contributor

dsblank commented Aug 4, 2020

Hello @LysandreJik and friends! If you like more items being logged, hopefully someone can review #6176 sooner than later to cut down on merge conflicts. I re-arranged some of the wandb and tensorboard initialization code to better accommodate what could be a growing list of integrations.

@TevenLeScao
Copy link
Contributor Author

@LysandreJik @dsblank do you think we should merge #6176 first?

@sgugger
Copy link
Collaborator

sgugger commented Aug 5, 2020

Merging this right now since it's ready. @dsblank Sorry for the delay in reviewing your PR, I'm heading there next and will help solve potential merge conflicts if needed.

@sgugger sgugger merged commit bd0eab3 into master Aug 5, 2020
@sgugger sgugger deleted the wand_trainer_qol branch August 5, 2020 13:05
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 this pull request may close these issues.

None yet

5 participants