diff --git a/.github/workflows/probot-check-group.yml b/.github/workflows/probot-check-group.yml index 2a4fbcf0c87f7..bfc041cc97b13 100644 --- a/.github/workflows/probot-check-group.yml +++ b/.github/workflows/probot-check-group.yml @@ -12,7 +12,7 @@ jobs: required-jobs: runs-on: ubuntu-latest if: github.event.pull_request.draft == false - timeout-minutes: 61 # in case something is wrong with the internal timeout + timeout-minutes: 71 # in case something is wrong with the internal timeout steps: - uses: Lightning-AI/probot@v5.5 env: @@ -20,6 +20,6 @@ jobs: with: job: check-group interval: 180 # seconds - timeout: 60 # minutes + timeout: 70 # minutes maintainers: "Lightning-AI/lai-frameworks" owner: "carmocca" diff --git a/.lightning/workflows/fabric.yml b/.lightning/workflows/fabric.yml index 380be4bbcb195..525b184feb35f 100644 --- a/.lightning/workflows/fabric.yml +++ b/.lightning/workflows/fabric.yml @@ -4,7 +4,7 @@ trigger: pull_request: branches: ["master", "release/stable"] -timeout: "55" # minutes +timeout: "60" # minutes parametrize: matrix: {} include: diff --git a/.lightning/workflows/pytorch.yml b/.lightning/workflows/pytorch.yml index aa3b6c6020df8..18724eeb896ca 100644 --- a/.lightning/workflows/pytorch.yml +++ b/.lightning/workflows/pytorch.yml @@ -4,7 +4,7 @@ trigger: pull_request: branches: ["master", "release/stable"] -timeout: "55" # minutes +timeout: "60" # minutes parametrize: matrix: {} include: diff --git a/docs/source-pytorch/common/checkpointing_intermediate.rst b/docs/source-pytorch/common/checkpointing_intermediate.rst index 81147d11ad99c..d86b8ac05d450 100644 --- a/docs/source-pytorch/common/checkpointing_intermediate.rst +++ b/docs/source-pytorch/common/checkpointing_intermediate.rst @@ -21,7 +21,13 @@ For fine-grained control over checkpointing behavior, use the :class:`~lightning checkpoint_callback = ModelCheckpoint(dirpath="my/path/", save_top_k=2, monitor="val_loss") trainer = Trainer(callbacks=[checkpoint_callback]) trainer.fit(model) - checkpoint_callback.best_model_path + + # Access best and last model checkpoint directly from the callback + print(checkpoint_callback.best_model_path) + print(checkpoint_callback.last_model_path) + # Or via the trainer + print(trainer.checkpoint_callback.best_model_path) + print(trainer.checkpoint_callback.last_model_path) Any value that has been logged via *self.log* in the LightningModule can be monitored. diff --git a/src/lightning/pytorch/callbacks/model_checkpoint.py b/src/lightning/pytorch/callbacks/model_checkpoint.py index 415e1dcac309b..fc83c0a4513a2 100644 --- a/src/lightning/pytorch/callbacks/model_checkpoint.py +++ b/src/lightning/pytorch/callbacks/model_checkpoint.py @@ -204,11 +204,11 @@ class ModelCheckpoint(Checkpoint): ... ) # retrieve the best checkpoint after training - checkpoint_callback = ModelCheckpoint(dirpath='my/path/') - trainer = Trainer(callbacks=[checkpoint_callback]) - model = ... - trainer.fit(model) - checkpoint_callback.best_model_path + >>> checkpoint_callback = ModelCheckpoint(dirpath='my/path/') + >>> trainer = Trainer(callbacks=[checkpoint_callback]) + >>> model = ... # doctest: +SKIP + >>> trainer.fit(model) # doctest: +SKIP + >>> print(checkpoint_callback.best_model_path) # doctest: +SKIP .. tip:: Saving and restoring multiple checkpoint callbacks at the same time is supported under variation in the following arguments: