-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Bulk score hnsw neighbor array #15958
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
Open
leng25
wants to merge
9
commits into
apache:main
Choose a base branch
from
leng25:bulk-score-hnsw-neighbor-array
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+21
−21
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
72fddd8
Utilize bulk scoring interface during HNSW graph builder NeighborArra…
9b80a3c
Merge branch 'apache:main' into bulk-score-hnsw-neighbor-array
leng25 4dec1ee
Merge branch 'apache:main' into bulk-score-hnsw-neighbor-array
leng25 cc51f88
Merge branch 'main' into bulk-score-hnsw-neighbor-array
leng25 b12cce5
Merge branch 'main' into bulk-score-hnsw-neighbor-array
leng25 fc10f97
Merge branch 'main' into bulk-score-hnsw-neighbor-array
leng25 f7e3c22
Merge branch 'main' into bulk-score-hnsw-neighbor-array
leng25 0d90048
Merge branch 'main' into bulk-score-hnsw-neighbor-array
leng25 e3e5261
Refactor: populate uncheckedNodes upfront in findWorstNonDiverse
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It seems like we only want to score uncheckedIndexes right?
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.
Hi @benwtrent , thanks for the review!
Not exactly, it depends on whether the candidate itself is checked or unchecked.
Case 1 (candidate is unchecked): brand new node, never been diversity-checked against anyone, so we score against all better neighbors (0..candidateIndex-1) not just unchecked ones.
Case 2 (candidate is checked): already survived diversity checks against all checked nodes, so we only score against the newly added unchecked nodes.
This is the same logic as before my change, I only replaced the per-node scorer.score() loop with bulkScore.
That being said, looking at it again I made two small improvements: renamed bulkScoreNodes to uncheckedNodes to make it clearer what it actually contains, and moved the population of uncheckedNodes up into findWorstNonDiverse so it's built once and reused across calls to isWorstNonDiverse rather than being recreated every time.