mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
fix: Add AiSAQ index type RAM estimation implementation on the query node. (#45246)
Currently, the index type AiSAQ RAM usage estimation is not being calculated correctly. AiSAQ index type consumes less RAM usage while loading the index than DISKANN does, and the query node module is missing the implementation of the RAM usage estimation for that AiSAQ index type. We suggest that the AiSAQ RAM usage estimation calculation should be as follows: UsedDiskMemoryRatioAisaq = 1024 (contrary to the UsedDiskMemoryRatio, which is 4) neededMemSize = indexInfo.IndexSize / UsedDiskMemoryRatioAisaq neededDiskSize = indexInfo.IndexSize Reported issue is #45247 --------- Signed-off-by: Lior Friedman <lior.friedman@il.kioxia.com> Signed-off-by: friedl <lior.friedman@kioxia.com> Co-authored-by: friedl <lior.friedman@kioxia.com>
This commit is contained in:
parent
121eb912ba
commit
a4d69031f1
@ -68,6 +68,11 @@ func (c *IndexAttrCache) GetIndexResourceUsage(indexInfo *querypb.FieldIndexInfo
|
||||
neededDiskSize := indexInfo.IndexSize - neededMemSize
|
||||
return uint64(neededMemSize), uint64(neededDiskSize), nil
|
||||
}
|
||||
if vecindexmgr.GetVecIndexMgrInstance().IsAISAQ(indexType) {
|
||||
neededMemSize := indexInfo.IndexSize / UsedDiskMemoryRatioAisaq
|
||||
neededDiskSize := indexInfo.IndexSize
|
||||
return uint64(neededMemSize), uint64(neededDiskSize), nil
|
||||
}
|
||||
if indexType == indexparamcheck.IndexINVERTED {
|
||||
neededMemSize := 0
|
||||
// we will mmap the binlog if the index type is inverted index.
|
||||
|
||||
@ -78,6 +78,25 @@ func (s *IndexAttrCacheSuite) TestDiskANN() {
|
||||
s.EqualValues(75, disk)
|
||||
}
|
||||
|
||||
func (s *IndexAttrCacheSuite) TestAISAQ() {
|
||||
info := &querypb.FieldIndexInfo{
|
||||
IndexParams: []*commonpb.KeyValuePair{
|
||||
{Key: common.IndexTypeKey, Value: "AISAQ"},
|
||||
},
|
||||
CurrentIndexVersion: 0,
|
||||
IndexSize: 1024,
|
||||
}
|
||||
|
||||
memory, disk, err := s.c.GetIndexResourceUsage(info, paramtable.Get().QueryNodeCfg.MemoryIndexLoadPredictMemoryUsageFactor.GetAsFloat(), nil)
|
||||
s.Require().NoError(err)
|
||||
|
||||
_, has := s.c.loadWithDisk.Get(typeutil.NewPair[string, int32]("AISAQ", 0))
|
||||
s.False(has, "AISAQ shall never be checked load with disk")
|
||||
|
||||
s.EqualValues(16, memory)
|
||||
s.EqualValues(1024, disk)
|
||||
}
|
||||
|
||||
func (s *IndexAttrCacheSuite) TestInvertedIndex() {
|
||||
info := &querypb.FieldIndexInfo{
|
||||
IndexParams: []*commonpb.KeyValuePair{
|
||||
|
||||
@ -67,6 +67,7 @@ import (
|
||||
|
||||
const (
|
||||
UsedDiskMemoryRatio = 4
|
||||
UsedDiskMemoryRatioAisaq = 64
|
||||
)
|
||||
|
||||
var errRetryTimerNotified = errors.New("retry timer notified")
|
||||
|
||||
@ -77,6 +77,7 @@ type VecIndexMgr interface {
|
||||
IsNoTrainIndex(indexType IndexType) bool
|
||||
IsVecIndex(indexType IndexType) bool
|
||||
IsDiskANN(indexType IndexType) bool
|
||||
IsAISAQ(indexType IndexType) bool
|
||||
IsGPUVecIndex(indexType IndexType) bool
|
||||
IsDiskVecIndex(indexType IndexType) bool
|
||||
IsMMapSupported(indexType IndexType) bool
|
||||
@ -108,6 +109,10 @@ func (mgr *vecIndexMgrImpl) IsDiskANN(indexType IndexType) bool {
|
||||
return indexType == "DISKANN"
|
||||
}
|
||||
|
||||
func (mgr *vecIndexMgrImpl) IsAISAQ(indexType IndexType) bool {
|
||||
return indexType == "AISAQ"
|
||||
}
|
||||
|
||||
func (mgr *vecIndexMgrImpl) init() {
|
||||
size := int(C.GetIndexListSize())
|
||||
if size == 0 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user