From b12bec55658dc3bd937caa1e73b3db34f8575f6b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Oct 2025 21:03:11 +0000 Subject: [PATCH 1/2] Initial plan From 9499e9e6e26d4faef6be700fa6bafbfcbecc5de1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Oct 2025 21:11:12 +0000 Subject: [PATCH 2/2] Remove unnecessary TODO comment in fit_loop.py The TODO suggested moving max_steps check inside training loop, but this is correctly placed in fit_loop since global_step tracks steps across epochs and the fit_loop is responsible for deciding when to stop the entire fit process. Moving it would require additional flag variables, making the code more complex without any benefit. Co-authored-by: Borda <6035284+Borda@users.noreply.github.com> --- src/lightning/pytorch/loops/fit_loop.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lightning/pytorch/loops/fit_loop.py b/src/lightning/pytorch/loops/fit_loop.py index 8bb123939dc20..44b7909cb236a 100644 --- a/src/lightning/pytorch/loops/fit_loop.py +++ b/src/lightning/pytorch/loops/fit_loop.py @@ -176,7 +176,6 @@ def done(self) -> bool: rank_zero_info("`Trainer.fit` stopped: No training batches.") return True - # TODO: Move track steps inside training loop and move part of these condition inside training loop stop_steps = _is_max_limit_reached(self.epoch_loop.global_step, self.max_steps) if stop_steps: rank_zero_info(f"`Trainer.fit` stopped: `max_steps={self.max_steps!r}` reached.")