-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[Train] Fix lightning trainer devices setting #34419
[Train] Fix lightning trainer devices setting #34419
Conversation
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
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.
BTW the functionality was actually changed in this PR: #32893
@@ -21,12 +21,21 @@ | |||
LIGHTNING_REPORT_STAGE_KEY = "_report_on" | |||
|
|||
|
|||
def _get_worker_root_device(): |
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.
nit: Does this need to be underscore prefixed?
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.
Oh I was trying to indicate that this function is used internally. But since we didn't expose it to the users, and internal functions in other similar modules don't have a leading underscore, I'm also going to remove it.
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.
Yeah I also saw this file itself has a leading underscore, so I'm assuming everything in it is supposed to be internal?
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.
Yeah I think so:) I've updated the code.
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
…ng_trainer_get_devices
…ng_trainer_get_devices
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com> Signed-off-by: elliottower <elliot@elliottower.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com> Signed-off-by: Jack He <jackhe2345@gmail.com>
Why are these changes needed?
Previously,
ray.train.torch.get_devices()
only returns one torch.device. PR [#32893] changed the logic ofget_devices()
, which returns a list of torch.device objects if there are multiple GPUs in a worker.This PR aims to adapt to this change.
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.