Conversion method
- Language model, 202 packed linears plus the token embedding and
lm_head.
Each 2-bit affine weight is dequantized exactly in float32 ((code - 1) * scale,
group 128). The blockwise Hadamard rotation that Prism ML folded into the stored
weights is then undone per contiguous 4096-column block of the input dimension:
W = (W_folded @ H) / sqrt(4096) * signs, where H is the Sylvester Hadamard
matrix and signs is the pack's own explicit sign vector for that input width.
The result is rounded to bf16.
- RMSNorm weights (
input_layernorm, post_attention_layernorm, norm,
q_norm, k_norm) are shifted by -1.0 to the transformers (1 + w)
convention. The gated GDN norm (linear_attn.norm) and A_log are kept in
float32 unchanged.
- Layouts:
conv1d weights go from MLX (C, K, 1) to PyTorch (C, 1, K);
the vision patch_embed goes from MLX channel-last to PyTorch (O, C, T, H, W).
- Vision tower (FP16 in the pack) and all other tensors are cast to bf16.
- The tensor key set and shard layout follow
Qwen/Qwen3.5-9B at revision
c202236235762e1c871ad0ccb60c8ee5ba337b9a,
without the mtp.* tensors.
The ternary benefit is not retained. This checkpoint stores the dense bf16
weights (~18.8 GB), not the 2-bit packing; it trades the small footprint
for compatibility with standard transformers tooling. For the compact
on-device format, use the original MLX or GGUF packs from Prism ML.
Credits
- Model: Ternary Bonsai 2 9B by Prism ML, built from
Qwen3.5-9B (Copyright 2026 Alibaba Cloud), both Apache 2.0. See
NOTICE.txt
and LICENSE.
- The Hadamard unfold (
load_hadamard_spec, unfold, refold) is adapted from
PipeNetwork/bonsai2-mlx at
revision d5129fc16286d4e7413eb998f3d075bde5e71ac6 (Apache 2.0).
License
Apache 2.0, following the base model and the source pack.