Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Briefly list any new interfaces that will be introduced as part of this proposal or any existing interfaces that will be removed or changed.

Faiss need add a new interface "add_ex()" for IDMAP and BinaryIDMAP

Code Block
languagecpp
// for IndexBinaryFlat
struct IndexBinaryFlat : IndexBinary {
    /// database vectors, size ntotal * d / 8
    std::vector<uint8_t> xb;

    /// external database vectors, size ntotal * d / 8
    uint8_t* xb_ex = nullptr;								// <==== new added
    ... ...
}

void IndexBinaryFlat::add_ex(idx_t n, const uint8_t* x) {
    xb_ex = (uint8_t*)x;
    ntotal = n;
}


struct IndexFlatCodes : Index {
    ... ...
    /// encoded dataset, size ntotal * code_size
    std::vector<uint8_t> codes;

    // external encoded dataset , size ntotal * code_size
    uint8_t* codes_ex = nullptr;							// <==== new added
    ... ...
}

void IndexFlatCodes::add_ex(idx_t n, const float* x) {
    FAISS_THROW_IF_NOT(is_trained);
    FAISS_THROW_IF_NOT(codes.empty());
    codes_ex = (uint8_t*)x;
    ntotal = n;
}


Knowhere need add a new interface `AddExWithoutIds()` for IDMAP and BinaryIDMAP

Code Block
languagecpp
    // set external data pointer instead really add data
    void
    AddExWithoutIds(const DatasetPtr&, const Config&);

For Milvus, the implementation of API "FloatSearchBruteForce()" and "BinarySearchBruteForce()" will be re-written, but the interface need not change.

Design Details(required)

Describe the new thing you want to do in appropriate detail. This may be fairly extensive and have large subsections of its own. Or it may be a few sentences. Use judgment based on the scope of the change.

...