-
Notifications
You must be signed in to change notification settings - Fork 871
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
Add nvtext hash_character_ngrams function #13654
Merged
rapids-bot
merged 9 commits into
rapidsai:branch-23.08
from
davidwendt:ngram-chars-hashed
Jul 12, 2023
Merged
Add nvtext hash_character_ngrams function #13654
rapids-bot
merged 9 commits into
rapidsai:branch-23.08
from
davidwendt:ngram-chars-hashed
Jul 12, 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
wence-
approved these changes
Jul 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python changes look good, thanks!
3 tasks
karthikeyann
approved these changes
Jul 9, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
minor suggestion on the doc.
PointKernel
approved these changes
Jul 11, 2023
/merge |
3 tasks
rapids-bot bot
pushed a commit
that referenced
this pull request
Aug 16, 2023
…er strings (#13874) Fixes performance regression when generating character ngrams. The regression was introduced as part of refactoring common code when adding the `nvtext::hash_character_ngrams` function (Reference #13654). Defactoring the code fixed the regression. Overall, these functions only share about 6 lines of code in common so the defactoring is expected to require minimal maintenance. The defactoring involves re-instating the original kernel code logic for `nvtext::generate_character_ngrams`. Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Nghia Truong (https://github.com/ttnghia) - Bradley Dice (https://github.com/bdice) URL: #13874
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
CMake
CMake build issue
improvement
Improvement / enhancement to an existing function
libcudf
Affects libcudf (C++/CUDA) code.
non-breaking
Non-breaking change
Python
Affects Python cuDF API.
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
Adds a new nvtext function to return a hash column of generated character ngrams. The result can help speed up minhash and jaccard calculations which can use the hash values as unique tokens in place of the actual character ngrams themselves. There should be very few hash collisions especially when the ngram value is small.
Also, since the character ngrams are not actually generated, the cudf column size limit becomes less of an issue since the number of hashes becomes the limit instead of the total number of generated characters. So larger batch sizes may be possible with this approach.
The code for the
ngram
function from https://github.com/rapidsai/rapids-deduplication/issues/36 can be modified as followsThe rest of the code can remain the same.
except perhaps this additional improvement
This change reduced the runtime for the reference code above from 3.9s to 2.4s on my local machine.
Checklist