Skip to content

Conversation

carmocca
Copy link
Contributor

@carmocca carmocca commented Dec 23, 2022

What does this PR do?

trainer = Trainer()
trainer.ckpt_path = "my/checkpoint/file.ckpt"
trainer.fit(model)

trainer.test()  # still uses the `ckpt_path` above

# you will be in charge of resetting this
trainer.ckpt_path = None
trainer.test()  # now uses `ckpt_path="best"` as it would normally

This is a tool that NeMo can use in replacement of the resume_checkpoint_path attribute, removed in #16167: https://github.com/NVIDIA/NeMo/blob/85cc023adc530de59dd13903c4541ca008b260d3/nemo/utils/exp_manager.py#L575

cc @Borda @justusschock @awaelchli @SeanNaren @titu1994

Does your PR introduce any breaking changes? If yes, please list them.

None

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

@carmocca carmocca added feature Is an improvement or enhancement trainer labels Dec 23, 2022
@carmocca carmocca self-assigned this Dec 23, 2022
@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label Dec 23, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 23, 2022

⚡ Required checks status: All passing 🟢

Groups summary

🟢 pytorch_lightning: Tests workflow
Check ID Status
pl-cpu (macOS-11, pytorch, 3.8, 1.11) success
pl-cpu (macOS-11, pytorch, 3.9, 1.12) success
pl-cpu (macOS-11, pytorch, 3.10, 1.13) success
pl-cpu (macOS-11, pytorch, 3.8, 1.10, oldest) success
pl-cpu (ubuntu-20.04, pytorch, 3.8, 1.10) success
pl-cpu (ubuntu-20.04, pytorch, 3.9, 1.11) success
pl-cpu (ubuntu-20.04, pytorch, 3.10, 1.12) success
pl-cpu (ubuntu-20.04, pytorch, 3.10, 1.13) success
pl-cpu (ubuntu-20.04, pytorch, 3.7, 1.10, oldest) success
pl-cpu (windows-2022, pytorch, 3.9, 1.11) success
pl-cpu (windows-2022, pytorch, 3.10, 1.12) success
pl-cpu (windows-2022, pytorch, 3.10, 1.13) success
pl-cpu (windows-2022, pytorch, 3.7, 1.10, oldest) success
pl-cpu (slow, macOS-11, pytorch, 3.7, 1.11) success
pl-cpu (slow, ubuntu-20.04, pytorch, 3.7, 1.11) success
pl-cpu (slow, windows-2022, pytorch, 3.7, 1.11) success
pl-cpu (macOS-11, lightning, 3.8, 1.13) success
pl-cpu (ubuntu-20.04, lightning, 3.8, 1.13) success
pl-cpu (windows-2022, lightning, 3.8, 1.13) success

These checks are required after the changes to src/pytorch_lightning/trainer/connectors/checkpoint_connector.py, src/pytorch_lightning/trainer/trainer.py, tests/tests_pytorch/core/test_datamodules.py, tests/tests_pytorch/trainer/connectors/test_checkpoint_connector.py, tests/tests_pytorch/trainer/test_trainer.py.

🟢 pytorch_lightning: Azure GPU
Check ID Status
pytorch-lightning (GPUs) success

These checks are required after the changes to src/pytorch_lightning/trainer/connectors/checkpoint_connector.py, src/pytorch_lightning/trainer/trainer.py, tests/tests_pytorch/core/test_datamodules.py, tests/tests_pytorch/trainer/connectors/test_checkpoint_connector.py, tests/tests_pytorch/trainer/test_trainer.py.

🟢 pytorch_lightning: Azure HPU
Check ID Status
pytorch-lightning (HPUs) success

These checks are required after the changes to src/pytorch_lightning/trainer/connectors/checkpoint_connector.py, src/pytorch_lightning/trainer/trainer.py, tests/tests_pytorch/core/test_datamodules.py, tests/tests_pytorch/trainer/connectors/test_checkpoint_connector.py, tests/tests_pytorch/trainer/test_trainer.py.

🟢 pytorch_lightning: Azure IPU
Check ID Status
pytorch-lightning (IPUs) success

