-
Notifications
You must be signed in to change notification settings - Fork 98
Optimize euclidean distance in host refine phase #689
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
base: branch-25.06
Are you sure you want to change the base?
Conversation
1448185
to
5026363
Compare
/ok to test |
0c5efd2
to
3c8f924
Compare
/ok to test UPD: |
/ok to test |
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.
Thanks @anstellaire for the PR! It is a clean implementation and it looks good overall.
You have changed the distance computation for the large batch size case, but did not change for the small batch case (which is handled in a separate branch here). Is this because your benchmarks have shown no improvement for the small batch case? Or is it the other way around, and we do not see improvement for small batch cases, because the new distance computation routines are not used there?
(In any case, we can limit the scope of this PR to the large batch case, but please clarify the question above.)
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.
Thank Anna for the PR. The changes look good to me! The remaining question about small batch refinement can be discussed separately.
Correct, on small batch size I saw a minor performance degradation, so I decided to apply optimization only to a large batch. |
3c8f924
to
836af24
Compare
/ok to test |
1 similar comment
/ok to test |
Issue
Original code (below) generated serial assembly and used strictly-ordered
fadda
instruction on ARM with gcc & clang. That resulted in suboptimal performance.Proposed solution
This PR provides euclidean distance optimized with partial vector sum (below), that helps vectorization but loses strcictly-ordered compliance.
In addition, it has an implementation with NEON intrinsics which provides further speedup on certain test cases (can be removed if arch-specific code is undesired).
Results