From 40c9803afa9a8ff0fa4677d1c2ad6ccb547edcbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?FinTech=E7=A7=8B=E7=94=B0?= <8079985+FinTechCao@users.noreply.github.com> Date: Tue, 26 Mar 2024 07:39:54 +0800 Subject: [PATCH] community[patch]: Add Support for GPU Index Types in Milvus 2.4 (#19468) - **Description:** This commit introduces support for the newly available GPU index types introduced in Milvus 2.4 within the LangChain project's `milvus.py`. With the release of Milvus 2.4, a range of GPU-accelerated index types have been added, offering enhanced search capabilities and performance optimizations for vector search operations. This update ensures LangChain users can fully utilize the new performance benefits for vector search operations. - Reference: https://milvus.io/docs/gpu_index.md Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com> --- .../langchain_community/vectorstores/milvus.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libs/community/langchain_community/vectorstores/milvus.py b/libs/community/langchain_community/vectorstores/milvus.py index bcdfc06e1d7..aac0b031b5a 100644 --- a/libs/community/langchain_community/vectorstores/milvus.py +++ b/libs/community/langchain_community/vectorstores/milvus.py @@ -156,6 +156,18 @@ class Milvus(VectorStore): "ANNOY": {"metric_type": "L2", "params": {"search_k": 10}}, "SCANN": {"metric_type": "L2", "params": {"search_k": 10}}, "AUTOINDEX": {"metric_type": "L2", "params": {}}, + "GPU_CAGRA": { + "metric_type": "L2", + "params": { + "itopk_size": 128, + "search_width": 4, + "min_iterations": 0, + "max_iterations": 0, + "team_size": 0, + }, + }, + "GPU_IVF_FLAT": {"metric_type": "L2", "params": {"nprobe": 10}}, + "GPU_IVF_PQ": {"metric_type": "L2", "params": {"nprobe": 10}}, } self.embedding_func = embedding_function