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

Reduce lists::contains dispatches for scalars #13805

Merged

Conversation

divyegala
Copy link
Member

@divyegala divyegala commented Aug 2, 2023

Description

This PR is to prepare for #13672 which uses experimental comparators for both nested and non-nested types.

lists::contains currently has two APIs that support:

  1. cudf::scalar
  2. cudf::column_view

Both APIs currently need to call cudf::type_dispatcher. However, by converting cudf::scalar to a cudf::column_view by materializing all rows, we cut down the number of dispatches to half.

Compile times:
Before this PR: 12:07
After this PR: 5:46

Checklist

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

@divyegala divyegala added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Aug 2, 2023
@divyegala divyegala requested a review from bdice August 2, 2023 19:25
@divyegala divyegala requested a review from a team as a code owner August 2, 2023 19:25
@divyegala divyegala self-assigned this Aug 2, 2023
@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Aug 2, 2023
@divyegala divyegala changed the title reduce dispatches for scalars Reduce lists::contains` dispatches for scalars Aug 2, 2023
@divyegala divyegala changed the title Reduce lists::contains` dispatches for scalars Reduce lists::contains dispatches for scalars Aug 2, 2023
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

A couple suggestions for further simplification.

cpp/src/lists/contains.cu Outdated Show resolved Hide resolved
cpp/src/lists/contains.cu Outdated Show resolved Hide resolved
@divyegala divyegala requested a review from bdice August 2, 2023 20:09
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

Thanks for this refactor!

cpp/src/lists/contains.cu Outdated Show resolved Hide resolved
@divyegala
Copy link
Member Author

/merge

@rapids-bot rapids-bot bot merged commit f46cb31 into rapidsai:branch-23.10 Aug 3, 2023
54 checks passed
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 libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants