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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add DETAIL logs for batch use cases #11008

Merged
merged 8 commits into from Jan 12, 2022

Conversation

edward-io
Copy link
Contributor

What does this PR do?

Fixes #10975

Does your PR introduce any breaking changes? If yes, please list them.

None

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 internal minor changes/refactorings)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read 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 馃檭

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.

Looks great !

pytorch_lightning/__init__.py Outdated Show resolved Hide resolved
@mergify mergify bot added the ready PRs ready to be merged label Dec 9, 2021
@ananthsub ananthsub changed the title add VERBOSE logs for production use cases add VERBOSE logs for batch use cases Dec 9, 2021
pytorch_lightning/plugins/training_type/ddp.py Outdated Show resolved Hide resolved
pytorch_lightning/plugins/training_type/ddp.py Outdated Show resolved Hide resolved
pytorch_lightning/__init__.py Outdated Show resolved Hide resolved
@Borda Borda requested a review from carmocca December 17, 2021 18:08
@mergify mergify bot removed the has conflicts label Dec 23, 2021
@edward-io edward-io changed the title add VERBOSE logs for batch use cases add DETAIL logs for batch use cases Dec 23, 2021
pytorch_lightning/trainer/trainer.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/callback_hook.py Outdated Show resolved Hide resolved
Copy link
Member

@carmocca carmocca left a comment

Choose a reason for hiding this comment

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

Requesting changes for a final review when it's all ready :)

pytorch_lightning/__init__.py Outdated Show resolved Hide resolved
@mergify mergify bot removed the ready PRs ready to be merged label Dec 31, 2021
@mergify mergify bot removed the has conflicts label Jan 6, 2022
pytorch_lightning/__init__.py Outdated Show resolved Hide resolved
pytorch_lightning/__init__.py Outdated Show resolved Hide resolved
pytorch_lightning/loops/fit_loop.py Outdated Show resolved Hide resolved
pytorch_lightning/loops/fit_loop.py Outdated Show resolved Hide resolved
pytorch_lightning/strategies/ddp.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/trainer.py Show resolved Hide resolved
pytorch_lightning/trainer/trainer.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/trainer.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/trainer.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/trainer.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/trainer.py Outdated Show resolved Hide resolved
tests/utilities/test_warnings.py Outdated Show resolved Hide resolved
@carmocca carmocca added this to the 1.6 milestone Jan 12, 2022
@mergify mergify bot added the ready PRs ready to be merged label Jan 12, 2022
@carmocca carmocca added feature Is an improvement or enhancement and removed ready PRs ready to be merged labels Jan 12, 2022
@mergify mergify bot added the ready PRs ready to be merged label Jan 12, 2022
@carmocca carmocca merged commit 6107ce8 into Lightning-AI:master Jan 12, 2022
Comment on lines +1181 to 1182
log.detail(f"{self.__class__.__name__}: restoring training state")
self.checkpoint_connector.restore_training_state()
Copy link
Member

@awaelchli awaelchli Jan 16, 2022

Choose a reason for hiding this comment

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

I disagree with most changes in this PR. Instead of moving the log calls into the actual methods, this is now littering the trainer with more code that is irrelevant to the reader. Our goal is to make the Trainer more readable and easier to trace steps for contributors and researchers who are curious. This PR is going in the wrong direction IMO.
Please reconsider this, I feel very strongly about this.

Copy link
Member

Choose a reason for hiding this comment

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

cc @PyTorchLightning/core-lightning

Copy link
Member

Choose a reason for hiding this comment

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

The choice of logging in the caller vs the callee is as old as logging has existed and it is a tradeoff between flexibility vs convenience.

I don't think these log calls make the Trainer unreadable, as they are just glorified prints. You could see their value as a replacement for comments.

Please reconsider this, I feel very strongly about this.

However, I don't feel very strongly about it, so if you do, I'm okay with changing these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve logging for batch jobs
5 participants