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

Enabled C++ memory-map usage in PECOS-HNSW #209

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

OctoberChang
Copy link
Contributor

@OctoberChang OctoberChang commented Feb 23, 2023

Issue #, if available:

Description of changes:

  • Enabled memory-map usage for C++ interface of PECOS-HNSW, which supports faster loading of the HNSW index.
  • Fixed potential overview issues when offsetting memory pointer of PQ codebooks in HNSW-PQ4.

An C++ example code:

// train and save into memory-mapped format
pecos::ann::HNSW<float, feat_vec_t> indexer_;
indexer_.train(X_trn, M, efC, threads);
indexer_.save(output_dir);

// load from mmap-store, with lazy_load=false
pecos::ann::HNSW<float, feat_vec_t> indexer;
bool lazy_load = false;
indexer.load(output_dir , lazy_load);

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@rofuyu rofuyu left a comment

Choose a reason for hiding this comment

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

We need to fix all "Multiplication result converted to larger type" warning properly.

@rofuyu rofuyu merged commit de4e335 into amzn:mainline Feb 24, 2023
@OctoberChang OctoberChang deleted the hnsw-mmap-cpp branch February 24, 2023 22:40
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