QuantizedMatrix
classin packageklyn.math.nn.quantization
public class QuantizedMatrix
QuantizedMatrix

A packed Klyn Q8 matrix with row-local FP32 scales. Loading allocates only the INT8 weights and their scales, never a full floating copy. Explicit CPU primitives consume that representation directly; this class does not claim GPU execution or implement a complete language model.

Example

matrix = QuantizedMatrix(Path("model-q8.safetensors"), "projection.weight")

Properties
Modifier and Type Member Description
public readonly property columns
columns as Long
Input columns in the original weight matrix.
public readonly property rows
rows as Long
Output rows in the original weight matrix.
public readonly property storageBytes
storageBytes as ULong
Physical weight and scale bytes, excluding object headers.
Constructors
Modifier and Type Member Description
public QuantizedMatrix
QuantizedMatrix(path as Path, name as String)
Loads and validates one rank-two matrix from a Klyn Q8 shard.
Methods
Modifier and Type Member Description
public embeddingCPU
embeddingCPU(notnull indices as IList<Long>) as NDArray<Float>
Decodes selected embedding rows on the CPU, not the entire table.
public multiplyCPU
multiplyCPU(inputs as NDArray<Float>) as NDArray<Float>
Computes inputs times this weight matrix's transpose on the CPU.