-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fix: automatically upload config file when using WandbLogger with PTL CLI #19268
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #19268 +/- ##
==========================================
- Coverage 83% 49% -34%
==========================================
Files 445 437 -8
Lines 37289 37146 -143
==========================================
- Hits 31119 18241 -12878
- Misses 6170 18905 +12735 |
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
- | Generic High Entropy Secret | 68d1169 | tests/tests_data/streaming/test_resolver.py | View secret | |
- | Generic High Entropy Secret | 68d1169 | tests/tests_data/streaming/test_resolver.py | View secret | |
- | Generic High Entropy Secret | 68d1169 | tests/tests_data/streaming/test_resolver.py | View secret | |
- | Generic High Entropy Secret | 68d1169 | tests/tests_data/streaming/test_resolver.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!
@aniketmaurya who would be the right person to review this PR. :) |
Hey @awaelchli, was curious if you can take a look at this PR. Thanks 🌮 |
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.
Hey @ayulockin
Sorry for the very late review, it's very busy atm.
I think it's a good idea, and this will also be useful for the other loggers. Let's do it.
I left a design suggestion below.
@@ -293,6 +296,23 @@ def save_config(self, trainer, pl_module, stage): | |||
instead. | |||
|
|||
""" | |||
if isinstance(trainer.logger, WandbLogger): |
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.
The code below looks good in general.
However, this save_config
hook is meant to be overridden by users who want to add their own saving logic. We should not implement it here. I propose to simply create a new callback:
class LoggerSaveConfigCallback(SaveConfigCallback)
def save_config(...):
# your logic here
and then we register that one by default if the CLI is used.
What do you think?
What does this PR do?
While using the CLI, the config file is logged to W&B partially (run page). Ideally, it should log the entirety of the config for better reproducibility and comparison of experiments. This PR fixes this issue by modifying the
SaveConfigCallback
to execute some logic only whenWandbLogger
is used (run page).To further support user convenience, the change saves the config passed to the CLI to the correct
wandb/exp_name
dir.Fixes #<issue_number>
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:
Reviewer checklist
📚 Documentation preview 📚: https://pytorch-lightning--19268.org.readthedocs.build/en/19268/