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

disable optimizers setup during testing #3059

Merged
merged 16 commits into from
Sep 28, 2020
Merged

disable optimizers setup during testing #3059

merged 16 commits into from
Sep 28, 2020

Conversation

rohitgr7
Copy link
Contributor

@rohitgr7 rohitgr7 commented Aug 19, 2020

What does this PR do?

Disable configuring optimizers and schedulers during testing.

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together? Otherwise, we ask you to create a separate PR for every change.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@pep8speaks
Copy link

pep8speaks commented Aug 19, 2020

Hello @rohitgr7! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-09-28 21:20:45 UTC

@rohitgr7 rohitgr7 changed the title disable configure_optimizers during testing [WIP] disable configure_optimizers during testing Aug 20, 2020
@Borda Borda added this to the 0.9.x milestone Aug 20, 2020
@codecov
Copy link

codecov bot commented Aug 21, 2020

Codecov Report

Merging #3059 into master will increase coverage by 5%.
The diff coverage is 93%.

@@           Coverage Diff           @@
##           master   #3059    +/-   ##
=======================================
+ Coverage      86%     91%    +5%     
=======================================
  Files         110     110            
  Lines        8220    8206    -14     
=======================================
+ Hits         7069    7463   +394     
+ Misses       1151     743   -408     

@rohitgr7 rohitgr7 changed the title [WIP] disable configure_optimizers during testing disable configure_optimizers during testing Aug 21, 2020
@rohitgr7 rohitgr7 marked this pull request as ready for review August 21, 2020 19:00
@mergify mergify bot requested a review from a team August 21, 2020 19:00
@rohitgr7
Copy link
Contributor Author

amp tests are just checking that training is a success or not. There is no test to check whether the model and optimizers are actually configured with apex/native_amp or not.

@Borda Borda added feature Is an improvement or enhancement ci Continuous Integration and removed ci Continuous Integration labels Aug 24, 2020
@SkafteNicki
Copy link
Member

@rohitgr7 PR is looking good, just wanted to ask why it is necessary to disable configuration during testing?

@rohitgr7
Copy link
Contributor Author

@SkafteNicki if someone wants to use lightning module for the sole purpose of testing or monitoring the performance of their model, then only test part of lightning module is required so I don't think optimizers or schedulers are required here. If we keep it as it is, I might throw an error since .test actually calls .fit

@mergify
Copy link
Contributor

mergify bot commented Aug 24, 2020

This pull request is now in conflict... :(

@SkafteNicki
Copy link
Member

@rohitgr7 good point. If there is a use case right now on master that produce an error (related to this), we should probably write an test that quantifies that this PR solves that :]

@rohitgr7 rohitgr7 changed the title disable configure_optimizers during testing [WIP] disable configure_optimizers during testing Aug 24, 2020
@rohitgr7
Copy link
Contributor Author

@SkafteNicki a simple one I can think of is just implement test_step and test_epoch_end and call trainer.test(). Ideally it should work but it throws an error. We definitely need some tests for this. Marked as WIP.

@rohitgr7
Copy link
Contributor Author

rohitgr7 commented Aug 24, 2020

lots of refactoring going on with accelerators. I guess I'll wait for some time to work on this PR.

@rohitgr7
Copy link
Contributor Author

should I write supporting tests for each backend?

Copy link
Contributor

@ananthsub ananthsub left a comment

Choose a reason for hiding this comment

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

I only have a few style comments, but the core looks good to me! Thank you for adding this @rohitgr7 !

@mergify mergify bot requested a review from a team September 19, 2020 15:42
@Borda Borda added the ready PRs ready to be merged label Sep 28, 2020
@Borda Borda removed the ready PRs ready to be merged label Sep 28, 2020
@Borda
Copy link
Member

Borda commented Sep 28, 2020

seems some more GPU tests are failing, @rohitgr7 mind check it...

tests/base/model_valid_epoch_ends.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/__init__.py Outdated Show resolved Hide resolved
tests/callbacks/test_model_checkpoint.py Outdated Show resolved Hide resolved
tests/loggers/test_tensorboard.py Outdated Show resolved Hide resolved
tests/loggers/test_tensorboard.py Outdated Show resolved Hide resolved
@rohitgr7 rohitgr7 changed the title disable optimizers setup during testing [WIP] disable optimizers setup during testing Sep 28, 2020
@rohitgr7 rohitgr7 changed the title [WIP] disable optimizers setup during testing disable optimizers setup during testing Sep 28, 2020
@rohitgr7
Copy link
Contributor Author

@Borda fixed the bug.

@Borda Borda merged commit 7837505 into master Sep 28, 2020
@Borda Borda deleted the fix_test_conf_opt branch September 28, 2020 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants