Struct EvictStrategy
Defined in File merlin_hashtable.cuh
Struct Documentation
-
struct
nv::merlin
::
EvictStrategy
The eviction strategies.
Note
The
Score
concept is introduced to define the importance of each key, the larger, the more important, the less likely they will be evicted. OnkLru
mode, thescores
parameter of the APIs should keepnullptr
, the score for each key is assigned internally in LRU(Least Recently Used) policy. OnkCustomized
mode, thescores
should be provided by caller.Note
Eviction occurs automatically when a bucket is full. The keys with the minimum
score
value are evicted first.Note
on
kLru
, Set the score to the Device clock in a nanosecond, which could differ slightly from the host clock.Note
For
kEpochLru
andkEpochLfu
, the high 32bits would be set toglobal_epoch
while the low 32 bits istimestamp
orfrequency
.Note
on
kLfu
, Frequency increment provided by caller via the input parameter ofscores
ofinsert-like
APIs as the increment of frequency. when the scores reaches to the max ofuint64_t
, it will not increase any more.Note
On
kEpochLru
, the high 32bits is the global epoch provided via the input parameter ofglobal_epoch
, the low 32bits is equal to(device_clock <blockquote><blockquote>20) & 0xffffffff
with granularity close to 1 ms.Note
On
kEpochLfu
, the high 32bits is the global epoch provided via the input parameter ofglobal_epoch
, the low 32bits is the frequency, the frequency will keep constant after reaching the max value of0xffffffff
.Note
On
kCustomized
, fully provided by the caller via the input parameter ofscores
ofinsert-like
APIs.