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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle batchnorms in BatchGradientVerification #569

Merged
merged 6 commits into from Mar 9, 2021

Conversation

indigoviolet
Copy link
Contributor

What does this PR do?

Fixes #568

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?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests? [not needed for typos/docs]
  • 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

  • Is this pull request ready for review? (if not, please submit in draft mode)

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 馃檭

@codecov
Copy link

codecov bot commented Feb 24, 2021

Codecov Report

Merging #569 (1727cc7) into master (4d194d4) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #569      +/-   ##
==========================================
+ Coverage   76.97%   77.02%   +0.05%     
==========================================
  Files         117      117              
  Lines        6836     6852      +16     
==========================================
+ Hits         5262     5278      +16     
  Misses       1574     1574              
Flag Coverage 螖
cpu 26.20% <33.33%> (+0.01%) 猬嗭笍
pytest 26.20% <33.33%> (+0.01%) 猬嗭笍
unittests 76.51% <100.00%> (+0.05%) 猬嗭笍

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage 螖
pl_bolts/callbacks/verification/batch_gradient.py 100.00% <100.00%> (酶)

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 4d194d4...9157012. Read the comment docs.

Copy link
Contributor

@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.

nice fix

pl_bolts/callbacks/verification/batch_gradient.py Outdated Show resolved Hide resolved
@indigoviolet
Copy link
Contributor Author

Looks like the test failures are unrelated, something to do with mnist downloads?

@awaelchli
Copy link
Contributor

awaelchli commented Mar 5, 2021

Hey @indigoviolet

Great work!

I allowed myself to 1) add some docs to the context manager 2) rename it to selective_eval becaue it's not specific to normalization layers (what do you think of the name?) and 3) add some tests

hope that's ok!
The tests that fail here also seem to fail locally on master, but for the changes in this PR all seems fine so far.

@awaelchli awaelchli added the ready label Mar 5, 2021
@indigoviolet
Copy link
Contributor Author

@awaelchli very nice, thank you.

@Borda Borda enabled auto-merge (squash) March 6, 2021 20:58
@Borda
Copy link
Member

Borda commented Mar 6, 2021

@indigoviolet mind check the failing tests?

@indigoviolet
Copy link
Contributor Author

@Borda the test failures were unrelated to this PR, something to do with PY3 and torch._six. I've merged upstream master, hopefully that fixes it.

@indigoviolet
Copy link
Contributor Author

/opt/hostedtoolcache/Python/3.6.13/x64/lib/python3.6/urllib/request.py:650: HTTPError
----------------------------- Captured stdout call -----------------------------
Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to /home/runner/work/pytorch-lightning-bolts/pytorch-lightning-bolts/datasets/MNIST/raw/train-images-idx3-ubyte.gz

Now the failure seems to be something to do with mnist downloads, also unrelated to this PR. I'm not sure how to fix this (@Borda)

@kaushikb11
Copy link
Contributor

Hi @indigoviolet, the tests will be fixed in #580

@Borda Borda merged commit 1c3f25d into Lightning-Universe:master Mar 9, 2021
@awaelchli
Copy link
Contributor

Thanks a lot @indigoviolet for working on this!

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

Successfully merging this pull request may close these issues.

BatchGradientVerification should probably turn off batch norm
4 participants