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

Building ivf for large datasets #327

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jenhsia
Copy link

@jenhsia jenhsia commented Mar 10, 2024

When using function _build_ivf(self) for a large corpus, it often gets stuck at the codes = codes.sort() step.
To avoid sorting of a massive list, we can:

  1. Create an ivf_dict which maps from partition index to the list of embedding indices that belong to that partition.
  2. Using ivf_dict, we can easily create the following without soring:
  • a sorted list of embedding indices (ivf) by just concatenating the dictionary values, and
  • a list of the number of embeddings belonging to each partition (ivf_lengths).

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.

1 participant