From 1ad702cc40bc4da8b8ef835660f161bdcbc38155 Mon Sep 17 00:00:00 2001 From: xige-16 Date: Mon, 21 Nov 2022 19:35:11 +0800 Subject: [PATCH] Reduce the memory used by load disk index (#20475) Signed-off-by: xige-16 Signed-off-by: xige-16 --- configs/milvus.yaml | 2 +- internal/util/autoindex/bigdata_index.go | 2 +- internal/util/autoindex/bigdata_index_test.go | 8 ++++---- internal/util/indexparams/disk_index_params_test.go | 2 +- internal/util/paramtable/component_param.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/configs/milvus.yaml b/configs/milvus.yaml index 2a251d68f4..e2a95ad6de 100644 --- a/configs/milvus.yaml +++ b/configs/milvus.yaml @@ -373,7 +373,7 @@ common: SearchListSize: 100 PQCodeBudgetGBRatio: 0.125 BuildNumThreadsRatio: 1.0 - SearchCacheBudgetGBRatio: 0.125 + SearchCacheBudgetGBRatio: 0.10 LoadNumThreadRatio: 8.0 BeamWidthRatio: 4.0 # This parameter specify how many times the number of threads is the number of cores diff --git a/internal/util/autoindex/bigdata_index.go b/internal/util/autoindex/bigdata_index.go index d27645bf02..439d2cac8a 100644 --- a/internal/util/autoindex/bigdata_index.go +++ b/internal/util/autoindex/bigdata_index.go @@ -35,7 +35,7 @@ const ( BeamWidthRatioKey = "beamwidth_ratio" DefaultPQCodeBudgetGBRatio = 0.125 DefaultBuildNumThreadsRatio = 1.0 - DefaultSearchCacheBudgetGBRatio = 0.125 + DefaultSearchCacheBudgetGBRatio = 0.10 DefaultLoadNumThreadRatio = 8.0 DefaultBeamWidthRatio = 4.0 ) diff --git a/internal/util/autoindex/bigdata_index_test.go b/internal/util/autoindex/bigdata_index_test.go index 6fe3b84fa3..ae81759c96 100644 --- a/internal/util/autoindex/bigdata_index_test.go +++ b/internal/util/autoindex/bigdata_index_test.go @@ -53,7 +53,7 @@ func TestBigDataIndex_parse(t *testing.T) { assert.Equal(t, 1.0, extraParams.BuildNumThreadsRatio) assert.Equal(t, 8.0, extraParams.LoadNumThreadRatio) assert.Equal(t, 0.125, extraParams.PQCodeBudgetGBRatio) - assert.Equal(t, 0.125, extraParams.SearchCacheBudgetGBRatio) + assert.Equal(t, 0.10, extraParams.SearchCacheBudgetGBRatio) }) t.Run("parse with nil", func(t *testing.T) { @@ -62,7 +62,7 @@ func TestBigDataIndex_parse(t *testing.T) { assert.Equal(t, 1.0, extraParams.BuildNumThreadsRatio) assert.Equal(t, 8.0, extraParams.LoadNumThreadRatio) assert.Equal(t, 0.125, extraParams.PQCodeBudgetGBRatio) - assert.Equal(t, 0.125, extraParams.SearchCacheBudgetGBRatio) + assert.Equal(t, 0.10, extraParams.SearchCacheBudgetGBRatio) }) t.Run("new from json normal", func(t *testing.T) { @@ -93,7 +93,7 @@ func TestBigDataIndex_parse(t *testing.T) { assert.Equal(t, 1.0, extraParams.BuildNumThreadsRatio) assert.Equal(t, 8.0, extraParams.LoadNumThreadRatio) assert.Equal(t, 0.125, extraParams.PQCodeBudgetGBRatio) - assert.Equal(t, 0.125, extraParams.SearchCacheBudgetGBRatio) + assert.Equal(t, 0.10, extraParams.SearchCacheBudgetGBRatio) assert.Equal(t, 4.0, extraParams.BeamWidthRatio) }) @@ -107,7 +107,7 @@ func TestBigDataIndex_parse(t *testing.T) { assert.Equal(t, 1.0, extraParams.BuildNumThreadsRatio) assert.Equal(t, 8.0, extraParams.LoadNumThreadRatio) assert.Equal(t, 0.125, extraParams.PQCodeBudgetGBRatio) - assert.Equal(t, 0.125, extraParams.SearchCacheBudgetGBRatio) + assert.Equal(t, 0.10, extraParams.SearchCacheBudgetGBRatio) assert.Equal(t, 4.0, extraParams.BeamWidthRatio) }) diff --git a/internal/util/indexparams/disk_index_params_test.go b/internal/util/indexparams/disk_index_params_test.go index a57e79709e..728ad6d93d 100644 --- a/internal/util/indexparams/disk_index_params_test.go +++ b/internal/util/indexparams/disk_index_params_test.go @@ -45,7 +45,7 @@ func TestDiskIndexParams(t *testing.T) { searchCacheBudgetGBRatio, err := strconv.ParseFloat(indexParams[SearchCacheBudgetRatioKey], 64) assert.NoError(t, err) - assert.Equal(t, 0.125, searchCacheBudgetGBRatio) + assert.Equal(t, 0.10, searchCacheBudgetGBRatio) loadNumThreadRatio, err := strconv.ParseFloat(indexParams[NumLoadThreadRatioKey], 64) assert.NoError(t, err) diff --git a/internal/util/paramtable/component_param.go b/internal/util/paramtable/component_param.go index 8cfbbdf010..47b4b6bfc8 100644 --- a/internal/util/paramtable/component_param.go +++ b/internal/util/paramtable/component_param.go @@ -43,7 +43,7 @@ const ( DefaultSearchListSize = 100 DefaultPQCodeBudgetGBRatio = 0.125 DefaultBuildNumThreadsRatio = 1.0 - DefaultSearchCacheBudgetGBRatio = 0.125 + DefaultSearchCacheBudgetGBRatio = 0.10 DefaultLoadNumThreadRatio = 8.0 DefaultBeamWidthRatio = 4.0 )