Skip to content

Commit

Permalink
[Milvus client] Skip compaction if use GPU indexType
Browse files Browse the repository at this point in the history
Signed-off-by: min.tian <[email protected]>
  • Loading branch information
alwayslove2013 authored and XuanYang-cn committed Jan 18, 2024
1 parent 6ee93c9 commit 34e5794
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions vectordb_bench/backend/clients/milvus/milvus.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ def _optimize(self):

def _post_insert(self):
log.info(f"{self.name} post insert before optimize")

if self.case_config.index in [IndexType.GPU_CAGRA, IndexType.GPU_IVF_FLAT, IndexType.GPU_IVF_PQ]:
log.debug("skip compaction for gpu index type.")
return

try:
self.col.flush()
# wait for index done and load refresh
Expand All @@ -121,9 +116,14 @@ def wait_index():
time.sleep(5)

wait_index()
self.col.compact()
self.col.wait_for_compaction_completed()
wait_index()

# Skip compaction if use GPU indexType
if self.case_config.index in [IndexType.GPU_CAGRA, IndexType.GPU_IVF_FLAT, IndexType.GPU_IVF_PQ]:
log.debug("skip compaction for gpu index type.")
else :
self.col.compact()
self.col.wait_for_compaction_completed()
wait_index()

except Exception as e:
log.warning(f"{self.name} optimize error: {e}")
Expand Down

0 comments on commit 34e5794

Please sign in to comment.