Skip to content

Commit c918779

Browse files
eladsegalpre-commit-ci[bot]
authored andcommitted
fix batch auto scaling when init_val causes OOM (#8954)
* fix batch auto scaling when `init_val` causes OOM * Update CHANGELOG.md Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 490e9c9 commit c918779

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
3434
- Fixed a deadlock issue with DDP and torchelastic ([#8655](https://github.com/PyTorchLightning/pytorch-lightning/pull/8655))
3535
- Fixed `accelerator=ddp` choice for CPU ([#8645](https://github.com/PyTorchLightning/pytorch-lightning/pull/8645))
3636

37+
- Fixed a bug in the binary search mode of auto batch size scaling where exception was thrown if the first trainer run resulted in OOM ([#8954](https://github.com/PyTorchLightning/pytorch-lightning/pull/8954))
38+
3739

3840
## [1.4.0] - 2021-07-27
3941

pytorch_lightning/tuner/batch_size_scaling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ def _run_binsearch_scaling(
174174
"""Batch scaling mode where the size is initially is doubled at each iteration
175175
until an OOM error is encountered. Hereafter, the batch size is further
176176
refined using a binary search"""
177+
low = 1
177178
high = None
178179
count = 0
179180
while True:

0 commit comments

Comments
 (0)