Git Product home page Git Product logo

Comments (2)

mdouze avatar mdouze commented on June 29, 2024

IndexRefCodes seems quite similar to IndexShards. Have you checked that?

from faiss.

MrFlap avatar MrFlap commented on June 29, 2024

Thanks for the response.

IndexShards would have similar functionality, but when we add vectors to IndexShards, it still calls add_with_ids (which copies the vectors for underlying Flat, HNSW, or IVF indices). This means that to make sure we don't have too many copies of vectors at once, we need to create many subindices. However, by creating many subindices, we would have to search each of the subindices when we call Index::search. It seems like this would greatly increase latency.

IndexRefCodes would also be a much nicer solution to use, since the user would not need to add vectors iteratively to avoid the memory issue. It also would have an O(1) insertion time for any batch size. It would also be easier to create using an index factory for HNSW solutions if the user could input parameter string "HNSW{m},Ref" instead of "HNSW{m},Flat".

One more bonus to IndexRefCodes is that since it is basically an IndexFlat with 2d storage, it would be easy to serialize as an IndexFlat. In fact, I have already written POC code for this functionality in my Faiss fork. It's weird to be able to save an index and load it as a different type, but I think that could be helpful for users who want to avoid the binary search ¯_(ツ)_/¯

from faiss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.