-
Notifications
You must be signed in to change notification settings - Fork 891
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
Clean up cudf device atomic with cuda::atomic_ref
#13583
Clean up cudf device atomic with cuda::atomic_ref
#13583
Conversation
e9e11f2
to
ecdaa91
Compare
key_value_types<int8_t, int8_t>, | ||
key_value_types<int16_t, int16_t>, | ||
key_value_types<int8_t, float>, | ||
key_value_types<int16_t, double>, |
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.
Removed types not supported by atomic_ref
. Not really an issue since those data structures will be replaced by cuco ones soon.
@@ -92,7 +93,9 @@ struct minhash_fn { | |||
for (std::size_t seed_idx = 0; seed_idx < seeds.size(); ++seed_idx) { | |||
auto const hasher = cudf::detail::MurmurHash3_32<cudf::string_view>{seeds[seed_idx]}; | |||
auto const hvalue = hasher(hash_str); | |||
atomicMin(d_output + seed_idx, hvalue); | |||
cuda::atomic_ref<cudf::hash_value_type, cuda::thread_scope_block> ref{ |
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.
IIUC, this is a per warp function thus using thread_scope_block
is safe.
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.
Minor question about #include
s. I think your assessment of thread_scope_block
is correct, so I'll approve. Thanks for doing this!
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.
Are we missing #include <cuda/atomic>
in this file? Also applies to a few other files.
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.
The current join
implementations include all shared headers in join_common_utils.hpp
thus each file relies on transitive inclusions. Considering join
will be refactored with new cuco
hash maps, my plan was to refactor/cleanup this during the cuco
migration.
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.
Okay. No worries!
Is something in cpp/include/cudf/detail/utilities/device_atomics.cuh still being used? |
Yes, we cannot close the issue for now since some types are not supported by |
/merge |
Description
Contributes to #13575
Depends on #13574, #13578
This PR cleans up custom atomic implementations in libcudf by using
cuda::atomic_ref
when possible. It removes atomic bitwise operations likeand
,or
andxor
since libcudac++ already provides proper replacements.Checklist