Livt packages

Livt.ML

Version 1.6.1

Fixed-size quantized inference, tensor storage, attention, and transformer building blocks for Livt.

Published files (132)

src/storage/IQuantizedWeights.lvt

namespace Livt.ML.Storage

/**
 * Read-only tensor-relative packed weights and scale words. A single worker owns calls.
 */
interface IQuantizedWeights
{
	/**
	 * Reads a tensor-relative byte containing two signed INT4 codes, low nibble first.
	 * Requires byteIndex in 0..ceil(WeightCount()/2)-1.
	 */
	fn ReadPacked(byteIndex: int) byte

	/**
	 * Reads the raw scale word for groupIndex in 0..ScaleCount()-1. Its fixed-point scale is
	 * agreed with the consumer.
	 */
	fn ReadScale(groupIndex: int) logic[32]

	/**
	 * Returns the logical weight count, measured in individual INT4 values rather than bytes.
	 */
	fn WeightCount() int

	/**
	 * Returns the number of available quantization-group scale words.
	 */
	fn ScaleCount() int
}