-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add GPU compute capability check for float16 math function test #8946
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
Conversation
| return count; | ||
| } | ||
|
|
||
| int GetCUDAComputeCapability(int 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.
Since this is the cudaDeviceProp of a GPU card, could we get this in init.cc file? Thus, we can cache this version number other than call it in every float16 method.
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.
Good point! Done.
| using namespace paddle::platform; | ||
|
|
||
| // fp16 GEMM in cublas requires GPU compute capability >= 53 | ||
| if (GetCUDAComputeCapability(0) < 53) { |
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 am not sure if this GetCUDAComputeCapability(0) < 53 code should be moved into math_function.cu?
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.
Adding processing code for compute capability < 53 case could be a future TODO item.
Before that is done, I think we need code like this to skip the fp16 test if necessary, otherwise one of the CI machine with old GPUs will fail the test.
I have also added PADDLE_ENFORCE_GE(compute_cap, 53) in math_function.cu to give a more specific error message for users.
kexinzhao
left a comment
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.
Thank you for the review!
| return count; | ||
| } | ||
|
|
||
| int GetCUDAComputeCapability(int 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.
Good point! Done.
| using namespace paddle::platform; | ||
|
|
||
| // fp16 GEMM in cublas requires GPU compute capability >= 53 | ||
| if (GetCUDAComputeCapability(0) < 53) { |
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.
Adding processing code for compute capability < 53 case could be a future TODO item.
Before that is done, I think we need code like this to skip the fp16 test if necessary, otherwise one of the CI machine with old GPUs will fail the test.
I have also added PADDLE_ENFORCE_GE(compute_cap, 53) in math_function.cu to give a more specific error message for users.
QiJune
left a comment
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!
fix #8947