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

Replace Python scalar conversions with libcudf #14124

Merged

Conversation

vyasr
Copy link
Contributor

@vyasr vyasr commented Sep 18, 2023

Description

This PR replaces the various Cython converters for different libcudf scalar types by using the new libcudf [to|from]_arrow overloads for scalars introduced in #14121. This change dramatically simplifies the Cython code and paves the way for implementation of a pylibcudf.Scalar object.

Checklist

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

@vyasr vyasr added 3 - Ready for Review Ready for review by team Python Affects Python cuDF API. Cython 5 - DO NOT MERGE Hold off on merging; see PR for details improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Sep 18, 2023
@vyasr vyasr requested a review from a team as a code owner September 18, 2023 21:21
@vyasr vyasr self-assigned this Sep 18, 2023
@vyasr vyasr requested a review from a team as a code owner September 18, 2023 21:21
@github-actions github-actions bot added libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue labels Sep 18, 2023
@vyasr
Copy link
Contributor Author

vyasr commented Sep 18, 2023

C++ codeowners (@mythrocks and @bdice are requested), please disregard review requests on this PR. This PR depends on #14121 and should not be merged until after it. However, it can be reviewed now for Python changes. All the C++ changes will be merged as part of the other PR.

Python reviewers can go ahead and review this PR as is, just ignore all changes to the cpp/ directory. Also, I wouldn't be too concerned about the exact interface boundaries in this implementation, especially between DeviceScalar and the interop functions. Those will be changing in the follow-up PR anyway. This PR's primary focus is the removal of all the Cython code for scalar initialization since that can now be done using libcudf.

@vyasr vyasr force-pushed the feat/replace_python_scalar_conversions branch from b8f0669 to 0fcee57 Compare September 23, 2023 01:39
@github-actions github-actions bot removed libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue labels Sep 23, 2023
@vyasr vyasr removed the 5 - DO NOT MERGE Hold off on merging; see PR for details label Sep 23, 2023
@vyasr vyasr requested review from brandon-b-miller and removed request for a team, bdice and mythrocks September 23, 2023 01:39
@vyasr vyasr added 3 - Ready for Review Ready for review by team and removed 3 - Ready for Review Ready for review by team labels Sep 23, 2023
@vyasr
Copy link
Contributor Author

vyasr commented Sep 25, 2023

/merge

@rapids-bot rapids-bot bot merged commit 2e1a17d into rapidsai:branch-23.10 Sep 25, 2023
54 of 55 checks passed
@vyasr vyasr deleted the feat/replace_python_scalar_conversions branch September 25, 2023 22:54
@vyasr vyasr mentioned this pull request Oct 4, 2023
3 tasks
rapids-bot bot pushed a commit that referenced this pull request Oct 6, 2023
This PR adds a new Scalar object to pylibcudf that will function as the pylibcudf equivalent of cudf::scalar. Unlike columns, which are typically operated on in the form of views rather than owning types by libcudf, owning scalars are accepted by (const) ref by libcudf APIs and no corresponding view type exists. Therefore, pylibcudf.Scalar differs from pylibcudf.Column by actually owning an instance of the underlying libcudf type (cudf::scalar). Construction of pylibcudf Scalars is expected to be done from an Arrow scalar.

This PR relies on #14124 and should not be merged until after that one.

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Lawrence Mitchell (https://github.com/wence-)

URL: #14133
@vyasr vyasr added the pylibcudf Issues specific to the pylibcudf package label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function non-breaking Non-breaking change pylibcudf Issues specific to the pylibcudf package Python Affects Python cuDF API.
Projects
Status: Done
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants