Skip to content
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

Dot-product implementation and distance template #237

Merged
merged 14 commits into from
Jan 3, 2025

Conversation

thinh2
Copy link
Collaborator

@thinh2 thinh2 commented Dec 29, 2024

In the future, all the index related code needs to add distance template parameter (SPANN, Segment). It will increase the complexity of codebase as we may need to maintain multiple distance template params (e.g SPANN index is composed of hnsw and ivf).

Another method to support multiple distance is enum dispatch. It is easier to implement and integrate. However, the performance may degrade as we will use match arm in distance calculation. Should we compare the performance of both implementation on KMeans/IVF before deciding to continue with the template solution?

@thinh2 thinh2 requested review from hicder and tyb0807 December 29, 2024 10:25
use utils::mem::transmute_slice_to_u8;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: remove extra spaces

rs/utils/src/distance/l2.rs Outdated Show resolved Hide resolved
rs/index/src/ivf/writer.rs Outdated Show resolved Hide resolved
@thinh2 thinh2 merged commit 0c096c2 into master Jan 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants