Expand description
Quantized prior weight archive (QPI1, QPR1, LRA1, QLA1) reader, writer, and validator.
Ported from read_tensor_archive, load_depth_prior, and helper functions in nn.py.
Structs§
- Archive
Metadata - Top-level JSON metadata header inside a tensor archive.
- Dequantized
Tensor - Dequantized float32 tensor decoded from an archive.
- Initialization
Meta - Initialization metadata stored inside
QPI1archives. - Prior
Archive - Complete decoded quantized prior archive.
- Prior
Plan - Validated plan for applying a
QPI1prior to a targetTransformer. - Tensor
Entry Meta - Metadata header for a single tensor stored in an archive.
- Transformer
Geometry - Architectural geometry used to verify source/target compatibility for
QPI1priors.
Enums§
- Archive
Magic - Four-byte archive magic identifier.
- BitWidth
- Supported per-tensor quantization bit widths.
- Initialization
Kind - Prior initialization expansion strategy recorded in
QPI1metadata. - Prior
Error - Errors returned when reading, writing, or validating quantized prior archives.
Constants§
- ARCHIVE_
VERSION - Version of the
QPI1/QPR1/LRA1/QLA1binary archive format.
Functions§
- depth_
block_ mapping - Computes the canonical even placement of
source_depthblocks insidetarget_depth. - parse_
block_ schedule - Parses a comma-separated recurrent-depth block schedule string.
- plan_
depth_ prior - Validates a loaded
QPI1prior archive against the target model geometry, vocabulary, and seed. - read_
archive - Reads and dequantizes a
QPI1/QPR1/LRA1/QLA1archive intof32tensors. - sha256_
file - Computes the lowercase hex SHA-256 digest of a file on disk.
- validate_
block_ schedule - Validates that a block schedule covers every physical layer index
0..n_layer. - write_
archive - Writes quantized tensors into a
QPI1/QPR1/LRA1/QLA1binary archive.