Remove gpu mode param check (#23074)

Signed-off-by: Yudong Cai <yudong.cai@zilliz.com>
pull/23103/head^2
Cai Yudong 2023-03-29 14:24:01 +08:00 committed by GitHub
parent e2096965c7
commit 3febb5e45a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 19 deletions

View File

@ -87,10 +87,6 @@ const (
PQM = "PQM"
NTREES = "n_trees"
IndexMode = "index_mode"
CPUMode = "CPU"
GPUMode = "GPU"
)
// METRICS is a set of all metrics types supported for float vector.
@ -177,11 +173,8 @@ func (adapter *IVFPQConfAdapter) checkPQParams(params map[string]string) bool {
// nbits can be set to default: 8
nbitsStr, nbitsExist := params[NBITS]
var nbits int
if !nbitsExist {
nbits = 8
} else {
nbits, err = strconv.Atoi(nbitsStr)
if nbitsExist {
_, err := strconv.Atoi(nbitsStr)
if err != nil { // invalid nbits
return false
}
@ -196,15 +189,6 @@ func (adapter *IVFPQConfAdapter) checkPQParams(params map[string]string) bool {
return false
}
mode, ok := params[IndexMode]
if !ok {
mode = CPUMode
}
if mode == GPUMode && !adapter.checkGPUPQParams(dimension, m, nbits) {
return false
}
return adapter.checkCPUPQParams(dimension, m)
}

View File

@ -134,7 +134,6 @@ func TestIVFPQConfAdapter_CheckTrain(t *testing.T) {
invalidParamsIVF[IVFM] = "NAN"
invalidParamsM := copyParams(validParams)
invalidParamsM[IndexMode] = GPUMode
invalidParamsM[DIM] = strconv.Itoa(65536)
invalidParamsMzero := copyParams(validParams)