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

del iterator on_run_end() #9915

Merged
merged 33 commits into from Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ee7ef64
del iterator on_run_end()
cowwoc Oct 13, 2021
c2b155a
del iterator on_run_end()
cowwoc Oct 13, 2021
4ac6c86
Don't bother deleting data_fetcher
cowwoc Oct 13, 2021
b587849
Updated changelog
cowwoc Oct 13, 2021
3ff2121
Fixed typo in changelog
cowwoc Oct 13, 2021
4437863
Added comment per PR review
cowwoc Oct 14, 2021
2f391a8
Added comment per PR review
cowwoc Oct 14, 2021
949092e
Add failing test
carmocca Oct 15, 2021
06e20a2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 15, 2021
183b988
resolve iterator reference
tchaton Oct 25, 2021
20e7560
resolve iterator reference
tchaton Oct 25, 2021
3234730
update
tchaton Oct 25, 2021
deb4f25
update
tchaton Oct 25, 2021
590a262
merge
tchaton Oct 25, 2021
9032c2c
Use mock in tests
carmocca Oct 25, 2021
a673c6a
Remove evaluation test that does not fail in master
carmocca Oct 25, 2021
95cfcdf
update
tchaton Oct 26, 2021
07af739
update
tchaton Oct 26, 2021
4f00eab
drop dataloader
tchaton Oct 26, 2021
0da7b70
update
tchaton Oct 26, 2021
c81c056
add extra check
tchaton Oct 26, 2021
41bc58b
update
tchaton Oct 26, 2021
15da2b1
update
tchaton Oct 26, 2021
4c55761
update
tchaton Oct 26, 2021
1afa66e
update
tchaton Oct 26, 2021
bb6ec3b
delete iterator only on end
tchaton Oct 26, 2021
fb592a4
delete iterator only on end
tchaton Oct 26, 2021
b164568
update
tchaton Oct 26, 2021
33aa531
update
tchaton Oct 26, 2021
6b2a9f6
remove dataloader delete
tchaton Oct 27, 2021
189a121
remove un-necessary
tchaton Oct 27, 2021
f11a21d
Merge branch 'master' into del-iterators
tchaton Oct 27, 2021
257eb3a
resolve on comments
tchaton Oct 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -481,7 +481,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fixed bug where the training step output needed to be `deepcopy`-ed ([#9349](https://github.com/PyTorchLightning/pytorch-lightning/pull/9349))


- Fixed freeing data iterators in loop `on_run_end` ([#9386](https://github.com/PyTorchLightning/pytorch-lightning/pull/9386))
- Fixed freeing data iterators in loop `on_run_end` ([#9386](https://github.com/PyTorchLightning/pytorch-lightning/pull/9386)) ([#9915](https://github.com/PyTorchLightning/pytorch-lightning/pull/9915))


- Fixed `BasePredictionWriter` not returning the batch_indices in a non-distributed setting ([#9432](https://github.com/PyTorchLightning/pytorch-lightning/pull/9432))
Expand Down
1 change: 1 addition & 0 deletions pytorch_lightning/loops/epoch/evaluation_epoch_loop.py
Expand Up @@ -148,6 +148,7 @@ def on_run_end(self) -> EPOCH_OUTPUT:
outputs = self.outputs
# free memory
self.outputs = []
del self._dataloader_iter
tchaton marked this conversation as resolved.
Show resolved Hide resolved
self._dataloader_iter = None
self._data_fetcher = None
return outputs
Expand Down
1 change: 1 addition & 0 deletions pytorch_lightning/loops/epoch/training_epoch_loop.py
Expand Up @@ -268,6 +268,7 @@ def on_run_end(self) -> None:
if self._num_ready_batches_reached():
self.update_lr_schedulers("epoch", update_plateau_schedulers=True)

del self._dataloader_iter
self._dataloader_iter = None

# if fault tolerant is enabled and process has been notified, exit.
Expand Down