From 83bf9c5efb942b4a90dc57d6ca57188d23260c47 Mon Sep 17 00:00:00 2001 From: Cai Yudong Date: Sat, 18 Sep 2021 10:37:51 +0800 Subject: [PATCH] Add knowhere.yaml to support knowhere configuration (#7967) Signed-off-by: yudong.cai --- configs/advanced/knowhere.yaml | 16 ++++++++++++++++ configs/advanced/query_node.yaml | 1 - internal/querynode/param_table.go | 12 +++++++----- 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 configs/advanced/knowhere.yaml diff --git a/configs/advanced/knowhere.yaml b/configs/advanced/knowhere.yaml new file mode 100644 index 0000000000..6cac67c63e --- /dev/null +++ b/configs/advanced/knowhere.yaml @@ -0,0 +1,16 @@ +# Copyright (C) 2019-2020 Zilliz. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under the License. + +knowhere: + # Default value: auto + # Valid values: [auto, avx512, avx2, sse] + # This configuration is only used by querynode and indexnode, it selects CPU instruction set for Searching and Index-building. + simdType: auto diff --git a/configs/advanced/query_node.yaml b/configs/advanced/query_node.yaml index 865c871dfb..b00c222ddc 100644 --- a/configs/advanced/query_node.yaml +++ b/configs/advanced/query_node.yaml @@ -28,4 +28,3 @@ queryNode: segcore: chunkRows: 32768 - simdType: auto # auto, avx512, avx2, sse diff --git a/internal/querynode/param_table.go b/internal/querynode/param_table.go index 7510709696..5944e3f3b8 100644 --- a/internal/querynode/param_table.go +++ b/internal/querynode/param_table.go @@ -85,8 +85,10 @@ func (p *ParamTable) InitAlias(alias string) { func (p *ParamTable) Init() { once.Do(func() { p.BaseTable.Init() - err := p.LoadYaml("advanced/query_node.yaml") - if err != nil { + if err := p.LoadYaml("advanced/query_node.yaml"); err != nil { + panic(err) + } + if err := p.LoadYaml("advanced/knowhere.yaml"); err != nil { panic(err) } @@ -116,7 +118,7 @@ func (p *ParamTable) Init() { p.initStatsChannelName() p.initSegcoreChunkRows() - p.initSegcoreSimdType() + p.initKnowhereSimdType() p.initLogCfg() }) @@ -265,8 +267,8 @@ func (p *ParamTable) initSegcoreChunkRows() { p.ChunkRows = p.ParseInt64("queryNode.segcore.chunkRows") } -func (p *ParamTable) initSegcoreSimdType() { - simdType, err := p.Load("queryNode.segcore.simdType") +func (p *ParamTable) initKnowhereSimdType() { + simdType, err := p.LoadWithDefault("knowhere.simdType", "auto") if err != nil { panic(err) }