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] Refactor device_scalar in terms of device_uvector and fix asynchrony #570

Closed
jrhemstad opened this issue Sep 21, 2020 · 3 comments · Fixed by #789
Closed

[FEA] Refactor device_scalar in terms of device_uvector and fix asynchrony #570

jrhemstad opened this issue Sep 21, 2020 · 3 comments · Fixed by #789

Comments

@jrhemstad
Copy link
Contributor

Is your feature request related to a problem? Please describe.

device_scalar is a convenience type to represent a single value in device memory. Anywhere a device_scalar is used, a single element device_uvector could be used.

device_scalar was implemented before device_uvector existed, and therefore there is a lot of redundancy between the two.

Furthermore, the asynchrony of device_scalar is incongrous with device_uvector. The device_scalar::set_value is asynchronous, but it's name does not tell you that.

We've iterated on this quite a bit, and I feel device_uvector demonstrates the ideal design. If a function is asynchronous (doesn't synchronize the stream) it should be suffixed with _async. Otherwise it is synchronous and syncs the stream.

Describe the solution you'd like

Refactor device_scalars implementation to be implemented in terms of a single element device_uvector. Furthermore, reimplement functions like set_value in terms of device_uvector::set_element.

Likewise, device_scalar::set_value should be made synchronous and device_scalar::set_value_async should be added as an asynchronous variant.

@JustPlay
Copy link

#557

@github-actions
Copy link

This issue has been marked rotten due to no recent activity in the past 90d. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

@github-actions
Copy link

This issue has been marked stale due to no recent activity in the past 30d. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be marked rotten if there is no activity in the next 60d.

@rapids-bot rapids-bot bot closed this as completed in #789 Jun 8, 2021
rapids-bot bot pushed a commit that referenced this issue Jun 8, 2021
This PR refactors `device_scalar` to use a  single-element `device_uvector` for its storage. This simplifies the implementation of device_scalar. Also changes the API of `device_scalar` so that its asynchronous / stream-ordered methods use the same API style (with explicit stream parameter) as `device_uvector` and `device_buffer`.

Closes #570

This is a breaking change. When it is merged, PRs are likely to need to be merged immediately in other libraries to account for the API changes. 

 - [x] cuDF: rapidsai/cudf#8411
 - [x] cuGraph: rapidsai/cugraph#1637
 - [x] RAFT: rapidsai/raft#259  
 - [x] ~cuML~ (unused)
 - [x] ~cuSpatial~ (unused)

Authors:
  - Mark Harris (https://github.com/harrism)

Approvers:
  - Rong Ou (https://github.com/rongou)
  - Jake Hemstad (https://github.com/jrhemstad)

URL: #789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants