Skip to content

[LuceneOnFaiss] Partial loading support (memory optimized search) for FAISS index.#2630

Merged
0ctopus13prime merged 11 commits intoopensearch-project:mainfrom
0ctopus13prime:final-lucene-on-faiss
Mar 28, 2025
Merged

[LuceneOnFaiss] Partial loading support (memory optimized search) for FAISS index.#2630
0ctopus13prime merged 11 commits intoopensearch-project:mainfrom
0ctopus13prime:final-lucene-on-faiss

Conversation

@0ctopus13prime
Copy link
Copy Markdown
Collaborator

@0ctopus13prime 0ctopus13prime commented Mar 26, 2025

Description

This will add a new index setting index.knn.memory_optimized_search to empower user to run vector search on FAISS index under memory constrained environment.

For more details, please refer to
RFC: #2401

This PR has ten sub PRs combined with integration testings.

  1. Part-1 : Added building blocks for memory optimized search.
  2. Part-2 : Added IxMp section loading logic from FAISS index
  3. Part-3 : Added FaissHNSW graph
  4. Part-4 : Added FAISS float flat index
  5. Part-5 : Added FAISS byte index deserializer - FaissIndexScalarQuantizedFlat
  6. Part-6 : Adding byte index, FP16 index decoding
  7. Part-7 : Enable memory optimized searching in VectorReader for FAISS engine
  8. Part-8 : Added index.knn.memory_optimized_search index setting
  9. Part-9 : Added CAGRA index partial loading logic
  10. Part-10 : Apply monotonic increasing integer encoding to FAISS HNSW and IdMapIndex

Related Issues

RFC: #2401

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

jmazanec15
jmazanec15 previously approved these changes Mar 27, 2025
Copy link
Copy Markdown
Member

@jmazanec15 jmazanec15 left a comment

Choose a reason for hiding this comment

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

LGTM - thanks @0ctopus13prime !

