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

[BUG] The ndarray wrapper in cudf.pandas doesn't have __array_interface__. #15926

Closed
trivialfis opened this issue Jun 5, 2024 · 0 comments · Fixed by #15936
Closed

[BUG] The ndarray wrapper in cudf.pandas doesn't have __array_interface__. #15926

trivialfis opened this issue Jun 5, 2024 · 0 comments · Fixed by #15936
Labels
bug Something isn't working cudf.pandas Issues specific to cudf.pandas

Comments

@trivialfis
Copy link
Member

trivialfis commented Jun 5, 2024

Describe the bug
The ndarray wrapper in cudf.pandas doesn't have __array_interface__, but has __cuda_array_interface__ instead. I assume this is caused by it being backed by cupy. Discovered in #15906 (comment) .

Steps/Code to reproduce bug

# file: reproduce.py
import cudf

print(cudf.__version__)         # 24.08.00a101

import pandas as pd
df = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
arr = df.values

print(arr.__cuda_array_interface__) # good
print(arr.__array_interface__)  # AttributeError

Run:

python -m cudf.pandas ./reproduce.py 

Expected behavior
I don't know what to expect in this case. This might actually help XGBoost to work with cuDF pandas wrapper since we can directly fetch the CUDA memory, albeit in a hacky way exploiting an unexpected difference between cudf.pandas and pandas. It's still a bug instead of a defined behavior. I will leave it to cuDF devs to decide what to do with it.

Environment overview (please complete the following information)

  • Environment location: Bare-meta
  • Method of cuDF install: conda

Environment details

  • cuDF: 24.08.00a101
@trivialfis trivialfis added the bug Something isn't working label Jun 5, 2024
@brandon-b-miller brandon-b-miller added the cudf.pandas Issues specific to cudf.pandas label Jun 5, 2024
rapids-bot bot pushed a commit that referenced this issue Jun 7, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cudf.pandas Issues specific to cudf.pandas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants