pytorch-lightning icon indicating copy to clipboard operation
pytorch-lightning copied to clipboard

Add logger state dumping and restoring

Open ashleve opened this issue 3 years ago • 8 comments

What does this PR do?

Implements state dumping and resuming mechanism for loggers. Implements state_dict and load_state_dict() for tensorboard.

Related to #5342

This PR is a reimplementation of https://github.com/PyTorchLightning/pytorch-lightning/pull/6361

Before submitting

  • [x] Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • [x] Did you read the contributor guideline, Pull Request section?
  • [x] 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)
  • [x] Did you write any new necessary tests? (not for typos and docs)
  • [x] Did you verify new and existing tests pass locally with your changes?
  • [x] 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

Anyone in the community is welcome to review the PR. Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

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

Did you have fun?

Always 🙃

ashleve avatar May 13 '22 23:05 ashleve

Currently resuming tensorboard resets the logged step number https://github.com/PyTorchLightning/pytorch-lightning/issues/12274

ashleve avatar May 19 '22 01:05 ashleve

Could anyone help with the tests?

I can't explain why the pickling is failing.

Also not sure how to fix the hooks related tests from tests/models/test_hooks.py.

ashleve avatar May 19 '22 13:05 ashleve

@carmocca Thank you for your help! I fixed the tests accordingly

ashleve avatar Jul 15 '22 14:07 ashleve

@awaelchli @carmocca Please review the changes when you find the time

ashleve avatar Jul 15 '22 14:07 ashleve

@carmocca, how is it going here? :otter:

Borda avatar Sep 22 '22 10:09 Borda

@awaelchli It would be nice to finish it. Since you are familiar with the state key, do you want to take it? Otherwise I will. Not a high priority of course.

carmocca avatar Nov 08 '22 16:11 carmocca

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
- Generic High Entropy Secret 78fa3afdfbf964c19b4b2d36b91560698aa83178 tests/tests_app/utilities/test_login.py View secret
- Base64 Basic Authentication 78fa3afdfbf964c19b4b2d36b91560698aa83178 tests/tests_app/utilities/test_login.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

gitguardian[bot] avatar Jan 16 '24 09:01 gitguardian[bot]