CUDA TQ2_0 fixes: 7.33x pp512 speedup with reproducible evidence

#3
by x0me - opened

I reproduced the Maple TQ2_0 GPU anomaly in the llama.cpp fork and found that it was primarily a CUDA routing/kernel problem, not evidence that ternary weights inherently favor CPUs.

The patch series makes the existing batch-one MMVQ route reachable, vectorizes the ternary dot product, adds CPU-reference coverage, and implements/enables a fused TQ2_0 MMQ prompt path.

Fresh controlled RTX 4080 SUPER validation (CUDA 12.8, driver 610.62):

  • pp512: 1,457 β†’ 10,674 t/s (7.33Γ—) with MMQ enabled
  • tg128 median: 375.0 β†’ 374.8 t/s (effectively unchanged, as expected)
  • correctness: 31/31 MUL_MAT + 72/72 MUL_MAT_ID against the CPU backend

The enabled path also passed all 103 tests on sm_86 and sm_120. Harvested unverified Vast results were 6,985.69 pp512 / 342.73 tg128 on RTX 3080 (sm_86) and 5,738.43 / 323.89 on RTX 5060 Ti (sm_120).

Reproducible dataset, raw samples, hashes, exact patches, and harness:
https://huggingface.co/datasets/x0me/maple-preview-cuda-benchmarks

Implementation repository:
https://github.com/PascalAI2024/maple-preview-windows-cuda

Important limits: I have not verified A100/sm_80 yet; the Vast hosts are explicitly marked unverified; and this validates throughput/correctness, not the model's coding, multilingual, or instruction-following quality.

Sign up or log in to comment