Skip to content

dflash: apply the target's prism.hadamard folds to the shared token table and lm_head (DFlash2 on Ternary-Bonsai: 0 -> 0.37 acceptance) - #143

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/bonsai-sweet
Oct 25, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/bonsai-sweet

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

DFlash2 drafters on PrismML Ternary-Bonsai-2-27B read the target's shared token table and lm_head without the target's prism.hadamard folds, so every draft was rejected (0 of 5271 accepted; 4.7 tok/s, slower than no drafter). src/models/dflash.cpp now applies the target's Hadamard folds to the shared token table and lm_head. With the private add-on's ternary verify kernels: PQ2_0 + DFlash2 q8_0 35.7 / 31.2 / 20.4 / 22.7 tok/s code / prose / short / translation at 0.37 acceptance (MTP n3 on the same file: 42.0 / 36.9 / 27.2 / 33.4 at 0.67, so MTP stays the Bonsai route). Qwen3.8-27B (no folds) unchanged. One commit on d65a7e5; loom agent task TBONSAI-SWEET, 2026-10-25.

🤖 Generated with Claude Code

…able and lm_head

A DFlash drafter reads its target's tok_embd and output (ctx_other). Ternary-Bonsai-2-27B stores both
Hadamard-folded (prism.hadamard: the token table rotated, the lm_head folded), and the drafter's graph took
them without the target's inverse / forward transforms, so every draft was garbage: 0 of 5271 drafted tokens
accepted, 4.7 tok/s (DFlash2 q8_0, PQ2_0 file, fork e91b608). With the transforms (the same ones the
target graph applies, llama_hadamard::inverse / forward): acceptance 0.37 code / 0.30 prose, 35.73 / 31.17 /
22.71 tok/s code / prose / tr (3 fresh servers, 256-token greedy, strict placement, gpu-kernels 4b8b9d0 +
the ternary kqt kernels, performance mode). Files without prism.hadamard are unchanged (both transforms
return their input when the tensor is not folded).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bong-water-water-bong

Copy link
Copy Markdown
Author

Kernel side (private add-on): gpu-kernels #36.

@bong-water-water-bong
bong-water-water-bong merged commit 9705173 into 1bit/hrx-vulkan-patched Oct 25, 2026
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/bonsai-sweet branch November 12, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant