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

Fix max_batches with fast_dev_run. #2581

Merged
merged 25 commits into from Jul 27, 2020
Merged

Fix max_batches with fast_dev_run. #2581

merged 25 commits into from Jul 27, 2020

Conversation

rohitgr7
Copy link
Contributor

What does this PR do?

Fixes #2531

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 🙃

@mergify mergify bot requested a review from a team July 11, 2020 11:29
@codecov
Copy link

codecov bot commented Jul 11, 2020

Codecov Report

Merging #2581 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #2581   +/-   ##
======================================
  Coverage      91%     91%           
======================================
  Files          70      70           
  Lines        5755    5755           
======================================
  Hits         5243    5243           
  Misses        512     512           

@rohitgr7 rohitgr7 changed the title Fix fast dev run Fix max_batches with fast_dev_run. Jul 11, 2020
@Borda Borda added the bug Something isn't working label Jul 11, 2020
Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify mergify bot requested a review from a team July 11, 2020 13:38
Copy link
Member

@awaelchli awaelchli 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 the fix. Should we add a test? Pretty sure this will break in the future otherwise :))

pytorch_lightning/trainer/evaluation_loop.py Outdated Show resolved Hide resolved
@mergify mergify bot requested a review from a team July 11, 2020 15:09
@Borda
Copy link
Member

Borda commented Jul 11, 2020

Thanks for the fix. Should we add a test? Pretty sure this will break in the future otherwise :))

Very much agree, pls add a test for it...

@rohitgr7 rohitgr7 changed the title Fix max_batches with fast_dev_run. [WIP] Fix max_batches with fast_dev_run. Jul 11, 2020
@rohitgr7
Copy link
Contributor Author

I initiated limit_{mode}_batches = 1 in trainer init itself because limit_{mode}_batches({mode}_percent_check) can be int now. Hope it doesn't break anything. Let me know if it's not correct I will revert it. Also added the test.

Copy link
Member

@awaelchli awaelchli left a comment

Choose a reason for hiding this comment

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

Great! Did you check that the test you added fails on master?

pytorch_lightning/trainer/training_loop.py Show resolved Hide resolved
@mergify mergify bot requested a review from a team July 11, 2020 22:25
@rohitgr7 rohitgr7 changed the title [WIP] Fix max_batches with fast_dev_run. Fix max_batches with fast_dev_run. Jul 12, 2020
@rohitgr7 rohitgr7 requested review from Borda and removed request for a team July 13, 2020 18:15
@mergify mergify bot requested a review from a team July 13, 2020 18:15
@Borda Borda requested a review from justusschock July 15, 2020 09:47
@Borda Borda added the ready PRs ready to be merged label Jul 15, 2020
@mergify mergify bot requested a review from a team July 15, 2020 09:48
@mergify
Copy link
Contributor

mergify bot commented Jul 21, 2020

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

@williamFalcon
Copy link
Contributor

@rohitgr7 let's merge this. but please check that the test you added does indeed fail on master

@rohitgr7
Copy link
Contributor Author

@williamFalcon Fails on master.

Screenshot from 2020-07-22 21-26-10
Screenshot from 2020-07-22 21-26-26

@mergify
Copy link
Contributor

mergify bot commented Jul 23, 2020

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

@rohitgr7
Copy link
Contributor Author

quick question: shouldn't this be (batch_idx + 1) % self.row_log_interval == 0?

@awaelchli
Copy link
Member

@rohitgr7 good catch. I think you are right, a few lines below there is the equivalent for the save interval.
Perhaps fix/discuss that in an new PR?

@pep8speaks
Copy link

pep8speaks commented Jul 27, 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-07-27 21:29:28 UTC

@williamFalcon
Copy link
Contributor

added more tests to be extra sure :)

@williamFalcon williamFalcon merged commit 84c507c into Lightning-AI:master Jul 27, 2020
@awaelchli
Copy link
Member

awaelchli commented Jul 27, 2020

nice work! excited to see these bugfixes in master!

@rohitgr7 rohitgr7 deleted the fix_fast_dev_run branch August 4, 2020 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IndexError with multiple validation loaders and fast_dev_run
5 participants