-
Notifications
You must be signed in to change notification settings - Fork 5.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
Add op paddle.device.cuda.get_device_name and paddle.device.cuda.get_device_capability. #35672
Conversation
Thanks for your contribution! |
… get_device_name
… get_device_name
… get_device_name
… get_device_name
… get_device_name
… get_device_name
paddle/fluid/platform/gpu_info.cc
Outdated
PADDLE_ENFORCE_GT(id, -1, platform::errors::InvalidArgument( | ||
"Device id must be greater than -1, " | ||
"but received id is: %d. ", | ||
id)); |
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.
I wonder whether hipGetDeviceProperties
and cudaGetDeviceProperties
can accept the case id = -1
. In my experience, they cannot. So I prefer GetCUDADeviceName
should not accept the case id = -1
. Users should deal with the case id = -1
outside this function.
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.
Sorry for my wrong understanding. PADDLE_ENFORCE_GT(id, -1)
is right here. But I prefer PADDLE_ENFORCE_GE(id, 0)
instead. The latter would be more clear.
… get_device_name
… get_device_name
… get_device_name
… get_device_name
… get_device_name
@@ -229,6 +231,7 @@ def get_device_properties(device=None): | |||
# required: gpu | |||
|
|||
import paddle | |||
|
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. Why change this?
… get_device_name
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.
LGTM.
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.
LGTM
PR types
Others
PR changes
OPs
Describe
Add op paddle.device.cuda.get_device_name and paddle.device.cuda.get_device_capability.