-
Notifications
You must be signed in to change notification settings - Fork 91
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 the wrong type and pass real-number value with device_type to devices #1253
Conversation
rebase! |
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!
I would like to see a PR description change to detail why you now need to change the type between devices for remove_complex<T>
floating point types.
old_row_ptrs, as_cuda_type(old_vals), num_rows, threshold, | ||
new_row_ptrs, lower); | ||
old_row_ptrs, as_cuda_type(old_vals), num_rows, | ||
as_cuda_type(threshold), new_row_ptrs, lower); |
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.
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.
Yes, I will use __half
on the GPU but gko::half on CPU.
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.
There are a few extraneous as_device_type
in the following kernels:
- csr_kernels.cu: 302, 304, 315, 317 and maybe a few other places in this file
- cb_gmres_kernels.cu: 351, 414
Probably the same in the hip kernels as well.
I think these places below are also missing a as_device_type
?:
- idr_kernels.cu: 102
Does cublas, curand and cusparse have half precision support ? We dont seem to currently use as_device_type
while passing the pointers to those wrappers.
Otherwise LGTM!
curandGenerateNormal from cuda does not support half. |
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!
@pratikvn for idr curand, I do not convert it to device now because we only use the float double and generate 2x for complex (currently based on std::complex) |
Co-authored-by: Pratik Nayak <[email protected]>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
I face some type issue when I develop the half precision computation in ginkgo. I extract some fix here because the current way I tried in half precision computation may not be workable in the end.
There are two main fix in this PR:
remove_complex<ValueType>
withas_device_type
because we will use __half from vendor library not gko::half