1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! Model quantization for AxonML — GGUF formats + BitNet I2_S ternary.
//!
//! `types` (QuantType enum, block structs for Q8_0/Q4_0/Q4_1/Q5_0/Q5_1/F16),
//! `quantize` (tensor/model quantization with RMSE error analysis),
//! `dequantize` (block/tensor reconstruction to f32), `bitnet` (I2_S 1.58-bit
//! ternary — 128-weight blocks, fused add-only matmul, int8 activation
//! quantizer, AVX-VNNI dispatch scaffolded), `calibration` (MinMax/Percentile/
//! MeanStd/Entropy methods), `inference` (QuantizedLinear drop-in layer,
//! QuantizedModel wrapper), `error` (QuantError/QuantResult).
//!
//! # File
//! `crates/axonml-quant/src/lib.rs`
//!
//! # Author
//! Andrew Jewell Sr. — AutomataNexus LLC
//! ORCID: 0009-0005-2158-7060
//!
//! # Updated
//! April 14, 2026 11:15 PM EST
//!
//! # Disclaimer
//! Use at own risk. This software is provided "as is", without warranty of any
//! kind, express or implied. The author and AutomataNexus shall not be held
//! liable for any damages arising from the use of this software.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
// =============================================================================
// Constants
// =============================================================================
/// Default block size for quantization.
pub const DEFAULT_BLOCK_SIZE: usize = 32;
/// Maximum block size supported.
pub const MAX_BLOCK_SIZE: usize = 256;
// =============================================================================
// Tests
// =============================================================================