-
Notifications
You must be signed in to change notification settings - Fork 915
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
Improve performance of slice_strings for long strings #13057
Merged
rapids-bot
merged 17 commits into
rapidsai:branch-23.06
from
davidwendt:perf-strings-slice
Apr 18, 2023
Merged
Improve performance of slice_strings for long strings #13057
rapids-bot
merged 17 commits into
rapidsai:branch-23.06
from
davidwendt:perf-strings-slice
Apr 18, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
davidwendt
added
2 - In Progress
Currently a work in progress
libcudf
Affects libcudf (C++/CUDA) code.
strings
strings issues (C++ and Python)
improvement
Improvement / enhancement to an existing function
non-breaking
Non-breaking change
labels
Apr 4, 2023
From slice benchmarks
|
davidwendt
added
3 - Ready for Review
Ready for review by team
and removed
2 - In Progress
Currently a work in progress
labels
Apr 11, 2023
ttnghia
reviewed
Apr 15, 2023
ttnghia
reviewed
Apr 15, 2023
ttnghia
reviewed
Apr 15, 2023
ttnghia
reviewed
Apr 16, 2023
ttnghia
approved these changes
Apr 16, 2023
elstehle
approved these changes
Apr 17, 2023
/merge |
shwina
pushed a commit
to shwina/cudf
that referenced
this pull request
Apr 18, 2023
Improves on performance for longer strings with `cudf::strings::slice_strings()` API. The `cudf::string_view::substr` was reworked to minimize counting characters and the gather version of `make_strings_children` is used to build the resulting strings column. This version is already optimized for small and large strings. Additionally, the code was refactored so the common case of `step==1 and start < stop` can also make use of the gather approach. Common code was also grouped closer together to help navigate the source file better. The `slice.cpp` benchmark was updated to better measure large strings with comparable slice boundaries. The benchmark showed performance improvement was up to 9x for larger strings with no significant degradation for smaller strings. Reference rapidsai#13048 and rapidsai#12445 Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Nghia Truong (https://github.com/ttnghia) - Elias Stehle (https://github.com/elstehle) URL: rapidsai#13057
This was referenced Apr 19, 2023
3 tasks
rapids-bot bot
pushed a commit
that referenced
this pull request
Apr 22, 2023
…13178) Fixes bug where `stop` value is less than `start` value in calls to `cudf::strings::slice_strings` should result in an empty string. Optimization in #13057 introduced this bug. Additional gtest was added to check for this condition. Close #13173 Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Jason Lowe (https://github.com/jlowe) - Nghia Truong (https://github.com/ttnghia) - MithunR (https://github.com/mythrocks) URL: #13178
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
strings
strings issues (C++ and Python)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Improves on performance for longer strings with
cudf::strings::slice_strings()
API. Thecudf::string_view::substr
was reworked to minimize counting characters and the gather version ofmake_strings_children
is used to build the resulting strings column. This version is already optimized for small and large strings.Additionally, the code was refactored so the common case of
step==1 and start < stop
can also make use of the gather approach. Common code was also grouped closer together to help navigate the source file better.The
slice.cpp
benchmark was updated to better measure large strings with comparable slice boundaries. The benchmark showed performance improvement was up to 9x for larger strings with no significant degradation for smaller strings.Reference #13048 and #12445
Checklist