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

perf: fully building HNSW partitions in parallel #2117

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

BubbleCal
Copy link
Contributor

@BubbleCal BubbleCal commented Mar 27, 2024

improves 25% on 8.5M rows dataset (19 minutes)

before this, the previous partition building blocks the following ones if it hasn't been consumed from the stream

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Signed-off-by: BubbleCal <bubble-cal@outlook.com>
@@ -293,6 +294,7 @@ pub(super) async fn write_hnsw_index_partitions(
let mut aux_part_files = Vec::with_capacity(ivf.num_partitions());
let tmp_part_dir = Path::from_filesystem_path(TempDir::new()?)?;
let mut tasks = Vec::with_capacity(ivf.num_partitions());
let sem = Arc::new(Semaphore::new(HNSW_PARTITIONS_BUILD_PARRALLEL));
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe pass this as HnswBuildParameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's an idea! this actually depends on how large the dataset is

@BubbleCal BubbleCal merged commit a34d19c into lancedb:main Mar 28, 2024
18 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.

2 participants