-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logger state dumping and restoring #13069
base: master
Are you sure you want to change the base?
Add logger state dumping and restoring #13069
Conversation
ddf3a3c
to
8fb6e96
Compare
Currently resuming tensorboard resets the logged step number #12274 |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
e21750a
to
13258e4
Compare
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ashleve!
I can't explain why the pickling is failing.
Several existing tests pass mocks as logger instances for simplicity. Since this PR adds support for serializing their state, the logger.state_dict()
of a mock logger returns another mock wich cannot be serialized. The existing tests will need to be updated to not use mocks or you will have to do: mock_logger.state_dict.return_value = {}
Also not sure how to fix the hooks related tests from tests/models/test_hooks.py.
These tests check for the order of all hook calls, including their arguments. You probably need to update the "saved_ckpt" argument to include a logger key: https://github.com/PyTorchLightning/pytorch-lightning/blob/fbd887df9d487da4c57d884e01b3401af140b1bc/tests/models/test_hooks.py#L494-L503
I will assign Adrian as the main reviewer of the PR, but you can also ask me anything if you need support. Either here or in Slack.
Thank you for your work!
@carmocca, how is it going here? 🦦 |
@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. |
for more information, see https://pre-commit.ci
|
GitGuardian id | Secret | Commit | Filename | |
---|---|---|---|---|
- | Generic High Entropy Secret | 78fa3af | tests/tests_app/utilities/test_login.py | View secret |
- | Base64 Basic Authentication | 78fa3af | tests/tests_app/utilities/test_login.py | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- 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
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 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!
What does this PR do?
Implements state dumping and resuming mechanism for loggers.
Implements
state_dict
andload_state_dict()
for tensorboard.Related to #5342
This PR is a reimplementation of #6361
Before submitting
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:
Did you have fun?
Always 🙃