-
Notifications
You must be signed in to change notification settings - Fork 331
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
Support for highway ArgSort #2472
Comments
Hi, it is possible to get argsort reasonably efficiently using the existing VQSort calls. If you arrange the input so that 32 or 64-bit keys are in K32V32 or K64V64 structs, and place iota (0..N-1) into the value part of that struct, then the resulting values will be argsort. Does that fit your use case? |
Hi @jan-wassenberg thanks for your valuable information! I pretty new to highway source, kindly can you explain more precisely like how we can implement this probably with some example, like we can implement and call argsort function via VQSort. Thanks in advance |
@jan-wassenberg are you referring to this part of code vqsort_kv64a.cc |
Yes, that's right. A somewhat more detailed sketch:
|
@zafeerali943 wonderful! thanks for your valuable information! just one more clarification what are dtypes does this KV sort offers? |
Just now I tried compiling sample source using clang-cl: `#include "hwy/highway.h" #include "hwy/contrib/sort/vqsort-inl.h" int main(){
} Error:
|
Yes, for int32 you can use K32V32 and int64 K64V64. |
I am trying to compile using LLVM's clang-cl on windows, can you give a sample source for the above use case to compile using clang-cl, I am facing linking errors |
The above is as close to full source code as we are willing and able to provide. |
Hi @jan-wassenberg, thanks for your patience and support! I tried including all vqsort sources in cmakelist and tried compiling my sample source, but ended up with someother undefined errors. My Program:
My Cmakelist:
|
@zafeerali943 the issue can be fixed by adding abort.cc file from hwy folder |
I was able to reproduce this issue, compiling with necessary cc source file included in the project would fix the above issue |
@jan-wassenberg I just went through source code of KV sort sources, currently it supports only uint32\uint64 right? do you have any plan to support int32/int64 in future release? |
Hi @Mugundanmcw , that's right. Because we are likely anyway copying from the user's input to the KV type, it is probably best to then also apply a transformation that makes int32 sort in the desired order, when in fact the underlying sort is a u32. (Same also applies for int64 and u64.) This transformation extracts the sign bit, broadcasts it to all bits, then XORs the signed input with that. For example, |
Hi Developers!
I could see highway repository supports variety of hardware to enable optimised sort algorithms. As one of such sort algorithms ArgSort are primarily used for many scientific libraries. Is there any plan to add support for ArgSort implementation from Highway? So that it can be used for popular Scientific libraries such as NumPy which can improve performance of ArgSort on ARM devices.
Thanks!
The text was updated successfully, but these errors were encountered: