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

Use 64-bit offsets only if the current strings column output chunk size exceeds threshold #17693

Conversation

mhaseeb123
Copy link
Member

Description

This PR improves on #17207 and only uses 64-bit offsets if the current output chunk of a strings column exceeds the large-strings threshold instead of using cumulative strings column sizes per pass or row group level.

Checklist

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

Copy link

copy-pr-bot bot commented Jan 8, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Jan 8, 2025
@mhaseeb123
Copy link
Member Author

mhaseeb123 commented Jan 8, 2025

@binmahone please check if this PR resolves the NVBug you are encountering.

@mhaseeb123 mhaseeb123 added 2 - In Progress Currently a work in progress cuIO cuIO issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jan 8, 2025
@mhaseeb123 mhaseeb123 changed the title Use 64bit offsets only if the current strings column output chunk size exceeds threshold Use 64-bit offsets only if the current strings column output chunk size exceeds threshold Jan 8, 2025
@mhaseeb123 mhaseeb123 added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Jan 8, 2025
@mhaseeb123 mhaseeb123 marked this pull request as ready for review January 8, 2025 21:44
@mhaseeb123 mhaseeb123 requested a review from a team as a code owner January 8, 2025 21:44
@mhaseeb123 mhaseeb123 requested review from harrism and lamarrr January 8, 2025 21:44
if (sz <= strings::detail::get_offset64_threshold()) {
// only if it is not a large strings column
if (col_string_sizes[idx] <=
static_cast<size_t>(strings::detail::get_offset64_threshold())) {
Copy link
Member Author

Choose a reason for hiding this comment

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

strings::detail::get_offset64_threshold() is always <= std::numeric_limits<int32_t>::max()

Copy link
Contributor

Choose a reason for hiding this comment

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

That is true. The purpose is for testing (and requested by Spark) as way you could test with a lower threshold without needing to create a 2GB char array.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep,I was trying to comment on why I changed to upcasting threshold instead of downcasting col_string_sizes[idx] as col_string_sizes may be > 2B for large str cols.

Copy link
Contributor

@karthikeyann karthikeyann left a comment

Choose a reason for hiding this comment

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

cpp approval.

Copy link
Contributor

@davidwendt davidwendt left a comment

Choose a reason for hiding this comment

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

LGTM

@binmahone
Copy link

@mhaseeb123 Yesterday we verified it locally, it works! (many thanks!!!) But we need some more time to verify at customer side, as it requires some back-porting and re-packaging

@mhaseeb123
Copy link
Member Author

Thank you for update @binmahone. We will merge this PR once you confirm!

@mhaseeb123 mhaseeb123 added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels Jan 10, 2025
@binmahone
Copy link

hi @mhaseeb123 , after discussion with @GaryShen2008 , we suggest you to merge this PR before my next confirmation, as long as it meets your quality requirements. According to our latest brach model, we'll need this PR merged into 25.02-SNAPSHOT before we can do verification at customer side. We'll fire new issues in case it doesn't work out in customer env.

@mhaseeb123
Copy link
Member Author

/merge

@rapids-bot rapids-bot bot merged commit 559cda2 into rapidsai:branch-25.02 Jan 10, 2025
108 checks passed
@mhaseeb123 mhaseeb123 deleted the improve/output-large-str-cols-only-when-needed branch January 10, 2025 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge cuIO cuIO issue improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

5 participants