Skip to main content

Crate tufazip_prior

Crate tufazip_prior 

Source
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§

ArchiveMetadata
Top-level JSON metadata header inside a tensor archive.
DequantizedTensor
Dequantized float32 tensor decoded from an archive.
InitializationMeta
Initialization metadata stored inside QPI1 archives.
PriorArchive
Complete decoded quantized prior archive.
PriorPlan
Validated plan for applying a QPI1 prior to a target Transformer.
TensorEntryMeta
Metadata header for a single tensor stored in an archive.
TransformerGeometry
Architectural geometry used to verify source/target compatibility for QPI1 priors.

Enums§

ArchiveMagic
Four-byte archive magic identifier.
BitWidth
Supported per-tensor quantization bit widths.
InitializationKind
Prior initialization expansion strategy recorded in QPI1 metadata.
PriorError
Errors returned when reading, writing, or validating quantized prior archives.

Constants§

ARCHIVE_VERSION
Version of the QPI1/QPR1/LRA1/QLA1 binary archive format.

Functions§

depth_block_mapping
Computes the canonical even placement of source_depth blocks inside target_depth.
parse_block_schedule
Parses a comma-separated recurrent-depth block schedule string.
plan_depth_prior
Validates a loaded QPI1 prior archive against the target model geometry, vocabulary, and seed.
read_archive
Reads and dequantizes a QPI1/QPR1/LRA1/QLA1 archive into f32 tensors.
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/QLA1 binary archive.