File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/lightning/pytorch/tuner Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,10 @@ def _run_power_scaling(
192192 # reset after each try
193193 _reset_progress (trainer )
194194
195+ if max_val is not None and new_size >= max_val :
196+ rank_zero_info (f"Reached the maximum batch size limit of { max_val } . Stopping search." )
197+ break
198+
195199 try :
196200 _try_loop_run (trainer , params )
197201 last_successful_size = new_size # Store the current size before doubling
@@ -248,6 +252,10 @@ def _run_binsearch_scaling(
248252 # reset after each try
249253 _reset_progress (trainer )
250254
255+ if max_val is not None and new_size >= max_val :
256+ rank_zero_info (f"Reached the maximum batch size limit of { max_val } . Stopping search." )
257+ break
258+
251259 try :
252260 # run loop
253261 _try_loop_run (trainer , params )
You can’t perform that action at this time.
0 commit comments