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

feat: make partition calculation parallel #1625

Merged
merged 1 commit into from
Nov 17, 2023
Merged

Conversation

chebbyChefNEQ
Copy link
Contributor

make IVF partition calculation parallelize

let chunks = std::cmp::min(num_cpus::get(), num_rows);

info!(
"computing parition on {} chunks, out of {} centroids, and {} vectors",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"computing parition on {} chunks, out of {} centroids, and {} vectors",
"computing partition on {} chunks, out of {} centroids, and {} vectors",

@@ -714,6 +714,8 @@ pub async fn build_ivf_pq_index(
vec![],
None,
)?;

info!("starting to compute partitions for PQ training, sample size");
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you mean to log the sample size or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yes, fixing


info!(
"computing parition on {} chunks, out of {} centroids, and {} vectors",
chunks, num_centroids, num_rows,
Copy link
Contributor

Choose a reason for hiding this comment

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

To print as integers instead of floats?

Suggested change
chunks, num_centroids, num_rows,
chunks as usize, num_centroids as usize, num_rows as usize,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added as usize to chunks. the other one are already usize and clippy complains

@chebbyChefNEQ chebbyChefNEQ force-pushed the rmeng/fix-index branch 2 times, most recently from 8505653 to e264a21 Compare November 17, 2023 21:10
@chebbyChefNEQ chebbyChefNEQ merged commit 8be61ea into main Nov 17, 2023
17 checks passed
@chebbyChefNEQ chebbyChefNEQ deleted the rmeng/fix-index branch November 17, 2023 23:28
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.

3 participants