-
Notifications
You must be signed in to change notification settings - Fork 197
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 support to __half and nv_bfloat16 to most math functions #1554
Add support to __half and nv_bfloat16 to most math functions #1554
Conversation
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.
Thanks for the PR. A few nitpicks
cpp/include/raft/core/math.hpp
Outdated
#if (__CUDA_ARCH__ >= 530) | ||
return ::hcos(x); | ||
#else | ||
// static_assert(false) would be evaluated during host compilation stage while __CUDA_ARCH__ is at | ||
// device compilation stage Using this sizeof(T) != sizeof(T) makes it work as it's only triggered | ||
// during template instantiation and thus at device compilation stage | ||
static_assert(sizeof(T) != sizeof(T), "__half is only supported on __CUDA_ARCH__ >= 530"); | ||
return T{}; | ||
#endif |
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.
Question for @cjnolet : iirc RAPIDS is Pascal+, shall we have a centralized check of the minimum arch somewhere and remove these checks here, or would this have too many consequences on repos using raft?
…NDITION_ELSE_TRUE
Note: this PR solves #1542 |
This PR fixes some outdated pinnings in `branch-23.08` and applies some fixes to `update-version.sh`. See also: rapidsai/cuml#5440 #1554 (comment) Authors: - Bradley Dice (https://github.com/bdice) - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Ray Douglass (https://github.com/raydouglass) - Divye Gala (https://github.com/divyegala) - AJ Schmidt (https://github.com/ajschmidt8) URL: #1556
…o add_half_bfloat_support
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. Thanks for the PR!
/merge |
This PR adds support to __half and nb_bfloat16 to most math functions: