Update note on ik_llama.cpp: Lossless repack to PQ2_0 enables native CPU (-rtr) and CUDA offload

#1
by Gaby8999 - opened

Hi! First off, thank you so much for this repo, the Q2_KT build, and the brilliant mathematical explanation of the ternary zero-shift issue. Your analysis was spot-on.

When you released this build back in July, you were 100% right: TQ2_0 couldn't run on ik_llama.cpp, and native ternary was strictly stuck on CPU.

I just wanted to share some recent good news with you: the ecosystem has caught up over the past few weeks, partly inspired by work like yours!

  1. Lossless repack script (TQ2_0 βž” PQ2_0):
    Mainline uses $QK=256$ for TQ2_0 while ik_llama uses $QK=128$ for Prism's PQ2_0. I recently contributed scripts/repack_ternary_to_prism.py (merged in PR #2694), which losslessly converts your TQ2_0 GGUF to PQ2_0 in seconds (exact trits preserved, scales duplicated).

  2. Native CUDA kernels landed:
    In recent commits (PR #2691 & #2747), ik_llama.cpp finally added native CUDA support for PQ2_0. So repacked native ternary can now actually be offloaded to Nvidia GPUs without token degradation.

  3. CPU speed:
    On CPU, running the repacked file with -rtr triggers the interleaved PQ2_0_R8 path, giving a huge boost to prompt processing.

No obligation or pressure to change anything on your end! I just wanted to share this so you know your work helped push things forward. If you ever feel like updating the note or offering a PQ2_0 build for ik_llama users down the road, the tools are officially in main now.

Thanks again for the awesome work on Bonsai!

Sign up or log in to comment