Join the conversation

Join the community of Machine Learners and AI enthusiasts.

Sign Up
Ternii 
posted an update 2 days ago
Post
3,040
llama.cpp-tr r4 is out: our trit-quantised models now run on CUDA as well as Metal.

New in r4:
- A Linux arm64 build with CUDA for the DGX Spark, alongside the macOS build. On a DGX Spark, prompt processing at 2,048 tokens went from 1,387 to 1,924 tokens/s on Qwen3.6-35B-A3B (×1.39) and from 607 to 806 on Qwen3.8-Flash-Next (×1.33), compared with the build's plain CUDA kernels.
- On the Mac, a Metal kernel for 2–8 tokens at a time (several users decoding together). With 2–8 users, total decode is 8–24 % faster; with one user it is level (no speed-up). Answers are identical to r3 on our 60-prompt check. (Corrected 22 Nov: this line first said the kernel speeds up speculative-decoding checks; with one user those are ~65-token passes that use a different kernel.)
- x86 (AVX2) support in the source; build it yourself with apply.sh. No x86 binary yet.

Accuracy: the CUDA tensor-core prompt path changes outputs slightly. We measured it against the path switched off (GGML_CUDA_TQ_MM=0) and found no significant difference: Qwen3.6-35B-A3B GSM8K 90.83 vs 90.60, HumanEval+ 91.46 vs 92.68, MBPP+ 91.53 vs 91.27; Qwen3.8-Flash-Next GSM8K 92.80 vs 93.25 (n = 1,319).

Caveats: CUDA is tested on a DGX Spark (GB10) only. The one-line Mac installers stay on r3. The builds need our patched llama.cpp; LM Studio and Ollama can't load these models.

Release: https://github.com/ternii-ai/tritq-vllm/releases/tag/llama.cpp-tr-b11721-r4
Models: Ternii/Qwen3.6-35B-A3B-TR2.25-G-GGUF · Ternii/Qwen3.8-Flash-Next-TR2.31-G-GGUF

I’d be interested in the single-stream case for the new Metal verify kernel. With one request and the same draft settings, did the faster verification step lower the time between generated tokens overall? The 2–8-user throughput numbers are helpful, and a batch-one result would make it easier to decide when to enable it for interactive use.

·

Thanks, good question. Short answer: at one user it doesn't help. We measured it on an M5 Max with one server slot, the same n-gram drafting settings and prompts, toggling only GGML_METAL_TQD_EXT. Qwen3.6-35B-A3B came out at −0.9 % mean over 5 paired runs (range −7 % to +2.5 %), and Qwen3.8-Flash-Next at −1.1 % and −0.6 % over 2 pairs. That is level within run-to-run noise, and outputs were identical.

The reason is that with n-gram drafting the verify step is usually a ~65-token pass, which runs on the mat-mat path, not this kernel. Passes of 2–8 tokens were only about 0.4 % of mat-vec calls in a one-user session, so the kernel barely runs there. Our release note overstated its role in speculative verify at batch one; we've corrected it and this post. Where it pays is several users decoding at once (2–8 users, +8–24 % total decode).

For interactive use it's safe to leave on (no measurable cost, identical outputs), but don't expect lower per-token latency from it. GGML_METAL_TQD_EXT=0 turns it off if you want to A/B it yourself.

In this post