shatejas
shatejas previously approved these changes Mar 27, 2025
Comment thread src/test/java/org/opensearch/knn/memoryoptsearch/MemoryOptimizedKnnSearchIT.java Outdated
Comment thread src/test/java/org/opensearch/knn/memoryoptsearch/MemoryOptimizedKnnSearchIT.java Outdated
Comment thread src/test/java/org/opensearch/knn/memoryoptsearch/DocumentsGenerator.java Outdated
Comment thread src/test/java/org/opensearch/knn/memoryoptsearch/MemoryOptimizedKnnSearchIT.java Outdated
Comment thread src/test/java/org/opensearch/knn/memoryoptsearch/MemoryOptimizedKnnSearchIT.java Outdated
@0ctopus13prime 0ctopus13prime dismissed stale reviews from shatejas and jmazanec15 via 5293dd7 March 27, 2025 21:05
@0ctopus13prime 0ctopus13prime force-pushed the final-lucene-on-faiss branch 3 times, most recently from 5293dd7 to c2c2edd Compare March 27, 2025 21:06
0ctopus13prime and others added 7 commits March 27, 2025 14:09
…, only FAISS is supporing this. (opensearch-project#2581)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
…t#2590)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
…2594)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
…pensearch-project#2604)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
…pensearch-project#2608)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
0ctopus13prime and others added 3 commits March 27, 2025 14:09
…arch-project#2616)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
…dex. (opensearch-project#2609)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
@0ctopus13prime 0ctopus13prime force-pushed the final-lucene-on-faiss branch from c2c2edd to 8c2bd58 Compare March 27, 2025 21:09
0ctopus13prime added a commit to 0ctopus13prime/k-NN that referenced this pull request Mar 27, 2025
Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
0ctopus13prime added a commit to 0ctopus13prime/k-NN that referenced this pull request Mar 27, 2025
Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
@0ctopus13prime 0ctopus13prime force-pushed the final-lucene-on-faiss branch from 8c2bd58 to 8f8d6ee Compare March 27, 2025 22:30
Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
@0ctopus13prime 0ctopus13prime force-pushed the final-lucene-on-faiss branch from 8f8d6ee to d11a143 Compare March 27, 2025 23:42
@0ctopus13prime 0ctopus13prime merged commit e091519 into opensearch-project:main Mar 28, 2025
35 checks passed
epalaz pushed a commit to epalaz/k-NN that referenced this pull request Mar 28, 2025
… FAISS index. (opensearch-project#2630)

* Adding basic building blocks for MemoryOptimizedSearch. At the moment, only FAISS is supporing this. (opensearch-project#2581)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added IxMp section loading logic from FAISS index. (opensearch-project#2590)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added FaissHNSW and bridge to Lucene HNSW graph. (opensearch-project#2594)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added FAISS float flat index. (opensearch-project#2598)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added FAISS byte index deserializer - FaissIndexScalarQuantizedFlat (opensearch-project#2604)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Enable memory optimized searching in VectorReader for FAISS engine. (opensearch-project#2608)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added FAISS CAGRA index. (opensearch-project#2621)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added index scope setting 'index.knn.memory_optimized_search' (opensearch-project#2616)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Apply monotonic increasing integer encoding to FAISS HNSW and IdMapIndex. (opensearch-project#2609)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Adding byte index, FP16 index decoding. (opensearch-project#2618)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added integration tests for LuceneOnFaiss (opensearch-project#2630)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

---------

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
@0ctopus13prime 0ctopus13prime deleted the final-lucene-on-faiss branch April 5, 2025 00:15
luyuncheng pushed a commit to luyuncheng/k-NN-1 that referenced this pull request Jun 18, 2025
… FAISS index. (opensearch-project#2630)

* Adding basic building blocks for MemoryOptimizedSearch. At the moment, only FAISS is supporing this. (opensearch-project#2581)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added IxMp section loading logic from FAISS index. (opensearch-project#2590)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added FaissHNSW and bridge to Lucene HNSW graph. (opensearch-project#2594)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added FAISS float flat index. (opensearch-project#2598)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added FAISS byte index deserializer - FaissIndexScalarQuantizedFlat (opensearch-project#2604)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Enable memory optimized searching in VectorReader for FAISS engine. (opensearch-project#2608)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added FAISS CAGRA index. (opensearch-project#2621)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added index scope setting 'index.knn.memory_optimized_search' (opensearch-project#2616)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Apply monotonic increasing integer encoding to FAISS HNSW and IdMapIndex. (opensearch-project#2609)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Adding byte index, FP16 index decoding. (opensearch-project#2618)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added integration tests for LuceneOnFaiss (opensearch-project#2630)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

---------

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
jingqimao77-spec pushed a commit to jingqimao77-spec/k-NN that referenced this pull request Mar 15, 2026
… FAISS index. (opensearch-project#2630)

* Adding basic building blocks for MemoryOptimizedSearch. At the moment, only FAISS is supporing this. (opensearch-project#2581)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added IxMp section loading logic from FAISS index. (opensearch-project#2590)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added FaissHNSW and bridge to Lucene HNSW graph. (opensearch-project#2594)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added FAISS float flat index. (opensearch-project#2598)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added FAISS byte index deserializer - FaissIndexScalarQuantizedFlat (opensearch-project#2604)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Enable memory optimized searching in VectorReader for FAISS engine. (opensearch-project#2608)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added FAISS CAGRA index. (opensearch-project#2621)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added index scope setting 'index.knn.memory_optimized_search' (opensearch-project#2616)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Apply monotonic increasing integer encoding to FAISS HNSW and IdMapIndex. (opensearch-project#2609)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Adding byte index, FP16 index decoding. (opensearch-project#2618)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

* Added integration tests for LuceneOnFaiss (opensearch-project#2630)

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>

---------

Signed-off-by: Dooyong Kim <kdooyong@amazon.com>
Co-authored-by: Dooyong Kim <kdooyong@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants