Record Class FlashInferKvMetadata
java.lang.Object
java.lang.Record
smile.llm.cache.FlashInferKvMetadata
- Record Components:
pagedKvIndptr- CSR indptr over pages.pagedKvIndices- page ids.pagedKvLastPageLen- last-page lengths.pageSize- tokens per page.
- All Implemented Interfaces:
AutoCloseable
public record FlashInferKvMetadata(Tensor pagedKvIndptr, Tensor pagedKvIndices, Tensor pagedKvLastPageLen, int pageSize)
extends Record
implements AutoCloseable
FlashInfer CSR page-table metadata for a bound KV request window.
All tensors are int32. Layout matches FlashInfer / vLLM:
pagedKvIndptr—[batch + 1]cumulative page countspagedKvIndices— flattened physical page idspagedKvLastPageLen—[batch]tokens in the last page (1..pageSize)
-
Constructor Summary
ConstructorsConstructorDescriptionFlashInferKvMetadata(Tensor pagedKvIndptr, Tensor pagedKvIndices, Tensor pagedKvLastPageLen, int pageSize) Creates an instance of aFlashInferKvMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thepagedKvIndicesrecord component.Returns the value of thepagedKvIndptrrecord component.Returns the value of thepagedKvLastPageLenrecord component.intpageSize()Returns the value of thepageSizerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FlashInferKvMetadata
public FlashInferKvMetadata(Tensor pagedKvIndptr, Tensor pagedKvIndices, Tensor pagedKvLastPageLen, int pageSize) Creates an instance of aFlashInferKvMetadatarecord class.- Parameters:
pagedKvIndptr- the value for thepagedKvIndptrrecord componentpagedKvIndices- the value for thepagedKvIndicesrecord componentpagedKvLastPageLen- the value for thepagedKvLastPageLenrecord componentpageSize- the value for thepageSizerecord component
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
pagedKvIndptr
Returns the value of thepagedKvIndptrrecord component.- Returns:
- the value of the
pagedKvIndptrrecord component
-
pagedKvIndices
Returns the value of thepagedKvIndicesrecord component.- Returns:
- the value of the
pagedKvIndicesrecord component
-
pagedKvLastPageLen
Returns the value of thepagedKvLastPageLenrecord component.- Returns:
- the value of the
pagedKvLastPageLenrecord component
-
pageSize
-