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

sparse vectors with large indices support #3230

Merged
merged 10 commits into from
Dec 16, 2023

Conversation

IvanPleshkov
Copy link
Contributor

@IvanPleshkov IvanPleshkov commented Dec 14, 2023

Currently, sparse vector index does not support large indices (like u32::MAX). Fixed it using indices remapping

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@IvanPleshkov IvanPleshkov marked this pull request as ready for review December 14, 2023 18:14
}
Some(vector) => {
let vector: &SparseVector = vector.as_vec_ref().try_into()?;
indices_tracker.register_indices(vector);
Copy link
Member

Choose a reason for hiding this comment

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

can we do a single pass instead? register and remap in one go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for this observation! Fixed

@agourlay
Copy link
Member

Python congruence tests are fine with this change ✔️

@IvanPleshkov IvanPleshkov merged commit 84f9011 into dev Dec 16, 2023
17 checks passed
@IvanPleshkov IvanPleshkov deleted the sparse-vector-with-large-indices-support branch December 16, 2023 00:02
generall pushed a commit that referenced this pull request Dec 19, 2023
* sparse vectors with large indices support

* fix unit tests

* add tracker file to snapshot

* fix unit tests

* are you happy clippy

* fix config loading

* test with max value

* fix python tests

* fix consensus tests

* review remarks; acc test for inverted index
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.

Sparse vector internals should not allocate memory for unused dimension
3 participants