diff --git a/CHANGELOG.md b/CHANGELOG.md index 7257d2f764f40217a8c18cd815855b8f6c66eaba..8700e91c485ff34bc10afe51cf4571f42b3bfe39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Please mark all change in change log and use the issue from GitHub - \#1240 - Update license declaration - \#1298 - Unittest failed when on CPU2GPU case - \#1359 - Negative distance value returned when searching with HNSW index type +- \#1429 - Server crashed when searching vectors using GPU ## Feature - \#216 - Add CLI to get server info diff --git a/core/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.cpp b/core/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.cpp index 73dc467f772f51597b16ae7935c8fae76f5bc0c8..80409ede0905e6e8d151737d32dda7d03101a02c 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/helpers/Cloner.cpp @@ -32,27 +32,36 @@ CopyGpuToCpu(const VectorIndexPtr& index, const Config& config) { VectorIndexPtr CopyCpuToGpu(const VectorIndexPtr& index, const int64_t& device_id, const Config& config) { + VectorIndexPtr result; + auto uids = index->GetUids(); #ifdef CUSTOMIZATION if (auto device_index = std::dynamic_pointer_cast(index)) { - return device_index->CopyCpuToGpu(device_id, config); + result = device_index->CopyCpuToGpu(device_id, config); + result->SetUids(uids); + return result; } #endif if (auto device_index = std::dynamic_pointer_cast(index)) { - return device_index->CopyGpuToGpu(device_id, config); + result = device_index->CopyGpuToGpu(device_id, config); + result->SetUids(uids); + return result; } if (auto cpu_index = std::dynamic_pointer_cast(index)) { - return cpu_index->CopyCpuToGpu(device_id, config); + result = cpu_index->CopyCpuToGpu(device_id, config); } else if (auto cpu_index = std::dynamic_pointer_cast(index)) { - return cpu_index->CopyCpuToGpu(device_id, config); + result = cpu_index->CopyCpuToGpu(device_id, config); } else if (auto cpu_index = std::dynamic_pointer_cast(index)) { - return cpu_index->CopyCpuToGpu(device_id, config); + result = cpu_index->CopyCpuToGpu(device_id, config); } else if (auto cpu_index = std::dynamic_pointer_cast(index)) { - return cpu_index->CopyCpuToGpu(device_id, config); + result = cpu_index->CopyCpuToGpu(device_id, config); } else { KNOWHERE_THROW_MSG("this index type not support tranfer to gpu"); } + + result->SetUids(uids); + return result; } } // namespace cloner