Repository navigation
xyz: Ternary Bonsai 2 27B at 160k context on one 16 GB GPU, about 140 tokens/s, lossless speculative decoding #29621
Replies: 1 comment 2 replies
|
Nice work on the exact-sample verification. One note on the memory side, since the post says the 2-bit cache is what gets 160k into 16 GB: Bonsai 2's base is Qwen3.8 27B, where only 16 of the 64 layers keep a KV cache, 65,536 bytes per token at f16. At about 161K that is 9.8 GiB at f16, 5.2 GiB at q8_0 and 2.8 GiB at q4_0, so with the 5.54 GiB PTQ1_0 file even q4_0 lands around 9–10 GiB. An RTX 4070 12GB was measured at 9,918 MiB with 131K filled at q4_0 on PrismML's fork. So on a 16 GB card the fit already works at q4_0; I'd guess xyzkv2's gain is mostly speed, since decode at that depth reads the whole cache every token. A tok/s number for q4_0 vs xyzkv2 at 161K on the same card would show it. The file sizes and that measurement are on this page: [Link removed by moderator]/new-gguf-quants/ (I built it.) |
Uh oh!
There was an error while loading. Please reload this page.
We forked llama.cpp to get PrismML's Ternary Bonsai 2 27B (
PTQ1_0) running fast at long context on one 16 GB card.On an RTX 4070 Ti SUPER (16 GB, stock power limit) at around 161k context, temperature 1.0, top-k 20, top-p 0.95, over 10 generations (11,964 tokens) we measured 139.5 tokens/s and 2.82 tokens per round, and 144.2 tokens/s with our optional CUDA runtime (
XYZ_ENGINE=1), same text.What we added:
PTQ1_0/PQ2_0weightsOn Windows it's one zip, unzip it and run
scripts\xyz-serve.cmd, the model downloads on the first start. On Linux you build it with CMake and runscripts/xyz-serve.sh, we've only tested Windows so far.Repo: https://github.com/xyznq1/xyz-llama
Drafter: https://github.com/xyznq1/xyz-drafter
It's built on llama.cpp, thanks to everyone here. The KV cache follows TurboQuant, the draft head follows EAGLE-3 and the verification follows the block verification paper, the credits are in the README.
All reactions