Skip to main content

//clika-runtime/io.clika.modelverse/FitVerdict

FitVerdict

[common]
data class FitVerdict(val source: String, val device: String, val deviceBytes: Long, val weightBytes: Long, val kvBytesFixed: Long, val kvBytesPerToken: Long, val kvDtype: String, val contextLength: Long, val maxSeq: Long, val activationBytes: Long, val needBytes: Long, val fits: Boolean, val maxSeqFits: Long, val maxImageFits: Int, val reason: String, val judged: Boolean, val grade: FitGrade?, val memorySharePercent: Int, val parameters: Long, val weightEncoding: String, val tokSEstimate: Double, val tokSMeasured: Double)

Does a model fit a device, judged from its metadata alone, the library's own FitVerdict. The law, every term a field:

need = weightBytes + kvBytesFixed + kvBytesPerToken * maxSeqFits + activationBytes
fits = need <= deviceBytes

weightBytes is the size of the weight files a fetch takes; kvBytesFixed and kvBytesPerToken come from the cache layout the model's documents describe, at kvDtype (empty when the model prices no cache); activationBytes is the working set beside them. deviceBytes is the device's memory with no headroom taken off; a caller keeping memory free for the system applies its own margin. maxSeq is the sequence length the verdict was judged at and maxSeqFits the admitted context: the largest rung of the context ladder up to it whose need keeps FitGrade.GOOD or better, 0 when no context fits; contextLength the model's own window (0 when its documents declare none); maxImageFits the largest square image an image generation pipeline can make (0 otherwise). grade is null and judged false on a row whose source could not be read; reason says what decided the verdict. tokSEstimate is the decode speed estimate on a CPU in tokens per second (0 when none applies), tokSMeasured a measured figure for the device (0 when none is known).

Constructors​

FitVerdict[common]
constructor(source: String, device: String, deviceBytes: Long, weightBytes: Long, kvBytesFixed: Long, kvBytesPerToken: Long, kvDtype: String, contextLength: Long, maxSeq: Long, activationBytes: Long, needBytes: Long, fits: Boolean, maxSeqFits: Long, maxImageFits: Int, reason: String, judged: Boolean, grade: FitGrade?, memorySharePercent: Int, parameters: Long, weightEncoding: String, tokSEstimate: Double, tokSMeasured: Double)

Properties​

NameSummary
activationBytes[common]
val activationBytes: Long
contextLength[common]
val contextLength: Long
device[common]
val device: String
deviceBytes[common]
val deviceBytes: Long
fits[common]
val fits: Boolean
grade[common]
val grade: FitGrade?
judged[common]
val judged: Boolean
kvBytesFixed[common]
val kvBytesFixed: Long
kvBytesPerToken[common]
val kvBytesPerToken: Long
kvDtype[common]
val kvDtype: String
maxImageFits[common]
val maxImageFits: Int
maxSeq[common]
val maxSeq: Long
maxSeqFits[common]
val maxSeqFits: Long
memorySharePercent[common]
val memorySharePercent: Int
needBytes[common]
val needBytes: Long
parameters[common]
val parameters: Long
reason[common]
val reason: String
source[common]
val source: String
tokSEstimate[common]
val tokSEstimate: Double
tokSMeasured[common]
val tokSMeasured: Double
weightBytes[common]
val weightBytes: Long
weightEncoding[common]
val weightEncoding: String