Skip to content

Conversation

@stancld
Copy link
Contributor

@stancld stancld commented Aug 5, 2021

What does this PR do?

Part of #7037. This PR disentangles large #7218. It fixes mypy typing in utilities.memory.py.

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 🙃

@codecov
Copy link

codecov bot commented Aug 5, 2021

Codecov Report

Merging #8744 (9b2e9f0) into master (8473cf4) will decrease coverage by 4%.
The diff coverage is 77%.

@@           Coverage Diff           @@
##           master   #8744    +/-   ##
=======================================
- Coverage      93%     89%    -4%     
=======================================
  Files         169     169            
  Lines       14072   14076     +4     
=======================================
- Hits        13041   12466   -575     
- Misses       1031    1610   +579     

@awaelchli
Copy link
Contributor

@stancld thanks for doing these! very appreciated <3
how much of this file is WIP?

@stancld
Copy link
Contributor Author

stancld commented Aug 5, 2021

@awaelchli No worries, it's great to learn something new :) There's one last mypy issue.

pytorch_lightning/utilities/memory.py:139: error: List item 0 has incompatible type "Optional[str]"; expected "Union[str, bytes, PathLike[str], PathLike[bytes]]"  [list-item]

Copy link
Contributor

@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.

There's one last mypy issue.

You just need to check that shutil.which does not return None

@pep8speaks
Copy link

pep8speaks commented Aug 5, 2021

Hello @stancld! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-08-06 07:27:37 UTC

@stancld stancld changed the title [WIP] Fix mypy for utilities.memory Fix mypy for utilities.memory Aug 5, 2021
@stancld stancld marked this pull request as ready for review August 5, 2021 18:57
@awaelchli awaelchli added this to the v1.5 milestone Aug 5, 2021
@mergify mergify bot added the ready PRs ready to be merged label Aug 5, 2021
@Borda Borda merged commit 0b7f6d9 into Lightning-AI:master Aug 6, 2021
four4fish pushed a commit to four4fish/pytorch-lightning that referenced this pull request Aug 16, 2021
* Fix the majority of mypy issues

* Apply @carmocca's suggestion

* Handle the exception when nvidia-smi not found

* Update get_gpu_memory_map's docstring

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready PRs ready to be merged refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants