Livt packages
Livt.ML
Version 1.6.1
Fixed-size quantized inference, tensor storage, attention, and transformer building blocks for Livt.
Published files (132)
- DotProduct.lvt
- FixedPointAccumulator.lvt
- Int8BroadcastMac64x8.lvt
- Int8BroadcastMac64x8Primitive.lvt
- Int8BroadcastMac64x8Primitive.vhd
- Int8Dot64x8.lvt
- Int8Dot64x8Primitive.lvt
- Int8Dot64x8Primitive.vhd
- Int8Linear4x8.lvt
- Int8Linear8x3.lvt
- Int8LinearAccumulator.lvt
- Int8Mac8.lvt
- Int8MatrixAccumulator32.lvt
- Int8MatrixAccumulator32Primitive.lvt
- Int8MatrixAccumulator32Primitive.vhd
- Int8MatrixAccumulator32Stream.lvt
- Linear8x8.lvt
- MatrixVectorMultiplication.lvt
- QLinearMatMul256x10.lvt
- QLinearMatMul256x10Ram.lvt
- QLinearMatMul256x10Stream.lvt
- QuantizedMatrix.lvt
- VecAdd.lvt
src/linear/Int8Mac8.lvt
namespace Livt.ML.Linear
/**
* Context-free eight-lane signed-int8 multiply-accumulate building block.
*
* This is useful when an external memory supplies one 64-bit weight word per
* cycle. Activations remain `int` so callers can retain a wider quantized
* representation; each `logic[8]` weight is interpreted as two's complement.
*/
class Int8Mac8
{
/**
* Adds eight activation-by-signed-byte products to an int32 accumulator.
*/
public static fn Accumulate[](
accumulator: int,
activation0: int, activation1: int, activation2: int, activation3: int,
activation4: int, activation5: int, activation6: int, activation7: int,
weight0: logic[8], weight1: logic[8], weight2: logic[8], weight3: logic[8],
weight4: logic[8], weight5: logic[8], weight6: logic[8], weight7: logic[8]) int
{
return accumulator + activation0 * (weight0 as int) + activation1 * (weight1 as int) + activation2 * (weight2 as int) + activation3 * (weight3 as int) + activation4 * (weight4 as int) + activation5 * (weight5 as int) + activation6 * (weight6 as int) + activation7 * (weight7 as int)
}
}