diff --git a/CHANGELOG.md b/CHANGELOG.md index fcd5230e02..ea46080777 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,13 +6,14 @@ Please mark all change in change log and use the issue from GitHub ## Bug - \#2487 Enlarge timeout value for creating collection -- \#2585 IVF_PQ on GPU with using metric_type IP +- \#2557 Fix random crash of INSERT_DUPLICATE_ID case - \#2578 Result count doesn't match target vectors count -- \#2557 fix random crash of INSERT_DUPLICATE_ID case -- \#2598 fix Milvus docker image report illegal instruction +- \#2585 IVF_PQ on GPU with using metric_type IP +- \#2598 Fix Milvus docker image report illegal instruction - \#2617 Fix HNSW and RNSG index files size - \#2637 Suit the range of HNSW parameters -- \#2649 search parameter of annoy has conflict with document +- \#2642 Create index failed and server crashed +- \#2649 Search parameter of annoy has conflict with document ## Feature diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.cpp index a38fba01b4..056a955abe 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.cpp @@ -112,6 +112,22 @@ BinaryIDMAP::QueryById(const DatasetPtr& dataset_ptr, const Config& config) { } #endif +int64_t +BinaryIDMAP::Count() { + if (!index_) { + KNOWHERE_THROW_MSG("index not initialize"); + } + return index_->ntotal; +} + +int64_t +BinaryIDMAP::Dim() { + if (!index_) { + KNOWHERE_THROW_MSG("index not initialize"); + } + return index_->d; +} + void BinaryIDMAP::Add(const DatasetPtr& dataset_ptr, const Config& config) { if (!index_) { diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.h b/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.h index bf3b578083..ce7da9bf04 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.h +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIDMAP.h @@ -56,14 +56,10 @@ class BinaryIDMAP : public VecIndex, public FaissBaseBinaryIndex { #endif int64_t - Count() override { - return index_->ntotal; - } + Count() override; int64_t - Dim() override { - return index_->d; - } + Dim() override; int64_t IndexSize() override { diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.cpp index 616f4c8d23..8036a42859 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.cpp @@ -129,6 +129,22 @@ BinaryIVF::QueryById(const DatasetPtr& dataset_ptr, const Config& config) { } #endif +int64_t +BinaryIVF::Count() { + if (!index_) { + KNOWHERE_THROW_MSG("index not initialize"); + } + return index_->ntotal; +} + +int64_t +BinaryIVF::Dim() { + if (!index_) { + KNOWHERE_THROW_MSG("index not initialize"); + } + return index_->d; +} + void BinaryIVF::Train(const DatasetPtr& dataset_ptr, const Config& config) { GETTENSORWITHIDS(dataset_ptr) diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.h b/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.h index e46a64e8d6..ae0991428c 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.h +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.h @@ -68,14 +68,10 @@ class BinaryIVF : public VecIndex, public FaissBaseBinaryIndex { #endif int64_t - Count() override { - return index_->ntotal; - } + Count() override; int64_t - Dim() override { - return index_->d; - } + Dim() override; #if 0 DatasetPtr diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp index 8f1babc840..612de45547 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp @@ -142,6 +142,22 @@ IDMAP::QueryById(const DatasetPtr& dataset_ptr, const Config& config) { } #endif +int64_t +IDMAP::Count() { + if (!index_) { + KNOWHERE_THROW_MSG("index not initialize"); + } + return index_->ntotal; +} + +int64_t +IDMAP::Dim() { + if (!index_) { + KNOWHERE_THROW_MSG("index not initialize"); + } + return index_->d; +} + VecIndexPtr IDMAP::CopyCpuToGpu(const int64_t device_id, const Config& config) { #ifdef MILVUS_GPU_VERSION diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.h b/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.h index f15c665d40..128d9f99b4 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.h +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.h @@ -54,14 +54,10 @@ class IDMAP : public VecIndex, public FaissBaseIndex { #endif int64_t - Count() override { - return index_->ntotal; - } + Count() override; int64_t - Dim() override { - return index_->d; - } + Dim() override; int64_t IndexSize() override { diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp index 94133acc2f..67c797740d 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp @@ -217,6 +217,22 @@ IVF::GetVectorById(const DatasetPtr& dataset_ptr, const Config& config) { } #endif +int64_t +IVF::Count() { + if (!index_) { + KNOWHERE_THROW_MSG("index not initialize"); + } + return index_->ntotal; +} + +int64_t +IVF::Dim() { + if (!index_) { + KNOWHERE_THROW_MSG("index not initialize"); + } + return index_->d; +} + void IVF::Seal() { if (!index_ || !index_->is_trained) { diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.h b/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.h index 612abc6bd1..291efe7436 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.h +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.h @@ -59,14 +59,10 @@ class IVF : public VecIndex, public FaissBaseIndex { #endif int64_t - Count() override { - return index_->ntotal; - } + Count() override; int64_t - Dim() override { - return index_->d; - } + Dim() override; #if 0 DatasetPtr diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.cpp index 301306b645..4442d056d6 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexNSG.cpp @@ -149,11 +149,17 @@ NSG::Train(const DatasetPtr& dataset_ptr, const Config& config) { int64_t NSG::Count() { + if (!index_) { + KNOWHERE_THROW_MSG("index not initialize"); + } return index_->ntotal; } int64_t NSG::Dim() { + if (!index_) { + KNOWHERE_THROW_MSG("index not initialize"); + } return index_->dimension; } diff --git a/core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.cpp b/core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.cpp index ddbc37ec80..951a5fc314 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/IndexSPTAG.cpp @@ -200,11 +200,17 @@ CPUSPTAGRNG::Query(const DatasetPtr& dataset_ptr, const Config& config) { int64_t CPUSPTAGRNG::Count() { + if (!index_ptr_) { + KNOWHERE_THROW_MSG("index not initialize"); + } return index_ptr_->GetNumSamples(); } int64_t CPUSPTAGRNG::Dim() { + if (!index_ptr_) { + KNOWHERE_THROW_MSG("index not initialize"); + } return index_ptr_->GetFeatureDim(); }