Skip to content

Commit

Permalink
MB-61029: Tweaked alpha and sample values
Browse files Browse the repository at this point in the history
  • Loading branch information
Likith101 authored and Thejas-bhat committed Apr 2, 2024
1 parent b7ee3a5 commit 3338deb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions faiss_vector_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ func (vc *vecCache) update(fieldIDPlus1 uint16, index *faiss.IndexImpl) {
// this makes the average to be kept above the threshold value for a
// longer time and thereby the index to be resident in the cache
// for longer time.
// todo: alpha to be experimented with different values
vc.cache[fieldIDPlus1] = initCacheEntry(index, 0.3)
vc.cache[fieldIDPlus1] = initCacheEntry(index, 0.4)
}
vc.m.Unlock()
}
Expand All @@ -142,9 +141,7 @@ func initCacheEntry(index *faiss.IndexImpl, alpha float64) *cacheEntry {
vc.cacheMonitor.alpha = alpha
go vc.monitor()

// initing the sample to be 16 for now. more like a cold start to the monitor
// with a large enough value so that we don't immediately evict the index
atomic.StoreUint64(&vc.cacheMonitor.sample, 16)
atomic.StoreUint64(&vc.cacheMonitor.sample, 1)
return vc
}

Expand Down

0 comments on commit 3338deb

Please sign in to comment.