Repository navigation
Ternary Bonsai on HRX: exact PTQ1_0 -> Q4_0 converter, prism.hadamard route, pin llama.cpp b8d587e - #248
Conversation
…adamard route PrismML's Ternary-Bonsai-2-27B (Qwen3.8-27B trained ternary) now runs on HRX0. - tools/ternary_to_q4_0.py writes PrismML's PTQ1_0 weights as Q4_0, bit for bit (q = trit + 8, the group's fp16 scale in each of its four blocks), decodes every group back before keeping the file, keeps all metadata and stamps onebit.ternary_q4_0 = 128. tests/ternary_to_q4_0_test.py checks it against PrismML's own encoder (run in CI next to the Q4NX repack test). - 1bit serve sends a prism.hadamard file to --device hrx (auto picks it; other devices are refused, upstream llama.cpp would ignore the rotation and answer garbage) and refuses PrismML's own ternary types with the converter's name. tests/prism_route.sh. - docs/hrx.md: how to run it, what was checked, and the one-sequence limit of the Qwen3.5 / Qwen3.8 gated delta net on HRX0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acf9c74 -> b8d587e is llama.cpp #34 only: src/llama-hadamard.{h,cpp} reads prism.hadamard.* and rotates the activations before each folded weight, so Ternary Bonsai runs on HRX0. docs/hrx.md: the Qwen3.5 / Qwen3.8 one-sequence note now points at serve's one-slot default and --parallel refusal (#244). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Docs7 for 1bit-monster/engine
Commit |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pushed afbfaa8: registry regenerated for b8d587e. |
|
Review (standing in for PR-Agent while Read the full diff: converter,
CI: the one change adds a test step; permissions are untouched. Pin and registry:
HRX0 check of the pin against acf9c74, wikitext c512 x4:
|
|
HRX0 check of b8d587e against acf9c74 (wikitext, c512 b512):
Files without prism.hadamard keys build the same graph, as the PR says. Merging. |
PrismML's Ternary-Bonsai-2-27B (Qwen3.8-27B trained to weights of -1/0/+1) now runs on HRX0.
What's in it
tools/ternary_to_q4_0.pywrites PrismML's PTQ1_0 weights as Q4_0, bit for bit: q = trit + 8, with the group's own fp16 scale in each of its four blocks. It decodes every group back before keeping the file, and stampsonebit.ternary_q4_0 = 128. The decoder matched PrismML's ownlibggmlto_floaton 210 M real Bonsai weights with 0 mismatches;tests/ternary_to_q4_0_test.pychecks the tool against PrismML's encoder in CI.1bit servesends aprism.hadamardfile to--device hrx(autopicks it) and refuses every other device, since upstream llama.cpp would ignore the rotation and answer garbage. It refuses PrismML's own ternary types with the converter's name. Covered bytests/prism_route.sh.acf9c74->b8d587e, which is only llama.cpp site: GoatCounter visitor counts #34 (theprism.hadamardloader).docs/hrx.md: how to run it, and what was checked.Checked on strixhalo (gfx1151)
1bit serve --device hrxgives 14.3 / 14.9 / 13.9 tok/s on the code / prose / short prompts, and answers "Paris". PrismML's PTQ1_0 on Vulkan decodes 27.8 tok/s, which is what a native ternary HRX kernel would win back.prism_route,hadamard_routeandlong_routepass.ternary_to_q4_0_test.pypasses, and fails when the trit order is broken on purpose.🤖 Generated with Claude Code