Skip to content

Conversation

@Borda
Copy link
Collaborator

@Borda Borda commented Dec 17, 2022

What does this PR do?

these defaults are already shared as the footprint of function/method so having then in docs is duplicate and also not often updated

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

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:

  • 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

Did you have fun?

Make sure you had fun coding 🙃

cc @Borda

@Borda Borda requested review from a team and ethanwharris December 17, 2022 02:21
@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label Dec 17, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 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/callbacks/model_checkpoint.py, src/pytorch_lightning/callbacks/progress/rich_progress.py, src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/mixins/hparams_mixin.py, src/pytorch_lightning/core/module.py, src/pytorch_lightning/strategies/fully_sharded.py, src/pytorch_lightning/trainer/trainer.py, src/pytorch_lightning/tuner/lr_finder.py, src/pytorch_lightning/utilities/model_summary/model_summary.py.

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

These checks are required after the changes to examples/pl_basics/autoencoder.py, src/pytorch_lightning/callbacks/model_checkpoint.py, src/pytorch_lightning/callbacks/progress/rich_progress.py, src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/mixins/hparams_mixin.py, src/pytorch_lightning/core/module.py, src/pytorch_lightning/strategies/fully_sharded.py, src/pytorch_lightning/trainer/trainer.py, src/pytorch_lightning/tuner/lr_finder.py, src/pytorch_lightning/utilities/model_summary/model_summary.py.

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

These checks are required after the changes to src/pytorch_lightning/callbacks/model_checkpoint.py, src/pytorch_lightning/callbacks/progress/rich_progress.py, src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/mixins/hparams_mixin.py, src/pytorch_lightning/core/module.py, src/pytorch_lightning/strategies/fully_sharded.py, src/pytorch_lightning/trainer/trainer.py, src/pytorch_lightning/tuner/lr_finder.py, src/pytorch_lightning/utilities/model_summary/model_summary.py.

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

These checks are required after the changes to src/pytorch_lightning/callbacks/model_checkpoint.py, src/pytorch_lightning/callbacks/progress/rich_progress.py, src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/mixins/hparams_mixin.py, src/pytorch_lightning/core/module.py, src/pytorch_lightning/strategies/fully_sharded.py, src/pytorch_lightning/trainer/trainer.py, src/pytorch_lightning/tuner/lr_finder.py, src/pytorch_lightning/utilities/model_summary/model_summary.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/callbacks/model_checkpoint.py, src/pytorch_lightning/callbacks/progress/rich_progress.py, src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/mixins/hparams_mixin.py, src/pytorch_lightning/core/module.py, src/pytorch_lightning/strategies/fully_sharded.py, src/pytorch_lightning/trainer/trainer.py, src/pytorch_lightning/tuner/lr_finder.py, src/pytorch_lightning/utilities/model_summary/model_summary.py.

🟢 mypy
Check ID Status
mypy success

These checks are required after the changes to src/pytorch_lightning/callbacks/model_checkpoint.py, src/pytorch_lightning/callbacks/progress/rich_progress.py, src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/mixins/hparams_mixin.py, src/pytorch_lightning/core/module.py, src/pytorch_lightning/strategies/fully_sharded.py, src/pytorch_lightning/trainer/trainer.py, src/pytorch_lightning/tuner/lr_finder.py, src/pytorch_lightning/utilities/model_summary/model_summary.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/callbacks/model_checkpoint.py, src/pytorch_lightning/callbacks/progress/rich_progress.py, src/pytorch_lightning/callbacks/stochastic_weight_avg.py, src/pytorch_lightning/core/mixins/hparams_mixin.py, src/pytorch_lightning/core/module.py, src/pytorch_lightning/strategies/fully_sharded.py, src/pytorch_lightning/trainer/trainer.py, src/pytorch_lightning/tuner/lr_finder.py, src/pytorch_lightning/utilities/model_summary/model_summary.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.

@Borda Borda enabled auto-merge (squash) December 17, 2022 11:48
trying to optimize initial learning for faster convergence. trainer.tune() method will
set the suggested learning rate in self.lr or self.learning_rate in the LightningModule.
To use a different key set a string instead of True with the key name.
Default: ``False``.
Copy link
Contributor

Choose a reason for hiding this comment

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

Some of these were added by contributors: #11614

As a general guideline I agree, but it also doesn't hurt having them in something like the core Trainer API (that doesn't really change their defaults that often).

I propose to keep these removals to a minimum, and to keep them in the Trainer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see, not sure why we moved some back...
In my point of view, I am very fine to keep the default when there is some additional explanation or referring to the class type or just in text after a value set that the one is default... but having pure sentence "Default: None." I think is useless...

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest keeping the "default:" message for the arguments that are Optional in the code only so that we can know whether the user manually passed an argument or not to then set the real default. All others could be removed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

arguments that are Optional in the code only so that we can know whether the user manually passed an argument

not sure if I understand what you mean here 😕

Copy link
Contributor

Choose a reason for hiding this comment

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

We often use the pattern

x: Optional[int]
if x is None:
    # the user didn't set it
    self.x = 10
else:
    self.x = x

instead of

x: int = 10
self.x = x

So for those, we want to still mention Default: 10 in the docstring because saying Default: None is not informative unless it also explains that None gets converted into 10

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes agree, but so far it was not such and we just said default None...

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm ok with adjusting the other less important files. But my opinion remains unchanged regarding trainer.py, I'd like that it stays and that we don't go back and forth #11614

Copy link
Collaborator Author

@Borda Borda Jan 12, 2023

Choose a reason for hiding this comment

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

ok 😿

Copy link
Contributor

Choose a reason for hiding this comment

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

But @Borda how about we merge the PR but remove the changes from Trainer. That's what I'm trying to say.

@awaelchli awaelchli added the docs Documentation related label Dec 17, 2022
@mergify mergify bot removed the has conflicts label Jan 7, 2023
Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

LGTM 1

@Borda Borda requested a review from awaelchli January 12, 2023 04:47
@Borda Borda closed this Jan 12, 2023
auto-merge was automatically disabled January 12, 2023 16:44

Pull request was closed

@Borda Borda deleted the docs/drop-defaults branch June 19, 2023 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation related pl Generic label for PyTorch Lightning package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants