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

Remove invalid column_view usage in string-scalar-to-column function #16530

Merged
merged 7 commits into from
Aug 19, 2024

Conversation

davidwendt
Copy link
Contributor

@davidwendt davidwendt commented Aug 12, 2024

Description

Fixes the make_column_from_scalar function for string_scalar internal usage of a temporary column_view with non-zero size but no data or children to call cudf::strings::detail::fill. This relied too much on fragile internal logic which has cause several headaches including the recent work adding prefetch logic to libcudf.

Checklist

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

@davidwendt davidwendt added 2 - In Progress Currently a work in progress libcudf Affects libcudf (C++/CUDA) code. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Aug 12, 2024
@davidwendt davidwendt self-assigned this Aug 12, 2024
@davidwendt davidwendt added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Aug 12, 2024
@davidwendt davidwendt marked this pull request as ready for review August 13, 2024 13:12
@davidwendt davidwendt requested a review from a team as a code owner August 13, 2024 13:12
Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

Trying to understand this. Are the checks for an invalid or empty value sufficient to make calling strings::detail::fill safe, or is it still fragile even in that scenario? If it is safe, are you choosing the generate->make_strings_column approach so that you can use the same code path in all cases?

@davidwendt
Copy link
Contributor Author

davidwendt commented Aug 16, 2024

Trying to understand this. Are the checks for an invalid or empty value sufficient to make calling strings::detail::fill safe, or is it still fragile even in that scenario? If it is safe, are you choosing the generate->make_strings_column approach so that you can use the same code path in all cases?

It is not safe to call strings::detail::fill since strings::detail::fill expects a column of rows and I was using a trick where I created a strings column_view with non-zero size and a null-mask but no children (or data). This is fragile and now removed by performing the scalar-to-column logic without using strings::detail::fill. The code here is simpler (and probably faster) than the strings::detail::fill logic since every row is created with the same value.

@davidwendt davidwendt requested a review from vyasr August 16, 2024 12:43
@davidwendt
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 592342c into rapidsai:branch-24.10 Aug 19, 2024
71 checks passed
@davidwendt davidwendt deleted the fix-string-to-column branch August 19, 2024 13:28
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 libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants