Skip to main content

Module pack

Module pack 

Source
Expand description

Pack qwen4-exp checkpoints into aligned files. MLX Q4 tensors are copied bit for bit; native BF16 tensors are converted as the files are written.

dense.bin every tensor that is not an expert matrix, an n-gram shard, or vision (64-byte aligned, name order) experts.bin [layer][expert] records (see ExpertLayout) ngram.bin [row] records of weight | scales | biases manifest.json

Modulesยง

affine ๐Ÿ”’
Affine Q4 groups: eight low-first nibbles per word, BF16 scale and bias.
source ๐Ÿ”’
Lazy tensor views let both checkpoint formats use the same packed writer. BF16 conversion holds one quantization group at a time, including when a fused expert tensor spans an entire layer. No converted checkpoint is staged.

Structsยง

Progress ๐Ÿ”’

Enumsยง

Class ๐Ÿ”’

Constantsยง

CHAT_METADATA_FILES ๐Ÿ”’
Auxiliary files copied without replacing metadata already present in a store.
DENSE_ALIGN ๐Ÿ”’

Functionsยง

classify ๐Ÿ”’
copy_chat_metadata ๐Ÿ”’
Older packed directories can acquire template metadata without repacking weights.
dtype_name ๐Ÿ”’
missing_chat_metadata ๐Ÿ”’
Whether an available source has metadata that the prepared store lacks.
pack
pack_dense ๐Ÿ”’
pack_experts ๐Ÿ”’
pack_ngram ๐Ÿ”’
pad_to ๐Ÿ”’
prepare
Prepare selected precisions without loading the inference engine. Low-bit stores always derive from the aligned Q4 base, which is retained for reuse.