AVX2 and AVX512 implementations for ntHash#9
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.
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.