-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fix: handle logical CUDA device IDs for GPUStatsMonitor if CUDA_VISIBLE_DEVICES
set
#8260
Conversation
Hello @XuehaiPan! 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-07-19 11:02:22 UTC |
Codecov Report
@@ Coverage Diff @@
## master #8260 +/- ##
=======================================
- Coverage 93% 88% -5%
=======================================
Files 217 217
Lines 14227 14239 +12
=======================================
- Hits 13201 12547 -654
- Misses 1026 1692 +666 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great observation, thanks for sending the fix!
Hey @XuehaiPan, Mind removing this line there: https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pytorch_lightning/trainer/connectors/logger_connector/logger_connector.py#L230 It was filtering the available GPUS. There is an associated test with it. Best, |
…BLE_DEVICES` set [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Apply suggestions from code review [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Split functions Apply suggestions from code review [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Apply suggestions from code review Co-authored-by: Carlos Mocholí <[email protected]> [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Apply suggestions from code review fmt [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Apply suggestions from code review Co-authored-by: Jirka Borovec <[email protected]> Format code
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a commit to use list comprehensions instead which are simpler to understand
What does this PR do?
CUDA device IDs may be different from the real GPU IDs if
CUDA_VISIBLE_DEVICES
set. For example, if I setCUDA_VISIBLE_DEVICES="3,4,5,6"
, the CUDA device enumeration will be:The previous version of
GPUStatsMonitor
callback will log the wrong devices when users have set a non-trivialCUDA_VISIBLE_DEVICES
environment variable.Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