352 Commits
Author SHA1 Message Date
Justus Schock c05077fae3 Enable non-blocking for gpu device transfer (#1843)
* Update distrib_parts.py

* Update CHANGELOG.md
2020-05-14 17:56:40 -04:00
Jirka Borovec bee0392c37 extend arg parser (#1842)
* extend arg parser

* flake8

* tests

* example

* fix test
2020-05-14 17:56:11 -04:00
Nicki SkafteandNicki Skafte 88f816ed06 dummy logger (#1836)
Co-authored-by: Nicki Skafte <nugginea@gmail.com>
2020-05-14 10:34:11 -04:00
William Falcon 53d9316a56 fixes ddp bugs (#1819)
* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug
2020-05-13 19:17:04 -04:00
William FalconandNate Raw 648d516668 Use store_true for bool args (#1822)
*  Use store_true for bool args

* debug

Co-authored-by: Nate Raw <nxr9266@g.rit.edu>
2020-05-13 19:12:06 -04:00
Ashwin Bharambe 0e71705a0a [checkpoint logic] Fix bug which doesn't account for NoneType for model.hparams (#1817)
The intention of the code is to output a warning message when `hparams`
is null or not set. Instead the code now fatals when
`model.hparams = None`. Prevent that.
2020-05-13 17:14:11 -04:00
663b90035c Bugfix: accumulation and suggestion for learning rate finder (#1801)
* fix suggestion being too naive

* fix accumulation error and added new tests

* fix styling

* update CHANGELOG.md

* update based on review

* fix tests

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Nicki Skafte <nugginea@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-05-13 14:40:44 -04:00
Ashwin Bharambe aefc5314bc [ddp] Support multi-node distributed execution under torchelastic (#1811)
The changes are quite local and limited in nature -- viz., checking for
some indicator environment variables. We check for (SLURM_LOCALID,
NODE_RANK, GROUP_RANK) in order. If multiple are found set, a warning is
logged.

This patch also fixes a minor bug with comparing the `WORLD_SIZE`
environment variable. This can be a string type.
2020-05-13 14:06:59 -04:00
22d7d03118 Replace meta_tags.csv with hparams.yaml (#1271)
* Add support for hierarchical dict

* Support nested Namespace

* Add docstring

* Migrate hparam flattening to each logger

* Modify URLs in CHANGELOG

* typo

* Simplify the conditional branch about Namespace

Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>

* Update CHANGELOG.md

Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>

* added examples section to docstring

* renamed _dict -> input_dict

* mata_tags.csv -> hparams.yaml

* code style fixes

* add pyyaml

* remove unused import

* create the member NAME_HPARAMS_FILE

* improve tests

* Update tensorboard.py

* pass the local test w/o relavents of Horovod

* formatting

* update dependencies

* fix dependencies

* Apply suggestions from code review

* add savings

* warn

* docstrings

* tests

* Apply suggestions from code review

* saving

* Apply suggestions from code review

* use default

* remove logging

* typo fixes

* update docs

* update CHANGELOG

* clean imports

* add blank lines

* Update pytorch_lightning/core/lightning.py

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* Update pytorch_lightning/core/lightning.py

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* back to namespace

* add docs

* test fix

* update dependencies

* add space

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
2020-05-13 15:05:15 +02:00
Jirka BorovecandJustus Schock 10ce1c0256 device property (#1791)
* device property

* add/copy properties

* inherit

* rename

* Apply suggestions from code review

Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>

* dtype

* prop

* pt api

Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
2020-05-12 23:18:39 -04:00
Adrian Wälchli 8978794730 add missing flag (#1805) 2020-05-12 17:06:38 -04:00
Oliver Neumann 9059d21042 Missing profiler attribute in add_argparse_args() ArgumentParser (#1794)
* Fixed typing annotation by adding boolean type. After that Profiler flag will be added to argparse.

* Updated CHANGELOG.md

* Updated git_init_arguments_and_types() to pass doctests.

* Added doctest example to add_argparse_parser()
2020-05-12 08:53:26 -04:00
619f984c36 Option to provide seed to random generators to ensure reproducibility (#1572)
* Option to provide seed to random generators to ensure reproducibility

I added small function in utilities which imports torch, numpy, python
random and sets seed for all of the libraries to ensure reproducibility
of results.

* Apply recommendations from core contributors on seeding

1. Moved the seeding code to another file
2. Make deterministic as a parameter for trainer class
3. Add assertions for seeding numpy
4. Added warnings
5. torch.manual_seed should be enough for seeding torch

* Revert "Apply recommendations from core contributors on seeding"

This reverts commit a213c8e6882eec8a9e7408b9418926d2db7c5461.

* Revert "Revert "Apply recommendations from core contributors on seeding""

This reverts commit 59b2da53c62878de7aab0aa3feb3115e105eea06.

* Change in test, for correct seeding

* Allow seed equal to 0

* Allow seed to be uint32.max

* Added deterministic to benchmarks

* Cuda manual seed as in benchmark seeding

* Seeding should be done before model initialization

* cuda manual_seed is not necessary

* Fixing seed test_cpu_lbfgs

On some seeds seems like lbfgs doesn't converge.
So I fixed the seed during testing.

* rebasing issue with old reproducibility.py

* Improved documentation and ability to seed before initializing Train
class

* Change in docs

* Removed seed from trainer, update for documentation

* Typo in the docs

* Added seed_everything to _all_

* Fixing old changes

* Model initialization should be earlier then Trainer

* Update pytorch_lightning/trainer/__init__.py

From Example to testcode

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

* Fixing according to the contributors suggestions

* Moving horovod deterministic to Trainer class

* deterministic flag affects horovod docs update

* Improved static typing

* Added deterministic to test runners of horovod

It is failing on some versions, not very predictable

* static seeds for horovod tests

* Change for reset_seed function in tests

* Seeding horovod using reset_seed from tutils

* Update pytorch_lightning/trainer/__init__.py

* chlog

* Update trainer.py

* change "testcode" to "Example" in trainer init documentation

* Update pytorch_lightning/trainer/seed.py, first line in comment

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

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Jirka <jirka.borovec@seznam.cz>
Co-authored-by: William Falcon <waf2107@columbia.edu>
2020-05-12 07:53:20 -04:00
William FalconandJirka 10b16dbfab made ddp the default if no backend specified with multiple GPUs (#1789)
* made ddp the default if no backend specified with multiple GPUs

* fix

* spawn

Co-authored-by: Jirka <jirka.borovec@seznam.cz>
2020-05-12 06:54:23 -04:00
Travis AddairandJirka acab068c74 Join Horovod workers at the end of trainer.fit() to prevent race conditions following training (#1786)
* Join Horovod workers at the end of trainer.fit() to prevent race conditions following training

* flake8

* flake8

Co-authored-by: Jirka <jirka.borovec@seznam.cz>
2020-05-12 09:15:25 +00:00
William Falcon 7b60d49432 fixed native amp + ddp (#1788)
* fixed native amp + ddp

* fixed native amp + ddp
2020-05-12 00:25:06 -04:00
Jeremy Jordan 1df0d2dc97 set logger level for package (#1718)
* move logging config to trainer class init

* alternate logging config
2020-05-12 00:14:35 -04:00
William Falcon 4b30ef6480 Device (#1790)
* added self.device

* added docs
2020-05-12 00:09:48 -04:00
Kevin Chen de1fdd8d3b Removed test_dataloader call in check_testing_model_configuration (#1670)
* Removed test_dataloader call

* Check if test_dataloader is actually overriden

* Fixed method spelling

* Replaced lambdas

* Replaced None with super method

* Fixed testpass
2020-05-12 00:08:07 -04:00
William Falcon 5bb6b41b78 dataloaders with fast_dev_run (#1787)
* dataloaders with fast_dev_run

* dataloaders with fast_dev_run

* dataloaders with fast_dev_run

* fix

* pep 8
2020-05-11 23:32:44 -04:00
Fabio Natanael Kepler d120f97896 Fix saving native AMP scaler state (#1777)
Saving was introduced in #1561.
2020-05-11 21:38:37 -04:00
William Falcon eeb411144f enable fast_dev_run without a validation loop (#1779)
* fix val dataloader

* Update evaluation_loop.py
2020-05-11 11:30:22 -04:00
Alexander KreuzerandAlexander Kreuzer ee17c7c9c8 Fixed error message and test docstring (#1698)
training_dataloader -> train_dataloader

Co-authored-by: Alexander Kreuzer <alexander.kreuzer@sap.com>
2020-05-10 13:16:16 -04:00
4970927ec8 Feature: auto scale batch size (#1638)
* auto batch finder

* fix styling

* add description

* add different modes

* fix copy paste error

* better organised code

* fix styling

* add tests

* fix

* fix

* add some documentation

* added CHANGELOG.md

* some documentation

* update based on review

* Update trainer.py

* Update docs/source/training_tricks.rst

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* Update tests/trainer/test_trainer_tricks.py

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

* Update tests/trainer/test_trainer_tricks.py

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

* Apply suggestions from code review

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* use EvalModelTemplate

* param tests

* rename

* wrap params

* rename function

* rename

* rename param

* fix

* abs

* rename

* refactor code

* add docs

* try

* arg

* loop

* exept

* loop

* drop bool

* docs

* docs

* added check and test for passing dataloader to fit

* styling fix

* update based on review

Co-authored-by: Nicki Skafte <nugginea@gmail.com>
Co-authored-by: William Falcon <waf2107@columbia.edu>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Jirka <jirka.borovec@seznam.cz>
2020-05-09 08:28:36 -04:00
Adrian WälchliandJirka 25bbd059df Also update progress_bar in training_epoch_end (#1724)
* update prog. bar metrics on train epoch end

* changelog

* wip test

* more thorough testing

* comments

* update docs

* move test

Co-authored-by: Jirka <jirka.borovec@seznam.cz>
2020-05-08 23:31:56 -04:00
Yuri Brovmanandybrovman 3a642601e8 added warning for None dataloader (#1745)
* added warning for None dataloader

* fixed variable style

* updated warning message

* remove unused import

Co-authored-by: ybrovman <ybrovman@ebay.com>
2020-05-07 09:26:41 -04:00
Shunta Komatsu f656882942 Fix typo (#1750) 2020-05-07 09:25:54 -04:00
Pavel Grunt b9364f96b1 lr_finder: Fix typo in docstring (#1746) 2020-05-06 12:39:22 -04:00
Peter Yu 851866333c Attach version_ to checkpoint path only if version is int (#1748) 2020-05-06 12:38:32 -04:00
Yuri Brovmanandybrovman 35bbe178bd fix _reset_eval_dataloader() for IterableDataset (#1560)
* removed if dl from _reset_eval_dataloader()

* changed to if dl != None to be more safe

* hints from pep8speaks

Co-authored-by: ybrovman <ybrovman@ebay.com>
2020-05-05 14:09:48 -04:00
Tian Wang d6a0375974 Fixing logic (#1734) 2020-05-05 14:07:26 -04:00
Jirka BorovecandWilliam Falcon 2a2f303ae9 Tests: refactor trainer dataloaders (#1690)
* refactor default model

* drop redundant seeds

* refactor dataloaders tests

* fix multiple

* fix conf

* flake8

* Apply suggestions from code review

Co-authored-by: William Falcon <waf2107@columbia.edu>

Co-authored-by: William Falcon <waf2107@columbia.edu>
2020-05-05 12:31:15 -04:00
Travis Addair f90afa29b8 Fix disabling progress bar on non-zero ranks using Horovod backend (#1709)
* Fix Horovod backend to disable progress bar on all ranks except 0

* Add join barriers

* Added changelog

* Make protected and add verbosity

* Refactor to disable progress bar callback in train

* Removed vebose setting

* Add cache check for Horovod

* Test run again

* Updated comment

* Always skip cache for Horovod

* Only reinstall when necessary

* Added separate step

* Fixed spacing

* Skip Python 3.8
2020-05-04 13:02:57 -04:00
Nicki SkafteandNicki Skafte e865b046b1 Bugfix/lr finder (#1676)
* fix early stopping bug

* allow val dataloader

* update CHANGELOG.md

* fix early stopping bug

* allow val dataloader

* update CHANGELOG.md

Co-authored-by: Nicki Skafte <nugginea@gmail.com>
2020-05-04 11:38:51 -04:00
Adrian Wälchli d28b145393 Update type hints for multiple dataloaders in .fit() and .test() (#1723)
* update typehints

* change log
2020-05-04 08:24:34 -04:00
Adrian WälchliandJ. Borovec e6b34ef90d [WIP] Reduction when batch size < num gpus (#1609)
* reduce if <= num_gpus

* add test with explanation

* chlog

* fix changelog

Co-authored-by: J. Borovec <jirka.borovec@seznam.cz>
2020-05-02 11:01:44 -04:00
Travis AddairandJirka 2950f66983 Fix Horovod distributed backend to set the root_gpu property (#1669)
* params

* drop acc

* Fix Horovod distributed backend to set the root_gpu

* Fixed test

* Fixed tests

* Fixed lint

* Set root_gpu during initialization

* chlog

Co-authored-by: Jirka <jirka.borovec@seznam.cz>
2020-05-01 14:13:35 -04:00
Nathan Breitsch 3eac6cfd4f Don't convert namedtuple to tuple (#1589)
* Don't convert namedtuple to tuple

* Test namedtuples sent to device correctly
2020-04-30 08:04:50 -04:00
William FalconandJ. Borovec d40425d257 added warning to crash (#1625)
* added warning to crash

* formatting

Co-authored-by: J. Borovec <jirka.borovec@seznam.cz>
2020-04-30 08:04:18 -04:00
Jacob ZhongandJirka Borovec f9c9e39ab8 Add log output for slurm (#1657)
* add log output for slurm

* change log levels

* formatting

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2020-04-30 07:58:03 -04:00
Peter Yu 8d564b5e38 call on_load_checkpoint() when resuming from checkpoint (#1666) 2020-04-30 07:57:24 -04:00
Dan Campbell 981758fd04 Only call load_spawn_weights if COLAB_GPU or KAGGLE_URL_BASE
environment variables are set
2020-04-27 19:46:29 -04:00
William Falcon 4c4d0e6bc6 Merge pull request #1635 from PyTorchLightning/pkl
Fixes CPU DDP breaking change and DDP change
2020-04-27 07:42:42 -04:00
William Falcon cebc74f7bc ddp pickle 2020-04-27 07:19:12 -04:00
William Falcon 2181ad1bc7 ddp pickle 2020-04-27 07:12:04 -04:00
William Falcon d2989f76e6 ddp pickle 2020-04-27 07:08:34 -04:00
William Falcon d5dff384eb ddp pickle 2020-04-27 07:07:03 -04:00
William Falcon 4aac5568a6 ddp pickle 2020-04-27 07:05:29 -04:00
William Falcon 6e86b59d21 ddp pickle 2020-04-27 06:51:42 -04:00
Justus Schock f91b131ba2 Remove warning 2020-04-27 11:41:03 +02:00