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 TPU parsing and TPU tests #2094

Merged
merged 37 commits into from
Jun 23, 2020
Merged

Conversation

lezwon
Copy link
Contributor

@lezwon lezwon commented Jun 6, 2020

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 to update the docs?
  • Did you write any new necessary tests?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

What does this PR do?

Fixes #1246

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 Jun 6, 2020

Hello @lezwon! Thanks for updating this PR.

Line 359:120: E501 line too long (124 > 119 characters)
Line 527:51: W504 line break after binary operator
Line 528:29: W504 line break after binary operator

Comment last updated at 2020-06-23 15:34:18 UTC

@mergify mergify bot requested a review from a team June 6, 2020 11:42
@Borda Borda requested review from Borda and williamFalcon June 6, 2020 14:03
@Borda Borda added feature Is an improvement or enhancement ci Continuous Integration accelerator: tpu Tensor Processing Unit labels Jun 6, 2020
@Borda Borda added this to the 0.8.0 milestone Jun 6, 2020
@Borda Borda added the Important label Jun 6, 2020
@codecov
Copy link

codecov bot commented Jun 6, 2020

Codecov Report

Merging #2094 into master will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #2094   +/-   ##
======================================
  Coverage      88%     88%           
======================================
  Files          70      70           
  Lines        5501    5516   +15     
======================================
+ Hits         4834    4849   +15     
  Misses        667     667           

@lezwon lezwon closed this Jun 7, 2020
@lezwon lezwon reopened this Jun 7, 2020
@lezwon lezwon marked this pull request as ready for review June 7, 2020 02:34
@awaelchli
Copy link
Contributor

what's the best way to test this? should we make a colab and run the tests from there manually?

@lezwon
Copy link
Contributor Author

lezwon commented Jun 7, 2020

what's the best way to test this? should we make a colab and run the tests from there manually?

@awaelchli yea. I tested this on Kaggle by running the tests manually. Notebook: https://www.kaggle.com/lezwon/pytorch-lightning-tpu-tests

tests/models/test_tpu.py Outdated Show resolved Hide resolved
tests/trainer/test_trainer.py Outdated Show resolved Hide resolved
@mergify mergify bot requested a review from a team June 7, 2020 02:58
@awaelchli
Copy link
Contributor

awaelchli commented Jun 7, 2020

Nice use of test parameterization! ❤️
Thanks for contributing these tests.

In the tests that just run the trainer I would at least add a test that the model is on the correct device, otherwise the test would pass if the model runs on cpu.
When we do a test for a feature, it is not enough to just do this:

trainer = Trainer(feature=True)
result = trainer.fit()
assert result

Because that only tests that the feature does not throw an error, but it does not test that the feature actually leads to the desired side effects.

@lezwon
Copy link
Contributor Author

lezwon commented Jun 7, 2020

Nice use of test parameterization! ❤️
Thanks for contributing these tests.

In the tests that just run the trainer I would at least add a test that the model is on the correct device, otherwise the test would pass if the model runs on cpu.
When we do a test for a feature, it is not enough to just do this:

trainer = Trainer(feature=True)
result = trainer.fit()
assert result

Because that only tests that the feature does not throw an error, but it does not test that the feature actually leads to the desired side effects.

Gotcha. Thanks for the review. I'll add the suggested changes. 😊

@Borda
Copy link
Member

Borda commented Jun 7, 2020

this will help us very much with checking any TOU edit and increase code coverage!

what's the best way to test this? should we make a colab and run the tests from there manually?

just need to add TPU machine to the test space @williamFalcon @luiscape

cc: @PyTorchLightning/core-contributors

@Borda Borda requested a review from awaelchli June 7, 2020 09:38
tests/models/test_tpu.py Show resolved Hide resolved
tests/models/test_tpu.py Show resolved Hide resolved
tests/trainer/test_trainer.py Show resolved Hide resolved
@mergify mergify bot requested a review from a team June 7, 2020 09:45
@mergify mergify bot requested a review from a team June 7, 2020 15:00
@Borda Borda added the ready PRs ready to be merged label Jun 7, 2020
@lezwon lezwon closed this Jun 8, 2020
@lezwon lezwon reopened this Jun 8, 2020
@lezwon lezwon marked this pull request as ready for review June 21, 2020 11:09
@lezwon
Copy link
Contributor Author

lezwon commented Jun 21, 2020

@Borda I've fixed the issue. It had to do when parsing CLI arguments. I will try to add tests for it.

@mergify mergify bot requested a review from a team June 21, 2020 12:33
@Borda Borda added the ready PRs ready to be merged label Jun 21, 2020
added suggesstion

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
@williamFalcon
Copy link
Contributor

@lezwon waiting on @Borda to finish adding TPU tests. once we do, we can merge this

@mergify
Copy link
Contributor

mergify bot commented Jun 23, 2020

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

@Borda
Copy link
Member

Borda commented Jun 23, 2020

@lezwon waiting on @Borda to finish adding TPU tests. once we do, we can merge this

I would merge it as it is now as it doe not affect any actual functionality/testing and then make a follow-up PR if we find that we have a bug somewhere...

@Borda
Copy link
Member

Borda commented Jun 23, 2020

Screenshot at 2020-06-23 17-50-27

@williamFalcon williamFalcon merged commit 9446390 into Lightning-AI:master Jun 23, 2020
@williamFalcon
Copy link
Contributor

done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accelerator: tpu Tensor Processing Unit ci Continuous Integration feature Is an improvement or enhancement ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add TPU tests
6 participants