Loading cpp/src/core/knowhere/knowhere/index/vector_index/IndexIVF.cpp +12 −13 Original line number Diff line number Diff line Loading @@ -128,7 +128,6 @@ IVF::Search(const DatasetPtr& dataset, const Config& config) { // std::cout << ss_res_id.str() << std::endl; // std::cout << ss_res_dist.str() << std::endl << std::endl; auto id_buf = MakeMutableBufferSmart((uint8_t*)res_ids, sizeof(int64_t) * elems); auto dist_buf = MakeMutableBufferSmart((uint8_t*)res_dis, sizeof(float) * elems); Loading cpp/src/core/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ // under the License. #include "knowhere/index/vector_index/IndexIVFSQHybrid.h" #include <utility> #include "faiss/AutoTune.h" #include "faiss/gpu/GpuAutoTune.h" #include "faiss/gpu/GpuIndexIVF.h" Loading Loading @@ -208,7 +209,6 @@ IVFSQHybrid::LoadData(const knowhere::QuantizerPtr& q, const Config& conf) { std::pair<VectorIndexPtr, QuantizerPtr> IVFSQHybrid::CopyCpuToGpuWithQuantizer(const int64_t& device_id, const Config& config) { if (auto res = FaissGpuResourceMgr::GetInstance().GetRes(device_id)) { ResScope rs(res, device_id, false); faiss::gpu::GpuClonerOptions option; option.allInGpu = true; Loading cpp/src/core/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.h +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <faiss/index_io.h> #include <memory> #include <utility> #include "IndexGPUIVFSQ.h" #include "Quantizer.h" Loading cpp/src/db/engine/ExecutionEngine.h +2 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,8 @@ class ExecutionEngine { Merge(const std::string& location) = 0; virtual Status Search(int64_t n, const float* data, int64_t k, int64_t nprobe, float* distances, int64_t* labels, bool hybrid) const = 0; Search(int64_t n, const float* data, int64_t k, int64_t nprobe, float* distances, int64_t* labels, bool hybrid) const = 0; virtual std::shared_ptr<ExecutionEngine> BuildIndex(const std::string& location, EngineType engine_type) = 0; Loading cpp/src/db/engine/ExecutionEngineImpl.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -31,11 +31,11 @@ #include "wrapper/ConfAdapter.h" #include "wrapper/ConfAdapterMgr.h" #include <src/core/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.h> #include <src/scheduler/Utils.h> #include <stdexcept> #include <utility> #include <vector> #include <src/core/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.h> namespace milvus { namespace engine { Loading Loading @@ -414,8 +414,8 @@ ExecutionEngineImpl::BuildIndex(const std::string& location, EngineType engine_t } Status ExecutionEngineImpl::Search(int64_t n, const float* data, int64_t k, int64_t nprobe, float* distances, int64_t* labels, bool hybrid) const { ExecutionEngineImpl::Search(int64_t n, const float* data, int64_t k, int64_t nprobe, float* distances, int64_t* labels, bool hybrid) const { if (index_ == nullptr) { ENGINE_LOG_ERROR << "ExecutionEngineImpl: index is null, failed to search"; return Status(DB_ERROR, "index is null"); Loading Loading
cpp/src/core/knowhere/knowhere/index/vector_index/IndexIVF.cpp +12 −13 Original line number Diff line number Diff line Loading @@ -128,7 +128,6 @@ IVF::Search(const DatasetPtr& dataset, const Config& config) { // std::cout << ss_res_id.str() << std::endl; // std::cout << ss_res_dist.str() << std::endl << std::endl; auto id_buf = MakeMutableBufferSmart((uint8_t*)res_ids, sizeof(int64_t) * elems); auto dist_buf = MakeMutableBufferSmart((uint8_t*)res_dis, sizeof(float) * elems); Loading
cpp/src/core/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ // under the License. #include "knowhere/index/vector_index/IndexIVFSQHybrid.h" #include <utility> #include "faiss/AutoTune.h" #include "faiss/gpu/GpuAutoTune.h" #include "faiss/gpu/GpuIndexIVF.h" Loading Loading @@ -208,7 +209,6 @@ IVFSQHybrid::LoadData(const knowhere::QuantizerPtr& q, const Config& conf) { std::pair<VectorIndexPtr, QuantizerPtr> IVFSQHybrid::CopyCpuToGpuWithQuantizer(const int64_t& device_id, const Config& config) { if (auto res = FaissGpuResourceMgr::GetInstance().GetRes(device_id)) { ResScope rs(res, device_id, false); faiss::gpu::GpuClonerOptions option; option.allInGpu = true; Loading
cpp/src/core/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.h +1 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <faiss/index_io.h> #include <memory> #include <utility> #include "IndexGPUIVFSQ.h" #include "Quantizer.h" Loading
cpp/src/db/engine/ExecutionEngine.h +2 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,8 @@ class ExecutionEngine { Merge(const std::string& location) = 0; virtual Status Search(int64_t n, const float* data, int64_t k, int64_t nprobe, float* distances, int64_t* labels, bool hybrid) const = 0; Search(int64_t n, const float* data, int64_t k, int64_t nprobe, float* distances, int64_t* labels, bool hybrid) const = 0; virtual std::shared_ptr<ExecutionEngine> BuildIndex(const std::string& location, EngineType engine_type) = 0; Loading
cpp/src/db/engine/ExecutionEngineImpl.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -31,11 +31,11 @@ #include "wrapper/ConfAdapter.h" #include "wrapper/ConfAdapterMgr.h" #include <src/core/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.h> #include <src/scheduler/Utils.h> #include <stdexcept> #include <utility> #include <vector> #include <src/core/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.h> namespace milvus { namespace engine { Loading Loading @@ -414,8 +414,8 @@ ExecutionEngineImpl::BuildIndex(const std::string& location, EngineType engine_t } Status ExecutionEngineImpl::Search(int64_t n, const float* data, int64_t k, int64_t nprobe, float* distances, int64_t* labels, bool hybrid) const { ExecutionEngineImpl::Search(int64_t n, const float* data, int64_t k, int64_t nprobe, float* distances, int64_t* labels, bool hybrid) const { if (index_ == nullptr) { ENGINE_LOG_ERROR << "ExecutionEngineImpl: index is null, failed to search"; return Status(DB_ERROR, "index is null"); Loading