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

Pure package & base tests #2418

Merged
merged 12 commits into from
Jun 30, 2020
Merged

Pure package & base tests #2418

merged 12 commits into from
Jun 30, 2020

Conversation

Borda
Copy link
Member

@Borda Borda commented Jun 29, 2020

What does this PR do?

Add test for the package without extras

TODO

  • add doctest to run Trainer with single epoch

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 🙃

@Borda Borda added the ci Continuous Integration label Jun 29, 2020
@Borda Borda added this to the 0.8.x milestone Jun 29, 2020
@mergify mergify bot requested a review from a team June 29, 2020 12:42
@awaelchli
Copy link
Contributor

great idea! this should really help prevent bugs like #2410 sneaking in!

@codecov
Copy link

codecov bot commented Jun 29, 2020

Codecov Report

Merging #2418 into master will decrease coverage by 0%.
The diff coverage is n/a.

@@          Coverage Diff           @@
##           master   #2418   +/-   ##
======================================
- Coverage      89%     89%   -0%     
======================================
  Files          69      69           
  Lines        5477    5475    -2     
======================================
- Hits         4857    4855    -2     
  Misses        620     620           

@Borda Borda added the let's do it! approved to implement label Jun 30, 2020
@Borda Borda marked this pull request as ready for review June 30, 2020 12:49
@Borda
Copy link
Member Author

Borda commented Jun 30, 2020

@awaelchli any idea why Windows does not have any new PyTorch?

ERROR: Could not find a version that satisfies the requirement torch>=1.3 (from -r ./requirements/base.txt (line 4)) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch>=1.3 (from -r ./requirements/base.txt (line 4))

on the other hand, complete testing works fine... maybe because it is cached?

EDIT: resolved :]

@Borda
Copy link
Member Author

Borda commented Jun 30, 2020

this seems like a Win issue with PT...

pytorch_lightning\core\__init__.py:339: in <module>
    from pytorch_lightning.core.decorators import data_loader
pytorch_lightning\core\decorators.py:4: in <module>
    import torch
C:\hostedtoolcache\windows\Python\3.7.7\x64\lib\site-packages\torch\__init__.py:81: in <module>
    ctypes.CDLL(dll)
C:\hostedtoolcache\windows\Python\3.7.7\x64\lib\ctypes\__init__.py:364: in __init__
    self._handle = _dlopen(self._name, mode)
E   OSError: [WinError 126] The specified module could not be found

EDIT: resolved with installing CPU versions...
even CPU based machine installs CUDA version... :]

@mergify
Copy link
Contributor

mergify bot commented Jun 30, 2020

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

@Borda Borda changed the title base tests Pure package & base tests Jun 30, 2020
@Borda
Copy link
Member Author

Borda commented Jun 30, 2020

@awaelchli @williamFalcon mind check the final version?

Comment on lines -111 to -112
self.in_dim = in_dim
self.out_dim = out_dim
Copy link
Contributor

Choose a reason for hiding this comment

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

can we not leave it here?
save_hyperparameters will only save in_dim and out_dim, right?
the user should still be able to assign whatever they want to self.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, he does but we do not want to recommend this practice, right? @williamFalcon

Copy link
Contributor

Choose a reason for hiding this comment

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

people can do whichever but it’s better to use the save call for hparams tracking

pytorch_lightning/loggers/neptune.py Outdated Show resolved Hide resolved
Comment on lines +82 to +84
>>> import torch
>>> from torch.nn import functional as F
>>> from torch.utils.data import Dataset, DataLoader
Copy link
Contributor

Choose a reason for hiding this comment

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

if you want, you can move these to the top of the file, they don't necessarily need to be inside the doctest.

Copy link
Member Author

Choose a reason for hiding this comment

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

but they are not called outside test flake8 may complain about unused impprts

pytorch_lightning/trainer/trainer.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/trainer.py Outdated Show resolved Hide resolved
@mergify mergify bot requested a review from a team June 30, 2020 22:34
@awaelchli
Copy link
Contributor

it seems since you removed circle CI, we cannot preview docs anymore directly in the CI artifacts. Maybe we can add it back later.

@Borda
Copy link
Member Author

Borda commented Jun 30, 2020

it seems since you removed circle CI, we cannot preview docs anymore directly in the CI artifacts. Maybe we can add it back later.

well we are exporting build-docs with GH action but it is zip format, we may check if there is a way to browse it online or add CircleCI just for the docs? not sure how many people really used it... @PyTorchLightning/core-contributors?

EDIT: Just for the record CircleCI was dropped in #2378 #2412

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
@Borda Borda added the ready PRs ready to be merged label Jun 30, 2020
@williamFalcon williamFalcon merged commit e268061 into master Jun 30, 2020
@Borda Borda deleted the tests/base branch June 30, 2020 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration let's do it! approved to implement ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants