Skip to content
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

[FEA] Migrate from cuda::atomic to cuda::atomic_ref #183

Closed
sleeepyjack opened this issue Jun 30, 2022 · 3 comments
Closed

[FEA] Migrate from cuda::atomic to cuda::atomic_ref #183

sleeepyjack opened this issue Jun 30, 2022 · 3 comments
Labels
type: feature request New feature request

Comments

@sleeepyjack
Copy link
Collaborator

sleeepyjack commented Jun 30, 2022

I'm curious if there were any recent discussions on migrating the storage type from cuco::pair_type<cuda::atomic<key_type>, cuda::atomic<mapped_type>>* to coco::pair_type<key_type, mapped_type>*and then use libcu++'s new cuda::atomic_ref<T> for thread-safe table manipulation when needed. (also addressed in NVIDIA/libcudacxx#110)

Let's start this thread to collect everything related to this topic in one place.
I will update the top post regularly so people don't have to scroll through everything.


The lifetime of an object must exceed the lifetime of all atomic_refs that references the object. While any atomic_ref instances referencing an object exists, the object must be exclusively accessed through these atomic_ref instances. No subobject of an object referenced by an atomic_ref object may be concurrently referenced by any other atomic_ref object.
Atomic operations applied to an object through an atomic_ref are atomic with respect to atomic operations applied through any other atomic_ref referencing the same object.

  • We need to refactor some components, e.g., probe_sequence defines the slot type as a pair of cuda::atomics. However, it seems that it is not actually using any of the atomic operations.

As I am currently refactoring the static_reduction_map PR (#98), I would suggest using this as an opportunity to test this atomic_ref approach in our codebase and see if we run into any problems before refactoring all of the data structures.

@sleeepyjack sleeepyjack added the type: feature request New feature request label Jun 30, 2022
@PointKernel
Copy link
Member

@jrhemstad is working on a base set class and using atomic_ref is part of this exploration IIRC. By all means, NVIDIA/libcudacxx#98 is already bulky enough thus a separate PR to focus on this issue will be highly appreciated.

@sleeepyjack
Copy link
Collaborator Author

Reopening as this is part of NVIDIA/libcudacxx#110 and the associated milestone

@PointKernel
Copy link
Member

Completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request New feature request
Projects
None yet
Development

No branches or pull requests

2 participants