Skip to content

Commit

Permalink
fix batch auto scaling when init_val causes OOM (#8954)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
eladsegal and pre-commit-ci[bot] authored Aug 18, 2021
1 parent 5329b0d commit 413f7b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

- Fixed bug where data-loading functions where not getting the correct running stage passed ([#8858](https://github.com/PyTorchLightning/pytorch-lightning/pull/8858))

- 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))


## [1.4.0] - 2021-07-27

Expand Down
1 change: 1 addition & 0 deletions pytorch_lightning/tuner/batch_size_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def _run_binsearch_scaling(
"""Batch scaling mode where the size is initially is doubled at each iteration
until an OOM error is encountered. Hereafter, the batch size is further
refined using a binary search"""
low = 1
high = None
count = 0
while True:
Expand Down

0 comments on commit 413f7b2

Please sign in to comment.