Skip to main content

tinyquant_core/codec/
mod.rs

1//! Codec layer: deterministic `CodecConfig`, canonical rotation matrix,
2//! rotation cache, codebook quantization, residual helpers, the
3//! stateless `Codec` service, and the `PreparedCodec` session object.
4//!
5//! Phase 13 introduced the rotation primitives; Phase 14 adds the
6//! uniform-quantile [`Codebook`] plus scalar quantize / dequantize
7//! kernels. Phase 15 adds the `Codec` service, FP16 residual helpers,
8//! `CompressedVector` value object, and `Parallelism` enum.
9//! Phase 26 adds [`PreparedCodec`] — a pre-built session that caches the
10//! rotation matrix for reuse across batch calls, enabling the GPU backend
11//! attachment point (Phase 27+).
12
13#[cfg(feature = "std")]
14pub(crate) mod batch;
15#[cfg(feature = "std")]
16pub(crate) mod batch_error;
17pub mod codebook;
18pub mod codec_config;
19pub mod compressed_vector;
20#[cfg(feature = "simd")]
21pub mod dispatch;
22pub mod gaussian;
23pub(crate) mod kernels;
24pub mod parallelism;
25pub mod prepared;
26pub(crate) mod quantize;
27pub mod residual;
28pub mod rotation_cache;
29pub mod rotation_matrix;
30pub mod service;
31#[cfg(feature = "simd")]
32pub mod simd_api;
33
34pub use codebook::Codebook;
35pub use codec_config::{CodecConfig, MAX_DIMENSION, SUPPORTED_BIT_WIDTHS};
36pub use compressed_vector::CompressedVector;
37pub use parallelism::Parallelism;
38pub use prepared::PreparedCodec;
39pub use rotation_cache::{RotationCache, DEFAULT_CAPACITY as ROTATION_CACHE_DEFAULT_CAPACITY};
40pub use rotation_matrix::RotationMatrix;
41pub use service::{compress, decompress, Codec};