Livt packages
Livt.ML
Version 1.6.1
Fixed-size quantized inference, tensor storage, attention, and transformer building blocks for Livt.
Published files (132)
- DotProductTest.lvt
- Int8BroadcastMac64x8Test.lvt
- Int8Dot64x8Test.lvt
- Int8Linear4x8Test.lvt
- Int8Linear8x3Test.lvt
- Int8LinearAccumulatorTest.lvt
- Int8Mac8Test.lvt
- Int8MatrixAccumulator32StreamTest.lvt
- Int8MatrixAccumulator32Test.lvt
- Linear8x8Test.lvt
- MatrixVectorMultiplicationTest.lvt
- QLinearMatMul256x10RamTest.lvt
- QLinearMatMul256x10StreamTest.lvt
- QuantizedMatrixGroupingTest.lvt
- VecAddTest.lvt
tests/linear/Int8Dot64x8Test.lvt
namespace Livt.ML.Tests.Linear
using Livt.ML.Linear
/**
* Exercises Int8Dot64x8 with a shared fixture instance. Each scenario establishes the
* inputs and state it needs.
*/
@Test
component Int8Dot64x8Test
{
// Compile-time dimensions, bounds, and numeric constants.
const WEIGHTS: logic[512] = 0xfd03020100fffefd03020100fffefd03020100fffefd03020100fffefd03020100fffefd03020100fffefd03020100fffefd03020100fffefd03020100fffefd
// Shared fixture instances, signals, and observation state.
dot: Int8Dot64x8
/**
* Creates the shared fixture instances (Int8Dot64x8). Tests initialize the state required
* by their scenario.
*/
new()
{
dot = new Int8Dot64x8()
}
/**
* Checks that Compute s signed dot product in eight registered groups.
*/
@Test
fn ComputesSignedDotProductInEightRegisteredGroups()
{
for (var index = 0; index < 64; index++) {
dot.SetActivation(index, index - 32)
}
assert dot.Compute(WEIGHTS) == 159
dot.Reset()
assert dot.Compute(WEIGHTS) == 159
}
}