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

MB-62230 - Functions to optimize pre-filtered kNN. #35

Merged
merged 10 commits into from
Sep 19, 2024

Conversation

metonymic-smokey
Copy link
Member

@metonymic-smokey metonymic-smokey commented Sep 6, 2024

Adds functions for indexes to return -

  1. the cluster assignment(centroid-cluster vector mapping) for an IVF index.
  2. the centroid IDs in an IVF index, along with their distances.
  3. Search only specified clusters, identified by their centroid IDs.

Minor naming change -
IDSelectorBatch was a misnomer for a negatory selector - renamed it to IDSelectorNot.

search_params.go Outdated Show resolved Hide resolved
@metonymic-smokey metonymic-smokey marked this pull request as ready for review September 11, 2024 13:27
index.go Outdated Show resolved Hide resolved
index.go Outdated Show resolved Hide resolved
index.go Show resolved Hide resolved
index.go Outdated Show resolved Hide resolved
index.go Outdated Show resolved Hide resolved
index.go Outdated Show resolved Hide resolved
index.go Outdated Show resolved Hide resolved
index.go Outdated Show resolved Hide resolved
index.go Outdated Show resolved Hide resolved
search_params.go Outdated Show resolved Hide resolved
return clusterVectorIDMap, nil
}

func (idx *faissIndex) ObtainClustersWithDistancesFromIVFIndex(x []float32, centroidIDs []int64) (
Copy link
Member

Choose a reason for hiding this comment

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

@metonymic-smokey I've some questions around why we're passing in an array of centroids and getting back an array of centroids again here, but we can tackle these separately.

@abhinavdangeti abhinavdangeti merged commit 05a9ee2 into master Sep 19, 2024
@abhinavdangeti abhinavdangeti deleted the pre-filter-optimize branch September 19, 2024 16:29
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.

2 participants