-
Notifications
You must be signed in to change notification settings - Fork 13
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
AVX2 and AVX512 implementations for ntHash #9
base: master
Are you sure you want to change the base?
Conversation
Hi, @mirounga. Cool! Does this code implement ntHash v1 or ntHash v2? |
The code implements the current version of ntHash. |
Great. Thanks for confirming, @mirounga. |
Hi @mirounga I'm getting the following runtime performance results:
The proper AVX512 and AVX512x32 implementations are not included in
|
Hi @mohamadi , |
Closing due to being related to ntHash's old codebase. New ports are welcome! |
|
||
kmerSeq += 3; | ||
|
||
size_t sentinel = seq.length() - opt::kmerLen; |
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.
Expression should read seq.length() - opt::kmerLen + 1
otherwise last character isn't hashed and final hash doesn't match the scalar version. When this patch it applied, it does!
Nice work there! I've expanded this unmerged PR into its own repository, in order to better assess the correctness of results, (keeping the same codebase): https://github.com/rchikhi/ntHash-AVX512 |
@parham-k can you take a look at it and merge if compatible with the new release? |
Sure! Thank you @rchikhi. |
Since the recurrent version of ntHash is a prefix sum with an associative operator, it is possible to compute the hashes in parallel using the prefix scan algorithm.
For 64-bit hash the theoretical speedup in 2x for AVX2 and 3x for AVX512.
Versions for 32-bit hashes are also included featuring even greater speedup.