-
Notifications
You must be signed in to change notification settings - Fork 908
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
Replace Python scalar conversions with libcudf #14124
Conversation
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. |
d4821f2
to
b8f0669
Compare
b8f0669
to
0fcee57
Compare
/merge |
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
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