|
|
hai 3 semanas | |
|---|---|---|
| .. | ||
| README.md | hai 3 semanas | |
| backend_test.go | hai 3 semanas | |
| harness_cpu_test.go | hai 3 semanas | |
| harness_cuda_test.go | hai 3 semanas | |
| quant_test.go | hai 3 semanas | |
| unit_quant_test.go | hai 3 semanas | |
This directory contains comprehensive tests for the Makarna inference engine.
quant_test.go: Quantization/dequantization correctness tests for all K-quant types
unit_quant_test.go: Unit tests for low-level quantization utilities
backend_test.go: Backend operation tests
data/: Golden test data (binary files)
cd tests
go test -v
cd tests
go test -v -run TestQ3K_GoldenIter
Each quantization type is tested against 4 different data patterns:
| Type | Bits | Levels | Typical MSE (Normal) | Use Case |
|---|---|---|---|---|
| Q8_K | 8 | 256 | < 0.001 | High precision |
| Q6_K | 6 | 64 | < 0.002 | Embeddings |
| Q4_K | 4 | 16 | < 0.05 | General weights |
| Q3_K | 3 | 8 | < 0.15 | Medium quality mix |
| Q2_K | 2 | 4 | < 0.5 | Aggressive compression |
Note: Large-range patterns (±50+) will have proportionally higher MSE due to quantization binning.
*_test.go fileTest<Feature>_<Variant>t.Logf() for metrics, t.Errorf() for failuresThese tests run automatically on:
pkg/tensor/, pkg/backend/All tests must pass before merge.