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

[2/4] Add DeviceStatsMonitor callback #9712

Merged
merged 71 commits into from
Oct 13, 2021

Conversation

daniellepintz
Copy link
Contributor

@daniellepintz daniellepintz commented Sep 27, 2021

What does this PR do?

Adds DeviceStatsMonitor callback which calls the get_device_stats function in Accelerator interface. DeviceStatsMonitor will replace GPUStatsMonitor and XLAStatsMonitor

Part of #9032

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

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 🙃

daniellepintz and others added 23 commits September 17, 2021 22:15
@daniellepintz
Copy link
Contributor Author

thanks so much @kaushikb11 for fixing the tpu test failure!!!

@daniellepintz
Copy link
Contributor Author

daniellepintz commented Oct 12, 2021

[RESOLVED] Does anyone have any suggestions to solve the mypy error in a clean way? https://github.com/PyTorchLightning/pytorch-lightning/pull/9712/checks?check_run_id=3875669398

@daniellepintz
Copy link
Contributor Author

daniellepintz commented Oct 12, 2021

[RESOLVED - we decided pl_module.device makes more sense since we might want stats for non-root device] Also, what do people think about using root_device vs pl_module.device?

@daniellepintz
Copy link
Contributor Author

daniellepintz commented Oct 12, 2021

Also is there anything I can do about the "Abstract method not overridden" Python errors? https://deepsource.io/gh/PyTorchLightning/pytorch-lightning/run/36c8f43c-2cab-40b2-b81f-6edd6c439a43/python/PYL-W0223

Do we definitely want LightningLoggerBase to be an ABC? cc @carmocca

@carmocca
Copy link
Contributor

Do we definitely want LightningLoggerBase to be an ABC? cc @carmocca

It might be okay to remove - it was added without a strong argument for it: #605

perhaps @justusschock or @awaelchli have a preference?

@daniellepintz daniellepintz deleted the dstats_callback branch October 14, 2021 17:15
rohitgr7 pushed a commit to Tshimanga/pytorch-lightning that referenced this pull request Oct 18, 2021
Co-authored-by: ananthsub <ananth.subramaniam@gmail.com>
Co-authored-by: thomas chaton <thomas@grid.ai>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Kaushik B <kaushikbokka@gmail.com>
Co-authored-by: Kaushik B <45285388+kaushikb11@users.noreply.github.com>
@awaelchli
Copy link
Contributor

I think we don't want the LoggerBase to be a logger that people can instantiate and use. That would be silly:

trainer = Trainer(logger=LightningLoggerBase())

or what would be the benefit?

@daniellepintz
Copy link
Contributor Author

Nevermind, I agree that doesn't make sense. The initial motivation was to fix a DeepSource error from a test class, but we can consider this resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
callback 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.

8 participants