These checks are required after the changes to src/pytorch_lightning/trainer/connectors/checkpoint_connector.py, src/pytorch_lightning/trainer/trainer.py, tests/tests_pytorch/core/test_datamodules.py, tests/tests_pytorch/trainer/connectors/test_checkpoint_connector.py, tests/tests_pytorch/trainer/test_trainer.py.

🟢 pytorch_lightning: Docs
Check ID Status
make-doctest (pytorch) success
make-html (pytorch) success

These checks are required after the changes to src/pytorch_lightning/trainer/connectors/checkpoint_connector.py, src/pytorch_lightning/trainer/trainer.py.

🟢 mypy
Check ID Status
mypy success

These checks are required after the changes to src/pytorch_lightning/trainer/connectors/checkpoint_connector.py, src/pytorch_lightning/trainer/trainer.py.

🟢 install
Check ID Status
install-pkg (ubuntu-22.04, app, 3.7) success
install-pkg (ubuntu-22.04, app, 3.10) success
install-pkg (ubuntu-22.04, fabric, 3.7) success
install-pkg (ubuntu-22.04, fabric, 3.10) success
install-pkg (ubuntu-22.04, pytorch, 3.7) success
install-pkg (ubuntu-22.04, pytorch, 3.10) success
install-pkg (ubuntu-22.04, lightning, 3.7) success
install-pkg (ubuntu-22.04, lightning, 3.10) success
install-pkg (ubuntu-22.04, notset, 3.7) success
install-pkg (ubuntu-22.04, notset, 3.10) success
install-pkg (macOS-12, app, 3.7) success
install-pkg (macOS-12, app, 3.10) success
install-pkg (macOS-12, fabric, 3.7) success
install-pkg (macOS-12, fabric, 3.10) success
install-pkg (macOS-12, pytorch, 3.7) success
install-pkg (macOS-12, pytorch, 3.10) success
install-pkg (macOS-12, lightning, 3.7) success
install-pkg (macOS-12, lightning, 3.10) success
install-pkg (macOS-12, notset, 3.7) success
install-pkg (macOS-12, notset, 3.10) success
install-pkg (windows-2022, app, 3.7) success
install-pkg (windows-2022, app, 3.10) success
install-pkg (windows-2022, fabric, 3.7) success
install-pkg (windows-2022, fabric, 3.10) success
install-pkg (windows-2022, pytorch, 3.7) success
install-pkg (windows-2022, pytorch, 3.10) success
install-pkg (windows-2022, lightning, 3.7) success
install-pkg (windows-2022, lightning, 3.10) success
install-pkg (windows-2022, notset, 3.7) success
install-pkg (windows-2022, notset, 3.10) success

These checks are required after the changes to src/pytorch_lightning/trainer/connectors/checkpoint_connector.py, src/pytorch_lightning/trainer/trainer.py.


Thank you for your contribution! 💜

Note
This comment is automatically generated and updates for 60 minutes every 180 seconds. If you have any other questions, contact carmocca for help.

@mergify mergify bot removed the has conflicts label Dec 24, 2022
@mergify mergify bot added the has conflicts label Jan 4, 2023
@lantiga lantiga deleted the branch lite/debug January 5, 2023 07:07
@lantiga lantiga closed this Jan 5, 2023
@carmocca carmocca reopened this Jan 5, 2023
@carmocca carmocca force-pushed the feat/tainer-ckpt-path-setter branch from ff9708d to a67b699 Compare January 5, 2023 10:51
@mergify mergify bot removed the has conflicts label Jan 5, 2023
@carmocca carmocca force-pushed the feat/tainer-ckpt-path-setter branch from a67b699 to b220ba8 Compare January 5, 2023 13:33
@carmocca carmocca requested a review from awaelchli January 5, 2023 13:33
Copy link
Contributor

@awaelchli awaelchli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand these changes. We were supposed to make things simpler, not more complicated.

@mergify mergify bot added the ready PRs ready to be merged label Jan 5, 2023
@carmocca carmocca merged commit 6715023 into lite/debug Jan 9, 2023
@carmocca carmocca deleted the feat/tainer-ckpt-path-setter branch January 9, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement pl Generic label for PyTorch Lightning package ready PRs ready to be merged trainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants