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

Add CuPy support #63

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Add CuPy support #63

wants to merge 3 commits into from

Conversation

dcherian
Copy link
Collaborator

@dcherian dcherian commented Aug 9, 2022

This makes anything that only uses bincount work.

max., min etc are more complicated.

@@ -219,7 +219,7 @@ def _ravel_group_idx(group_idx, a, axis, size, order, method="ravel"):
size = []
for ii, s in enumerate(a.shape):
if method == "ravel":
ii_idx = group_idx_in if ii == axis else np.arange(s)
ii_idx = group_idx_in if ii == axis else np.arange(s, like=group_idx_in)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only change; but requires numpy >= 1.20.0. Shall we add that as the min version?

I could also add a version check to switch between the old and new version.

Copy link
Owner

@ml31415 ml31415 Aug 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last available numpy for py2 is 1.16.6 as far as I know. This would basically mean to completely drop the weave implementation, which so far is still the best benchmark to compete with for the numba implementation. Dropping py2 completely is probably unavoidable at some point, but if there is a way around it, remaining downwards compatible would be nice. So +1 for the switch!

@ml31415
Copy link
Owner

ml31415 commented Oct 3, 2023

@dcherian what's the status of this PR? Shall we close it, or still WIP?

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

Successfully merging this pull request may close these issues.

None yet

2 participants