Record Class KvCachePool.StaticKvBudget
java.lang.Object
java.lang.Record
smile.llm.cache.KvCachePool.StaticKvBudget
- Record Components:
total- device total memory bytes.used- bytes already held (typically weights + DeltaNet).staticBudget-total × memFraction.kvBudget- bytes available for KV (staticBudget − used).dynamicReserve-total − staticBudget.numSlots- page-aligned slot count after context cap.maxUsefulSlots-maxBatchSize × maxSeqLenpage-aligned.
- Enclosing class:
KvCachePool
public static record KvCachePool.StaticKvBudget(long total, long used, long staticBudget, long kvBudget, long dynamicReserve, int numSlots, int maxUsefulSlots)
extends Record
Result of SGLang-style static KV budget arithmetic (testable without CUDA).
-
Constructor Summary
ConstructorsConstructorDescriptionStaticKvBudget(long total, long used, long staticBudget, long kvBudget, long dynamicReserve, int numSlots, int maxUsefulSlots) Creates an instance of aStaticKvBudgetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thedynamicReserverecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longkvBudget()Returns the value of thekvBudgetrecord component.intReturns the value of themaxUsefulSlotsrecord component.intnumSlots()Returns the value of thenumSlotsrecord component.longReturns the value of thestaticBudgetrecord component.final StringtoString()Returns a string representation of this record class.longtotal()Returns the value of thetotalrecord component.longused()Returns the value of theusedrecord component.
-
Constructor Details
-
StaticKvBudget
public StaticKvBudget(long total, long used, long staticBudget, long kvBudget, long dynamicReserve, int numSlots, int maxUsefulSlots) Creates an instance of aStaticKvBudgetrecord class.- Parameters:
total- the value for thetotalrecord componentused- the value for theusedrecord componentstaticBudget- the value for thestaticBudgetrecord componentkvBudget- the value for thekvBudgetrecord componentdynamicReserve- the value for thedynamicReserverecord componentnumSlots- the value for thenumSlotsrecord componentmaxUsefulSlots- the value for themaxUsefulSlotsrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
total
-
used
-
staticBudget
public long staticBudget()Returns the value of thestaticBudgetrecord component.- Returns:
- the value of the
staticBudgetrecord component
-
kvBudget
-
dynamicReserve
public long dynamicReserve()Returns the value of thedynamicReserverecord component.- Returns:
- the value of the
dynamicReserverecord component
-
numSlots
-
maxUsefulSlots
public int maxUsefulSlots()Returns the value of themaxUsefulSlotsrecord component.- Returns:
- the value of the
maxUsefulSlotsrecord component
-