Skip to content
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

Update Checkpointing Docs to include details on initializing model with other hyperparameters #17767

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shubhamkulkarni01
Copy link

What does this PR do?

Currently, docs do not include information that positional arguments will not be forwarded to the model. All examples include only keyword arguments. This bug causes many wasted hours of debugging every time.

Before submitting
  • Was this discussed/agreed 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)
  • Did you write any new necessary tests? (not for typos and docs)
  • [ N/A docs update only ] 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

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
  • 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

…el with other hyperparameters

Currently, docs do not include information that positional arguments will not be forwarded to the model. All examples include only keyword arguments. This bug causes many wasted hours of debugging every time.
@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label Jun 7, 2023
@shubhamkulkarni01 shubhamkulkarni01 changed the title Update checkpointing_basic.rst to include details on initializing model with other hyperparameters Update Checkpointing Docs to include details on initializing model with other hyperparameters Jun 7, 2023
@@ -108,7 +108,7 @@ The LightningModule also has access to the Hyperparameters

Initialize with other parameters
================================
If you used the *self.save_hyperparameters()* method in the init of the LightningModule, you can initialize the model with different hyperparameters.
If you used the *self.save_hyperparameters()* method in the init of the LightningModule, you can initialize the model with different hyperparameters. Named arguments passed to ``load_from_checkpoint`` will be forwarded to the model's ``__init__`` function, with the exception of arguments named ``strict``, ``map_location``, and ``hparams_file``, which are consumed by ``load_from_checkpoint``. Positional arguments will **not** be forwarded to the model.
Copy link
Member

@awaelchli awaelchli Jun 8, 2023

Choose a reason for hiding this comment

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

Overall looks like a good addition, thanks!. Two minor comments:

  • The last sentence sounds a bit misleading. "will not be forwarded" sounds like we are silently not doing anything with them, but in fact it is just not supported and will raise an error. Forcing this best practice is to avoid collision and user-error.
  • Maybe the comment could be added at the bottom of the section, since it is better to introduce the user with the concept and the code examples first before pointing out additional details of optional usage patterns.

What do you think?

@awaelchli awaelchli added docs Documentation related checkpointing Related to checkpointing community This PR is from the community labels Jun 8, 2023
@stale stale bot added the won't fix This will not be worked on label Aug 12, 2023
@Lightning-AI Lightning-AI deleted a comment from stale bot Aug 12, 2023
@stale stale bot removed the won't fix This will not be worked on label Aug 12, 2023
@stale
Copy link

stale bot commented Sep 17, 2023

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you need further help see our docs: https://lightning.ai/docs/pytorch/latest/generated/CONTRIBUTING.html#pull-request or ask the assistance of a core contributor here or on Discord. Thank you for your contributions.

@stale stale bot added the won't fix This will not be worked on label Sep 17, 2023
@Borda
Copy link
Member

Borda commented Oct 25, 2023

@shubhamkulkarni01 mind pls check the merge conflicts?

Copy link

gitguardian bot commented Jan 16, 2024

⚠️ 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 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
  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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checkpointing Related to checkpointing community This PR is from the community docs Documentation related has conflicts pl Generic label for PyTorch Lightning package won't fix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants