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

Type & reduce cupy usage #16277

Merged
merged 5 commits into from
Jul 16, 2024
Merged

Type & reduce cupy usage #16277

merged 5 commits into from
Jul 16, 2024

Conversation

mroeschke
Copy link
Contributor

@mroeschke mroeschke commented Jul 13, 2024

Description

There are some cupy usages that don't seem strictly necessary (generating starting data, array type conversion) in some APIs. IMO we should prefer using CPU data/the existing data structure/Column ops over cupy when possible

closes #12133

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@mroeschke mroeschke added Python Affects Python cuDF API. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jul 13, 2024
@mroeschke mroeschke requested a review from a team as a code owner July 13, 2024 00:43
@mroeschke mroeschke requested review from Matt711 and lithomas1 July 13, 2024 00:43
@mroeschke
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 47a0a87 into rapidsai:branch-24.08 Jul 16, 2024
87 checks passed
@mroeschke mroeschke deleted the ref/cupy branch July 26, 2024 02:20
raydouglass pushed a commit that referenced this pull request Aug 1, 2024
…16436)

#16277 removed a universal cast to
a `cupy.array` in `_from_array`. Although the typing suggested this
method should only accept `np.ndarray` or `cupy.ndarray`, this method is
called on any object implementing the `__cuda_array_inferface__` or
`__array_interface__` (e.g. `numba.DeviceArray`) which caused a
performance regression in cuspatial
rapidsai/cuspatial#1413

closes #16434


```python
In [1]: import cupy, numba.cuda

In [2]: import cudf

In [3]: cupy_array = cupy.ones((10_000, 100))

In [4]: %timeit cudf.DataFrame(cupy_array)
3.88 ms ± 52 μs per loop (mean ± std. dev. of 7 runs, 100 loops each)

In [5]: %timeit cudf.DataFrame(numba.cuda.to_device(cupy_array))
3.99 ms ± 35.4 μs per loop (mean ± std. dev. of 7 runs, 100 loops each)
```

---------

Co-authored-by: Bradley Dice <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] off-by-one errors in cudf.date_range
2 participants