Commit Graph

35 Commits

Author SHA1 Message Date
Carlos Mocholí e0f2e041b9
Share the training step output data via `ClosureResult` (#9349) 2021-09-10 11:40:20 +00:00
Carlos Mocholí 8407238d66
Keep hidden state in the optimization loops (#9368) 2021-09-08 13:43:40 +00:00
Carlos Mocholí 15d943089d
Enforce that the optimizer closure is executed when `optimizer_step` is overridden (#9360) 2021-09-08 12:24:57 +02:00
Adrian Wälchli ca679cd78f
Add `ManualOptimization` loop (#9266)
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
Co-authored-by: thomas chaton <thomas@grid.ai>
2021-09-08 02:26:39 +02:00
Jirka Borovec 6e124e7207
CI: precommit - docformatter (#8584)
* CI: precommit - docformatter
* fix deprecated

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-09-06 12:49:09 +00:00
Adrian Wälchli b91747ef75
remove backward from training batch loop (#9265) 2021-09-03 00:15:40 +00:00
Adrian Wälchli 75350938ca
extract optimizer loop (#9191) 2021-09-02 12:40:05 +01:00
thomas chaton ff7305f74d
[bugfix] Prevent a DDP failure using copy (#9239) 2021-08-31 21:02:33 +00:00
Adrian Wälchli f2b5f34592
Move `TrainingBatchLoop.build_kwargs` to utilities (#9198)
Co-authored-by: Carlos Mocholi <carlossmocholi@gmail.com>
2021-08-30 17:00:26 +01:00
Adrian Wälchli c0bd658354
Remove calls to internal dev debugger in training- and eval loop (#9188) 2021-08-30 17:16:59 +02:00
Adrian Wälchli 908b9eebc7
move `block_ddp_sync_behaviour` to utilities (#9192) 2021-08-30 14:56:16 +00:00
Adrian Wälchli 6592d0e454
generalize closure api in Lightning (#8642)
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
Co-authored-by: thomas chaton <thomas@grid.ai>
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
2021-08-26 08:36:21 +00:00
thomas chaton f959b13ab9
3/n inter batch parallelism (#9052)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Carlos Mocholi <carlossmocholi@gmail.com>
2021-08-24 18:45:54 +00:00
thomas chaton 92c7eec966
2/n inter batch parallelism (#9047)
Co-authored-by: Carlos Mocholi <carlossmocholi@gmail.com>
2021-08-23 19:30:44 +00:00
Yifu Wang 938a191406
Add a flavor of training_step that takes dataloader_iter as an argument (#8807)
* Add a flavor of training_step that takes dataloader_iter as an argument
2021-08-16 19:01:09 +00:00
Carlos Mocholí d0efb55b0f
Delete `TrainingEpochLoop._dataloader_idx` which always equals 0 (#8911) 2021-08-16 13:34:42 +02:00
ananthsub b47e3ab7ce
Remove truncated_bptt_steps from Trainer constructor (#8825)
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
2021-08-11 03:26:01 +00:00
ananthsub c4a1c8ba20
Fix truncated backprop through time when set on LightningModule and not Trainer (#8804)
* Fix truncated backprop through time set on LightningModule and not Trainer
2021-08-09 21:23:05 -07:00
Adrian Wälchli 529c42f848
fix collecting training_step outputs (#8613) 2021-07-30 13:03:15 +00:00
Carlos Mocholí 5789e9f5e4
Fix reference issues during epoch end result collection (#8621)
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
2021-07-30 12:16:47 +00:00
Adrian Wälchli 7901d297d3
remove support for optimizer_idx in the training_step for manual optimization (#8576) 2021-07-29 08:30:45 +00:00
Carlos Mocholí c2199fbbee
Fix `trainer.fit_loop.split_idx` reference (#8601)
* Fix split idx reference

* Update CHANGELOG

* Add comment
2021-07-29 08:00:04 +00:00
Carlos Mocholí 7914e494dd
Replace `iteration_count` and other index attributes in the loops with progress dataclasses (#8477)
* Delete `iteration_count` and `batches_seen`

* Update CHANGELOG

* Protect should accumulate

* Update pytorch_lightning/loops/epoch/training_epoch_loop.py
2021-07-27 18:36:20 +02:00
Carlos Mocholí a64cc37394
Replace `yapf` with `black` (#7783)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-07-26 13:37:35 +02:00
Adrian Wälchli 7d93d70110
Loop specialization (#8226)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: tchaton <thomas@grid.ai>
Co-authored-by: Carlos Mocholi <carlossmocholi@gmail.com>
Co-authored-by: Justus Schock <justus.schock@posteo.de>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2021-07-19 15:08:53 +02:00
thomas chaton 7bb810f143
Add progress tracking on Loops - 2/n (#8362)
* resolve issues

* update

* update

* update

* add more exceptions

* resolve bug

* update

* update

* update changelog

* resolve bug

* resolve comments

* update

* update

* update changelog

* update

* update

* remove space

* update

* add progress tracking to loops

* validate json

* update

* convert to dict for better readability

* validate reload

* update

* update

* update on comments

* remove deadcode

* clean changelog

* clean changelog

* update

* update on comments

* CHANGELOG

* CHANGELOG

* Update pytorch_lightning/loops/base.py

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

* whitespace suggestions

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* make fault_tolerant_enabled protected

* whitespace fixes around Args

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update

* typo it's -> its

* fix copy-paste typo in progress docstring

* Delete classes

* Minor change

* docs

* protected get_loops_state

* merge restore_loops with restore_progress

* Fix tests after removals

* explicit save with trainer.save_checkpoint()

* handle optimization restart based on optimizer_idx

* update increments

* update val batch progress and remove iteration count

* update progress tracking for dataloader loops

* remove self.dataloader_idx from eval_epoch_loop

* add batch progress to predict loop

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* incorporate progress tracking for current_epoch

* Fix test

* Actually remove it

* Remove unused TrainingEpochProgress

* Fix optimization progress - missing scheduler

* Restarting changes

* Scheduler progress

* Unused property, reset on epoch

* Resolve FIXME

* Remove FIXME

* fix test_progress (wip)

* fix batch_progress.current.reset

* Hold off on split progress. Out of scope of this PR

* Unnecessary if

* fix structure in test_progress

* structure

* clean up unused variables in test_progress

* refactor naming and organization in test_progress

* Unnecessary variable

* Remove unnecessary diff

* Improve comment

* Undo typing change to avoid polluting everything with mypy fixes

* Fix and improve test_loops.py

* Fix and organize `test_loop_state_dict`

* Remove unnecessary checks in test

* Update test after disallowing updates on None attributes

* Typing

* Minor test cleanup

* Fix and move loop test

* Move test from progress to loops

* Reset the scheduler progress

* SchedulerProgress fix

* Consistent whitespace

* Fix final test

* Minor test changes

* One test to rule them all

* Formatting

* Rename and clean variables

* Shorter names

* Shorter scheduler name

* Fix optimizer step calculation for stop_batch=2

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove empty connects

* Update CHANGELOG

* Holy shit finally got the formula right

* Fix final thing!!!

* Do not check state dicts

* parametrize multiple_dataloader progress test

* Update CHANGELOG.md

Co-authored-by: Carlos Mocholi <carlossmocholi@gmail.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Justus Schock <justus.schock@posteo.de>
2021-07-19 08:31:45 +00:00
Carlos Mocholí eb6d991218
Refactor plugins backward (#8328) 2021-07-08 16:02:09 +02:00
Carlos Mocholí c4353ea702
Remove `dev_debugger.call_count` (#8317) 2021-07-07 19:59:59 +02:00
Adrian Wälchli ced2c94a3e
fix missing call to untoggle_optimizer when accumulating gradients (#8284)
* add fix

* toggle test

* re-structure

* update changelog

* update comment

* remove debugging assertion
2021-07-05 11:59:04 +00:00
Carlos Mocholí 3379477242
Connect progress tracking dataclasses to loops (#8244)
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
2021-07-05 13:33:12 +02:00
Adrian Wälchli ea5cfd2005
move batch to device before sending it to hooks (#7378)
* update train step

* test

* x

* limits

* val

* typeo

* x

* x

* step

* min gpus

* run all loops

* x

* limit test

* profiler

* clean up accelerator code

* move files

* rename

* move tests

* changelog

* reorder callbacks and model hooks

* add test description

* replace unneccessary method

* fix chlog

* adjust batch_to_device for DP Plugin

* update tests for dataloader idx

* unused imports

* hook change

* switch None

* clear memory

* change to None

* None

* None

* memory savings

* remove redundant todo

* hack

* cheat

* Revert "cheat"

This reverts commit a8433bd0b4.

* Revert "hack"

This reverts commit 43a6d1edeb.

* update new epoch loop

* remove from old loop code

* update chlog

* update hook test

* changelog

* teardown

* integrate changes in new eval loop

* fix hook calls

* add prediction step

* bad merge

* Revert "bad merge"

This reverts commit 488080863c.

* fix train batch hook test

* rm -rf _notebooks

* update chlog

* release memory

* fix type

* notebooks mess

* debug

* Revert "debug"

This reverts commit eec4ee2f77.

* teardown

* fix teardown bug

* debug

* x

* debug

* Revert "debug"

This reverts commit a6e6101946.

Revert "debug"

This reverts commit 5ddeaec069.

debug


debug


Revert "debug"

This reverts commit 605be746f7daedf265b2c05a1c153ce543394435.

Revert "Revert "debug""

This reverts commit a7612d5410409ed886cfb609457349ecf44cbfa8.

debug


x


x


x


s


tol


x


tol

* Fix changelog

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
2021-07-05 09:31:39 +01:00
Carlos Mocholí 8a7f504b6f
Detach hiddens and add test (#8249) 2021-07-02 14:03:12 +02:00
Carlos Mocholí a2e41045d2
Mark some loop attributes as protected (#8250) 2021-07-02 11:51:51 +01:00
Guillaume Tauzin baa7de2d9e
Fix truncated_bptt_steps hiddens detach() and improve docs (#8145)
* Fix truncated_bptt_steps hiddens detach()
* Improve truncated_bptt_docs
* Add missing import
* Improve documentation wordings
* pep8
* detach typo
* Update test
* Implement comments
* parametrize test
* Apply suggestions from code review

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>

Signed-off-by: Guillaume Tauzin <guillaumetauzin.ut@gmail.com>

* Remove import

Signed-off-by: Guillaume Tauzin <guillaumetauzin.ut@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
2021-07-01 22:16:14 +01:00
Adrian Wälchli 55a90af7fc
`pytorch_lightning.loops` file structure: group by dataloader, epoch, and batch loop (#8077) 2021-06-24 23:40:46 +02:00