r/llamacpp • u/This-Parking-7885 • 1h ago
r/llamacpp • u/BhatSahab • 8h ago
Inkling 2 Mini at 256k context on a single 16 GB RX 9070 XT: 55–85 tok/s with a patched llama.cpp (ROCm), ~3× upstream on chat and ~10× on long prompts
I spent the last few days getting Thinking Machines' Inkling 2 Mini (26B total / ~5B active looped MoE, 1M context) running as fast as possible on one 16 GB AMD card. Sharing the numbers and what actually mattered, because this model behaves very differently from the usual MoEs.
Hardware: RX 9070 XT 16 GB (RDNA4, gfx1201), i9-14900K, 32 GB DDR5, PCIe 5.0, Arch + ROCm. Everything stays under ~15.2 GB of VRAM including the desktop (a full card froze my session, so every test ran under a VRAM watchdog).
Software: Unsloth's llama.cpp fork plus 26 patches (24 of my own: custom HIP kernels, scheduler and launcher changes; plus two open upstream PRs, #32215 DPP warp reductions and #30685 async input copies), DSpark speculative decoding + n-gram lookup drafting, q4_0 KV cache for both the model and the drafter.
Results (greedy, 768-token coding answer; "edit" = rewrite a file; prompt = 54k tokens)
| Quant | Context | Chat | Code edit | 54k prompt | Peak VRAM |
|---|---|---|---|---|---|
| Unsloth UD-Q4_K_M | 256k | 55–57 tok/s | 120 | ~1,020 tok/s | 15.2 GB |
| Unsloth UD-Q4_K_M | 128k | 62 | 136 | 1,094 | 15.2 GB |
| GSQ-RCO IQ4_XS (abenzerps) | 256k | 67 | 136–162 | ~1,350 | 15.1 GB |
| GSQ-RCO IQ4_XS | 128k | 85 | 171 | 1,459 | 15.0 GB |
| AtomicChat IQ3_XXS | 256k | 79–83 | 180–200 | ~1,355 | 15.1 GB |
| AtomicChat IQ3_XXS | 64k (all in VRAM) | ~90 | — | 1,689 | 14.8 GB |
Where I started: Unsloth's prebuilt at 16k context did 23 tok/s, and 10.8 tok/s with DSpark (the drafter overcommitted VRAM).
Same weights against upstream llama.cpp (built today, same flags and toolchain)
| GSQ IQ4_XS | upstream master | upstream + DSpark PR #32218 | patched |
|---|---|---|---|
| 128k chat | 29.1 | 35.6 | 84.9 |
| 128k code edit | 89.6 | 88.8 | 171 |
| 128k, 54k prompt | 210 tok/s | 212 | 1,459 |
| 256k chat | 19.4 | — | 67 |
| 256k, 54k prompt | 125 tok/s | — | ~1,350 |
Kernel-only (llama-bench, no drafting): decode +17%, prompt at 32k depth 3.8×. Upstream has to drop to ubatch 64 (128k) / 32 (256k) because its Inkling attention wants a 12.9 GB buffer at ub 512.
Quant quality (wikitext-2 KLD against UD-Q4_K_M logits)
- GSQ-RCO IQ4_XS: KLD 0.015, same top token 95.1%. That's the best of the small quants: close to Q4_K_M and about 20% faster than it, so it's what I'd recommend for 16 GB.
- AtomicChat IQ3_XXS: 0.024 / 93.9%
- GSQ-RCO IQ3_XS: 0.051 / 91.0%. It hit ~100 tok/s with 256k fully in VRAM, but the quality loss was too much for me.
Things that didn't help
Vulkan (no banded attention kernels, 11–17 tok/s), F16 KV, an acceptance-driven adaptive draft length (its depth flips cost more than they save), overlapping the RAM-expert uploads with compute (needs ~0.8 GB of staging VRAM, which is worth more as expert cache), and a few upstream PRs that don't touch these quants.
Caveats
- One machine.
- Greedy benchmarks, with ±5–10% noise because the desktop shares the GPU.
- Generation at temperature 1.0 is a few tok/s lower (DSpark acceptance drops).
- DSpark for Inkling isn't in upstream master yet: PR #32218 works with Unsloth's new mainline-format drafter. Unsloth's old-format drafter only works with their fork.
I'm thinking about upstreaming the attention kernels if there's interest.
r/llamacpp • u/Public-Net-8864 • 12h ago
VMAT Free: share one NVIDIA GPU between 4 VMs for CUDA, no passthrough or vGPU license
I've been building VMAT so that I could get several VMs to share one GPU at the same time, and today the the free tier is out today for Proxmox VE 9 and Linux desktops. I'd love if a people with consumer cards I don't own to try it and dish out some honest feedback.
Up to 4 VMs share one NVIDIA card and each one runs CUDA programs as if it had the card to itself. llama.cpp and PyTorch run inside the VMs. There's no passthrough, no SR-IOV and no vGPU license, and it works on stock QEMU. When a VM is idle its GPU time goes to the busy ones, or you can give each VM a fixed share.
I've debugged & tested it on Proxmox VE 9 with a rented H100 using 4 Debian VMs at once with llama.cpp ran in all four, and PyTorch 2.11 in the VMs on the host. On earlier builds with an RTX 6000 Ada, llama.cpp in a VM ran at 90 to 98% of native speed. I also ran an RTX 5090, where CUDA and PyTorch gave the same results through VMAT as native, but that was in a container with no VM.
So nobody wastes an evening: it's Linux VMs only, with Debian and Ubuntu guests on Proxmox. Free allows 4 VMs and 16 GB of GPU memory per VM. CUDA needs an NVIDIA card, and I haven't tested GeForce cards with VMs yet, or AMD. It's one GPU per host, and there's no graphics or games in this build. It's early software and it can crash.
The host side is closed. The guest side, which is the library and tools that run in our VMs is open source (BSD)@ https://github.com/b1nc0d3x/gVMAT.git
Downloads, checksums and install steps are at vmat.dev/getting-started.html. If it breaks, please get at me and let me know what card you tried as well as what happened.
r/llamacpp • u/W61k3r • 14h ago
LexiSuite T21: Inkling-2-Mini at 135 tok/s with its draft head on one RX 7900 XTX (llama.cpp's newest build: 39), 524k context on 24 GB, and now a single USB image with the model already inside
Follow up to my earlier Inkling-2-Mini posts. Testing image 21 of LexiSuite (my own Rust stack: inference engine, control panel, bootable OS image, not a wrapper around llama.cpp or Ollama) is out, and this time there is an all-in-one download: one USB image with the OS, the engine, the panel and the Inkling-2-Mini file already in the model folder. Write it to a stick, boot, open the address on the screen, load the model.
All in one image, the plain image and the model file by itself:
https://huggingface.co/Wa1k3r/Inkling-2-Mini-NVFP4exp-Q8-draft-LexiSuite-AIO-for-AMD-RDNA
Hardware for everything below: RX 7900 XTX 24 GB, i7-9700, 32 GB RAM, Vulkan. One card, whole model on the card, nothing in system RAM. 4-bit KV cache. Single runs, greedy decoding, nothing else running on the box. All measured November 23 on the published build.
The model file is 18.3 GB. It keeps the experts exactly as Thinking Machines shipped them (their own 4-bit format), the rest is 8-bit, and the model's own draft head is packed into the same file.
BENCHMARKS, LexiEngine
4,096 token prompt
2,430 tok/s prompt, 136.4 tok/s generation with the draft head (66.5 without it)
16,384 token prompt
2,332 tok/s prompt, 134.8 tok/s generation with the draft head (65.8 without it)
261,632 token prompt (262k context)
1,193 tok/s prompt, 65.5 tok/s generation with the draft head (50.3 without it)
523,264 token prompt (524k context)
764 tok/s prompt, 48.9 tok/s generation with the draft head (40.4 without it)
By kind of text, with the draft head after a 16,384 token prompt:
JSON records 159.0 tok/s
Rust code 121.3 tok/s
English prose 94.7 tok/s
Output with the draft head was identical to plain greedy decoding in every run. It only changes speed.
LLAMA.CPP GOT A LOT FASTER, SO I MEASURED IT AGAIN
In my last post llama.cpp was at 425 tok/s prompt and 25 tok/s generation on this model (build 12600, November 20). Its newest build (commit 1f8baae), same day, same card, same weights:
4,096 token prompt: 1,233 tok/s prompt, 40.4 tok/s generation
16,384 token prompt: 1,049 tok/s prompt, 39.2 tok/s generation
That is a big jump on their side in three days and the old 4x to 5x gap is gone. At 16k LexiEngine is now 2.2x on the prompt, 1.7x in plain generation and 3.4x with the draft head. I did not run llama.cpp at 262k or 524k this time.
DOES IT ACTUALLY READ THE CONTEXT
Ten facts planted through the prompt from 1% to 99% of its length, each asked back:
at 260,864 tokens: 10 of 10
at 523,264 tokens: 10 of 10
Against a reference run of the published weights the engine scores a mean KL of 0.0037 with the same top token on 98.6% of 510 positions (4-bit KV cache).
WHAT CHANGED SINCE THE LAST IMAGE
generation with the draft head at 4k: 110.7 -> 136.4 tok/s
generation with the draft head at 16k: 109.5 -> 134.8 tok/s
the draft head now helps at 524k too (48.9 vs 40.4 plain); two images ago it was a small loss there
Also in this build: the Linux entry is 7.4-rc4 (unmodified upstream tag) beside my own kernel, the experts of the last four layers can be stored in 4 bits (2.0 GB smaller, same speed, slightly lower accuracy), and repairs to the quantization tool in the panel.
THINGS YOU SHOULD KNOW BEFORE TRUSTING ANY OF THIS
Everything is single runs on one machine, with the card capped at 291 W. If you have a 7900 XTX I would genuinely like to know if you get the same numbers.
The model file is for my engine. Stock llama.cpp, Ollama and LM Studio do not load it: their converters decode the 4-bit experts and quantize them again (27.8 GB at 8 bits, which does not fit a 24 GB card), and they do not know the draft head's tensors.
It is tuned and measured on Radeon RDNA 3. I have not measured other cards on this build.
I trained a recovery adapter for the 4-bit expert file and it did not improve held out text measurably, so no adapter is published.
Not in this build: image input for Inkling, formats below 8 bits for its attention matrices, and a 1M context on 24 GB (the cache alone would be 9.85 GB).
This is a development image, not a production release. The all-in-one image is 17.6 GB to download and 23 GB when written, so it needs a 32 GB stick. The plain image is 353 MB and fits an 8 GB stick. Writing either one erases the stick.
LINKS
All-in-one image and model file: https://huggingface.co/Wa1k3r/Inkling-2-Mini-NVFP4exp-Q8-draft-LexiSuite-AIO-for-AMD-RDNA
Base model: https://huggingface.co/thinkingmachines/Inkling-2-Mini
Download and USB instructions: https://lexipanel.com/download/
Benchmarks and method: https://github.com/W61k3r/LexiSuite-Releases/wiki/Benchmarks
How the Inkling runtime works: https://github.com/W61k3r/LexiSuite-Releases/wiki/LexiEngine-Inkling-2
Release notes: https://github.com/W61k3r/LexiSuite-Releases/wiki/Release-Notes
r/llamacpp • u/Ok_pettech • 16h ago
How to Install PyTorch with CUDA Support Step-by-Step Guide
interconnectd.comr/llamacpp • u/Distinct-Variety8793 • 1d ago
I run Qwen3-30B-A3B on an 8 GB laptop with no GPU by streaming experts from the SSD (open source, output identical to llama.cpp)
r/llamacpp • u/sammysamm77 • 1d ago
From 17 to 31 tok/s on an RTX 4060 8GB: 3-bit experts on Inkling-2-Mini (follow-up to my 25 tok/s post)
TL;DR: Inkling-2-Mini (128 experts, 8 active) on an RTX 4060 8GB now runs at 31.1 tok/s decode and 545 tok/s prefill. The stock setup gave me 17.4 and 308. My last post got to 25.5 with lossless kernel work. This step is lossy: I requantized the expert weights to 3-bit. Quality loss is small and measured below.
Setup
\- RTX 4060 8GB (PCIe 4.0 x8), i5-14400F, 32 GB DDR5-5600
\- Unsloth UD-Q4_K_M GGUF, a custom llama.cpp build with the kernel fusions from my last post
\- llama-bench: \`-ngl 99 -fa 1 -t 8 -ub 512 -b 2048\`
Results
| | prefill 512 | prefill 2048 | decode |
|---|---|---|---|
| stock (\`--n-cpu-moe 18\`) | 308 | 315 | 17.4 |
| last post (lossless) | 447 | 429 | 25.5 |
| now (3-bit experts) | 545 | 509 | 31.1 |
That's 1.8x decode and 1.8x prefill over stock. In real long coding chats through llama-server it holds 28–29 tok/s.
What I changed
- Only the expert gate_up weights went to 3-bit (Q3_K). The down projections stay 4-bit because their row size (1152) isn't a multiple of 256, which K-quants and IQ-quants need. The last 4 blocks went from q5_K/q8_0 to q3_K/iq4_nl.
- Importance matrix: I made one from about 92k tokens of llama.cpp source code (C++, CUDA, Python, Markdown). It doesn't overlap the text I used to measure quality.
- File size: 15.8 GB down to 12.8 GB.
Placement: the smaller experts freed enough VRAM to keep the experts of two more looped blocks on the GPU (blocks 6–15 instead of 6–13). This model runs blocks 6–17 three times per token, so every looped block moved off the CPU saves three expert reads per token. That's where most of the gain comes from:
\`-ot "blk\\.(0|1|2|3|4|5|16|17|18|19|20|21|22|23)\\.ffn_(gate_up|down)_exps=CPU"\`
- VRAM peak: 7.3 GB at 8k context.
Quality, compared with the Q4 model it came from
\- KL divergence: 0.011 at 512 context, 0.008 at 2048
\- Same top token: 97.7% / 98.0%
\- Perplexity: +0.2–0.3%, about the size of the measurement noise
\- My 8-task Python test with hidden unit tests: 8/8, same as Q4. It's only a smoke test: one try per task at temperature 1.0, and it used about 9% more tokens.
So it's not lossless, but it's close.
What didn't help
\- IQ3_S on the GPU blocks: not faster, slightly worse quality, and it missed one coding task by running out of tokens.
\- IQ3 types on the CPU: 1.4–2.5x slower than Q3_K for this matrix shape, so Q3_K is the only 3-bit type that's fast on both CPU and GPU.
\- Turning the down projections to 3-bit: no 3-bit format in llama.cpp supports their 1152-wide rows. That would need a new 3-bit format, or pruning experts.
Recipe
\`llama-quantize --allow-requantize --imatrix imatrix.gguf --tensor-type-file types.txt Inkling-2-Mini-UD-Q4_K_M.gguf out.gguf Q3_K 8\`
\`types.txt\` pins every tensor to its current type, except the expert tensors listed above. It takes about 3 minutes on this CPU.
Where it stands on this box: prefill is limited by PCIe x8, because the CPU-side experts get re-uploaded to the GPU on every batch. Decode is limited by dual-channel DDR5 bandwidth for the experts that stay on the CPU. The next big step would be pruning experts for coding-only use, which I haven't tried yet.
Profiling, kernels, quantization and benchmarks done together with Claude Opus 5.5 (Claude Code). I ran everything on my machine.
r/llamacpp • u/CarGold87 • 1d ago
Inkling-2-Mini at the full 1M context on one RX 7900 XTX (Windows, ROCm): 9/9 retrieval, 37 min prefill, ~10 tok/s decode, and how it compares to llama.cpp
r/llamacpp • u/DutchOfBurdock • 1d ago
Hexagon NPU detection and working for llama.cpp natively in Termux.
Android using a Snapdragon 8, Gen 3. Got the Hexagon NPU enabled. OpenCL to boot, even added OpenBLAS as well as pure CPU.
The OP details how to get llama.cpp binary buiilt for Termux. There is a notable difference on prompt generation, reply generation varies on the model used.
r/llamacpp • u/Aibender100 • 1d ago
Qwen3.8-27B scored 489/500 (97.8%) on MATH-500 on my 32GB RK3588S NanoPi M6 — custom ANR W6 runtime, single-pass greedy, 14 days
reddit.comr/llamacpp • u/reqqddit • 1d ago
My custom 4-bit quantization method from scratch
I have been developing and benchmarking a custom 4-bit non-uniform weight quantization format(phi-lattice v2: 15-level golden-ratio codebook, uint8 nibble packing, fp16 per-group scales at group_size=64) across dense LLMs, an MoE model, and an embedding model. All checkpoints, standalone PyTorch/Triton loaders, and raw lm-eval JSONs are public on Hugging Face.
Below is a factual summary of what worked, what regressed, and where the current implementation still lags behind native runtimes.
1. Same-engine comparison vs llama.cpp Q4_K_M (Qwen3-4B-Instruct-2507)
To remove cross-engine variance, Q4_K_M (unsloth GGUF, 2,382 MiB) was dequantized to bf16 via the transformers GGUF loader and evaluated with the exact same lm-eval HFLM pipeline (batch_size=8, CUDA L4) as BF16, data-free v2, and v2-gecko (block-64 calibrated Hessian pass, 198 s quantization time on L4, 12.52% exact zeros):
| Task | Metric | BF16 Base | v2 (data-free) | v2-gecko | Q4_K_M (llama.cpp) |
|---|---|---|---|---|---|
| MMLU (14,042) | acc (group) | 70.63% | 68.06% | 69.02% | 69.40% |
| GSM8K (1,319) | strict-match | 85.90% | 83.93% | 85.06% | 84.84% |
| GSM8K (1,319) | flexible-extract | 83.85% | 17.59% | 21.83% | 21.08% |
| HellaSwag (10,042) | acc_norm | 69.05% | 67.19% | 67.36% | 68.39% |
| IFEval (541) | prompt_strict | 57.86% | 45.47% | 46.95% | — |
Observations:
v2-geckovsQ4_K_Mis a statistical tie across all measured tasks (every gap <= 1.6 sigma). Both improve over data-freev2on every metric.- The
GSM8K flexible-extractdrop (83.85% -> 17.6–21.8%) occurs identically inQ4_K_Mand bothphi-latticevariants, indicating a 4-bit quantization artifact on this model rather than a codebook-specific issue.
2. Negative result on embedding models (why calibration hurt retrieval)
Applying the same calibrated block-Hessian pass (v2-gecko) to google/embeddinggemma-2 produced a split result:
- STS-B test (similarity, 768d): improved slightly (
0.8670 -> 0.8681). - SciFact nDCG@10 (retrieval, 768d): regressed (
0.8398 -> 0.8316), even with mixed STS + SciFact calibration prompts.
Because retrieval degraded, v2-gecko was not promoted for embedding models.
3. Two-stream residual ("cashback") — data-free recovery to BF16 parity
Instead of calibration, storing the exact first-pass quantization error R = W_bf16 - W_v2 as a second 4-bit nibble stream (W = unpack(stream1) + unpack(stream2), same codebook, data-free) raises weight SQNR from ~19.5 dB to ~39.2 dB at ~8.5 bpw effective.
Scope note: full-model two-stream cashback (all quantized linear layers) has only been built and fully evaluated on the Gemma models (gemma-3-270m-it and embeddinggemma-2). On Qwen3-4B, cashback was applied only to the token embeddings (the 252 linear layers remain single-stream v2-gecko), and only MMLU and HellaSwag were re-run on that archive (GSM8K and IFEval were not re-evaluated).
A. Full-model two-stream (gemma-3-270m-it and embeddinggemma-2)
At 270M, single-stream 4-bit quantization causes heavy degradation. Comparing v2, Q4_K_M, and full v2 + cashback (421.9 MiB, all 126 linear layers) on unsloth/gemma-3-270m-it (same L4 lm-eval engine):
| Checkpoint | SQNR | 6-text PPL | HellaSwag acc_norm | MMLU | GSM8K strict | IFEval prompt_strict |
|---|---|---|---|---|---|---|
| BF16 reference | — | 90.82 | 39.29% | 25.08% | 2.43% | 24.21% |
v2 (1-stream, ~4.5 bpw) | 19.48 dB | 161.27 | 37.93% | 25.94% | 0.61% | 17.74% |
Q4_K_M (~4.5 bpw) | 26.80 dB | 99.30 | 39.12% | 24.88% | 1.36% | 17.56% |
v2 + cashback (~8.5 bpw) | 39.17 dB | 90.59 | 39.31% | 24.93% | 2.20% | 23.11% |
Note: Q4_K_M (~4.5 bpw) and v2 + cashback (~8.5 bpw) sit in different size tiers; the point of the comparison is verifying that the data-free residual stream closes the quantization gap to BF16 parity. The same holds for full-model two-stream embeddinggemma-2 (217 text-tower layers, 659.5 MiB, 39.21 dB SQNR): STS-768 0.8745 vs BF16 0.8743, SciFact nDCG@10 0.8552 vs BF16 0.8569.
B. Embeddings-only cashback (Qwen3-4B-Instruct-2507)
Keeping all 252 v2-gecko linear layers byte-identical and applying two-stream cashback only to the 741.9 MiB BF16 embed_tokens (tied with lm_head):
| Embedding config | Embed size | Archive size | SQNR vs BF16 | 6-text PPL | MMLU | HellaSwag acc_norm |
|---|---|---|---|---|---|---|
| BF16 (original gecko) | 741.9 MiB | 2,583.2 MiB | — | 7.395 | 69.02% +/- 0.36 | 67.36% |
| 1-stream 4-bit (no residual) | 197.1 MiB | 2,038.4 MiB | 19.68 dB | 7.712 (degraded) | — | — |
| 2-stream cashback embeds | 394.1 MiB | 2,235.5 MiB | 39.28 dB | 7.370 | 68.92% +/- 0.37 | 67.39% |
A single 4-bit stream on embeddings measurably degrades perplexity; adding the residual stream eliminates the penalty on the measured tasks (MMLU and HellaSwag tie within 1 stderr; GSM8K/IFEval not re-run) and reduces total archive size by 348 MiB (below the 2,382 MiB Q4_K_M GGUF).
4. Scaling to 35B MoE (Qwen3.6-35B-A3B)
Packing all 80 3D routed expert banks (32.21B weights) + 2D projections (1.72B weights) in 4-bit phi-lattice v2 (keeping routers, norms, and embeddings in BF16/FP32) reduces Qwen3.6-35B-A3B from 65.39 GiB BF16 to 18.98 GiB resident (19.33 GiB peak during 512-token generation on a single 24 GB NVIDIA L4), with 19.63 dB SQNR and 13.11% exact zeros. Only the 8 active experts per token are dequantized during forward.
5. Current limitations (measured on L4)
- Decode throughput lags
llama.cpp**:** onQwen3-4B(tg128, greedy), nativellama-benchQ4_K_M reaches 85.02 tok/s (2,990 MiB VRAM). Our PyTorchunrolled_bf16mode runs at 23.76 tok/s (8,254 MiB VRAM), eagerlow_vram_4bitat 1.65 tok/s (3,516 MiB VRAM), and our initial Triton LUT-GEMM kernel (phi_lut_gemm.py) at ~16.2 tok/s (136.8 GB/s). Prefill (pp512) is within 7% (4,920vs5,288 tok/s). The decode bottleneck is kernel/loader engineering rather than archive byte count. - Resident VRAM of cashback embeddings: in
low_vram_4bit, cashback embeddings save 348 MiB on disk/download, but are currently unpacked into BF16nn.Embeddingat load time (~2.58 GiB resident). - Runtime support: PyTorch/Triton loaders only; no GGUF/llama.cpp integration.
Links (archives, loaders, raw eval JSONs)
- Qwen3-4B
v2-gecko(+ cashback embeddings default): https://huggingface.co/ununununununununununununununununununun/qwen3-4b-instruct-2507-phi-lattice-v2-gecko - Qwen3-4B
Q4_K_Msame-engine benchmark & perf JSONs: https://huggingface.co/ununununununununununununununununununun/qwen3-4b-instruct-2507-q4km-bench - Gemma-3-270M
v2 + cashback(with Q4_K_M comparison): https://huggingface.co/ununununununununununununununununununun/gemma-3-270m-it-phi-lattice-v2-cashback - EmbeddingGemma-2
v2 + cashback: https://huggingface.co/ununununununununununununununununununun/embeddinggemma-2-phi-lattice-v2-cashback - Qwen3.6-35B-A3B
v2(24 GB GPU MoE): https://huggingface.co/ununununununununununununununununununun/qwen3.6-35b-a3b-phi-lattice-v2 - Qwen2.5-Coder-7B
v2: https://huggingface.co/ununununununununununununununununununun/qwen2.5-coder-7b-instruct-phi-lattice-v2
Feedback on the evaluation methodology or Triton GEMV kernel optimization for 4-bit LUT dequantization is welcome.
r/llamacpp • u/yoyoRiina • 1d ago
I built a custom Metal inference engine for Inkling 2 Mini on Apple M1/M2/M3 (284 t/s prefill @ 100k, 41.6 t/s decode, 18.6 GiB @ 256k) — open source + benchmarks
r/llamacpp • u/Filters83to • 2d ago
llama.cpp Vulkan fork for AMD on Windows: ~60-75% faster generation than stock with Qwen3.8-27B on an RX 9070
I've been tuning a llama.cpp Vulkan fork (based on vansh-visariya/rx7900-xtx) for AMD cards on the Windows proprietary driver. After a lot of testing on my machine, this is where it stands today.
**System**
- GPU: RX 9070 16 GB (RDNA4), core/memory overclocked, Adrenalin 26.10.1
- CPU/RAM: Ryzen 7 5800X, 32 GB
- OS: Windows 11
- Model: Qwen3.8-27B Unsloth Dynamic v3.1 UD-Q2_K_XL
- Draft: DFlash2 Q4_K_M (incoai/Qwen3.8-27B-DFlash2-GGUF)
- 112K context, q4_0 KV cache, flash attention, everything on GPU (peak ~14.4 GB VRAM)
**Results** (generation t/s at short prompt / ~32K / ~64K context, prompt processing t/s at 32K / 64K)
| Build | Generation | Prompt processing |
|---|---|---|
| Stock llama.cpp b12602, no draft | 35.3 / 33.7 / 30.7 | 774 / 515 |
| Stock llama.cpp b12602 + MTP (1 token) | 49.7 / 47.0 / 45.2 | 750 / 483 |
| Stock llama.cpp b12602 + DFlash2 | 31.9 / 42.0 / 31.7 | – |
| **This fork + DFlash2 (3 tokens)** | **77.9 / 77.6 / 80.5** | **807 / 521** |
So about +55-75% generation over the best stock setup, with prompt processing on par. Speculative decoding numbers move ±10% between runs depending on how many draft tokens get accepted.
**What makes the difference on this driver**
- Fixes for driver compiler crashes in the flash attention shaders (the same bug upstream hit and worked around by disabling the shader).
- A q4_0 KV path in the GQA attention shader.
- The draft verify attention now reads the KV cache once per 2 draft tokens instead of once per token. The Windows driver only gives 32 KB of shared memory per workgroup (Linux gives 64), so the packed path was silently skipped. This is what keeps speed up at long context.
- The mat-vec shader no longer spills registers with 6 columns.
Only tested on my RX 9070. It should also run on RX 7000 (RDNA3) on Windows, but that's untested. Reports from other cards are very welcome.
Prebuilt llama-server for Windows, launch example and details: https://github.com/Filters83/rx7900-xtx/releases/tag/win-vulkan-ae8bdc9
Source: branch `windows-amd-proprietary` on the same repo.
Disclosure: debugging and patches were done with the help of an AI coding assistant (Claude); all tests and benchmarks were run on my machine.
Hope can help ;)r/llamacpp • u/tensward • 2d ago
2 rows per block in llama.cpp's CUDA mat-vec: 3–18% faster token generation on H100,identical output. Looking for RTX 4090/5090 testers
r/llamacpp • u/rsvikas • 2d ago
Llama Launcher for 16GB Windows laptops - tested presets + Auto NGL
I built this for my ThinkBook with 16GB RAM and Radeon 780M.
It launches llama-server with 18 LLM model presets that I've tested myself, with official sampling settings from model publishers. It also automatically tunes NGL on the first run, so you don't have to guess or experiment with GPU layer settings.
Works on Intel iGPU too.
Video demo: https://youtu.be/HWK1HUrWzf0
GitHub: https://github.com/rsvikas/llama-launcher
The README has the complete model list, screenshots, setup instructions, and details on adding your own models.
I'm interested in your feedback:
- What model would you like me to add next?
- Have you encountered any compatibility issues?
- Any suggestions for improving the launcher?
Happy to fix bugs and add more presets based on community feedback.
r/llamacpp • u/W61k3r • 2d ago
Inkling-2-Mini on one RX 7900 XTX: 80 tok/s with its draft head (llama.cpp: 25), 2,148 tok/s prompt, and a 524k context at 767 tok/s prompt with 10/10 needle retrieval. Benchmarks inside (my own Rust engine, LexiSuite)
r/llamacpp • u/BringinItDirty • 2d ago
I built kvdiff (MIT): 100% local proxy to debug llama.cpp / vLLM KV-cache prefix misses byte-by-byte
Full disclosure: I am the author (https://github.com/flipcyde101/kvdiff).
When running local coding agents or multi-turn workflows against llama.cpp (llama-server) or vLLM, nothing kills tok/s faster than accidentally busting KV-cache prefix reuse and forcing a full prompt re-eval on a 32k context. Usually it is something invisible in the client's serialized JSON: an MCP client reordering tools[], a volatile timestamp creeping into the system prompt, or a subtly mutated tool schema.
I built kvdiff to sit locally in front of llama-server or vLLM (as well as Anthropic, OpenAI, and Gemini) and show the exact zero-based UTF-8 byte and JSONPath where two consecutive turns diverged:
- 100% local, zero cloud, zero telemetry: binds strictly to
127.0.0.1, stores traces in~/.kvdiff/kvdiff.dbvia Node 24's built-innode:sqlite(zero native addons, 63 kB package). - Reads
llama.cpptimings.cache_nnatively alongside OpenAI-compatible usage fields, computing the exact byte-level Longest Common Prefix (LCP) and mapping the first mismatched byte to its JSONPath (e.g.$.tools[9].name). - Zero-buffering SSE passthrough: chunks flush downstream immediately so streaming latency is not degraded; default mode sends exact unmodified bytes upstream.
- Opt-in
--heal: canonicalizestools[]order and tool-schema object keys so flaky MCP clients stop forcing full prompt reprocessing, without ever touchingmessages[],content[], orenum[].
You can inspect the pre-seeded demo waterfall without hooking up a server via npx @drod915/kvdiff --demo. Requires Node >= 24. Would love feedback on any llama-server, vLLM, or sglang response fields or slot-caching edge cases I should add next.
r/llamacpp • u/PhysicsDisastrous462 • 2d ago
Hierarchos-Native v0.2.5 is finally out! P3 WMMA update
so, after quite a bit of work since the v0.2.0 release, i've finally managed to get v0.2.5 published!
for anyone who followed the previous release, v0.2.0 was where i first introduced the opt-in RDNA3 WMMA implementation. since then i've been working on improving the Full FP16 path, specifically its numerical accuracy and performance, without having to sacrifice the execution structure that was already working.
the biggest change in this release is something i've been calling P3.
previously, the Full FP16 WMMA kernel merged its eight accumulator-bank partials using multiple intermediate FP16 additions. this meant that the result was rounded to FP16 several times along the way. P3 changes that final merge so all eight partials are summed in FP32, with just one final rounding to FP16.
the actual two-wave workgroup structure, K-slice stream, bank assignment, staging, cooperative multiplication and barriers are all preserved. i wanted to improve the accuracy of the final result without having to redesign the kernel all over again.
some of the results from the new qualification:
- 37/37 numerical gates passed across all eight qualification seeds.
- 32/32 preserved K=96 outputs were bit-identical to the previously qualified P3 GPU results.
- REF64F16 maximum error improved from
0.03035259to0.02593803. - 31 of 32 cases improved, with zero cases getting worse.
- The maximum tile16 distance is
0.03125, meeting the existing hard numerical limit.
i also ran another full performance sweep. this time using 24 paired measurement blocks per workload, GPU timestamps, and corrected 95% confidence intervals.
the measured improvements against the preserved Main kernel baseline were:
2048×768×2048— 1.0243×512×2048×768— 1.1246×512×768×768— 1.1163×128×8192×768— 1.2722×
all four protected workloads passed independently, including the lower bounds of their confidence intervals. the largest measured improvement was around 27%.
just to clarify, these are per-dispatch GPU GEMM measurements, not end-to-end training speedups. i don't want to imply that an entire training run is suddenly 27% faster when that isn't what was measured.
there were some other changes too.
i tightened up the production dispatch admission so the profitability predicate is checked against each actual batch, rather than relying only on the maximum batch size supplied when creating the projection. the existing 16,000,000 MAC profitability floor has not changed.
i also went through the actual portable binaries and verified that they dispatch the P3 kernel when an eligible workload is supplied. the packaged trainer produced 8 cooperative P3 dispatches, and the packaged logits executable produced another 3. disabling WMMA resulted in zero cooperative dispatches, as expected.
the numerical comparison for the packaged logits test covered 262,144 finite elements, with a maximum absolute difference of 0.000738330 and RMS difference of 0.000122237.
the new release is available as a portable Windows x64 package too.
i've included seven executables, and the package was built with a statically linked MSVC runtime. there's no need to install Rust, Cargo, Python, PyTorch, Visual Studio, or the MSVC redistributable just to run it.
you will still need a compatible Vulkan-capable GPU driver and the Vulkan runtime loader. model weights aren't included.
one thing i want to make clear is that WMMA is still opt-in globally. the default is still off, and you have to explicitly select full-fp16 to use the P3 path. P3 is simply the default implementation within that mode. the Mixed precision path is separate and hasn't been replaced.
the hardware qualification was performed on my AMD Radeon Graphics adapter, PCI ID 1002:15bf (RDNA3 / Phoenix). i haven't qualified this on every RDNA3 GPU, RDNA3.5, RDNA4, Intel or NVIDIA hardware, so please don't assume universal compatibility.
there are still things i haven't been able to test, including independent clean-machine/second-device acceptance, GUI interaction, Windows 10 acceptance, and code signing. the executables are currently unsigned.
anyway, i'm really happy to finally have this one out. v0.2.0 was the first public release of the WMMA implementation, and v0.2.5 is a pretty substantial improvement to that foundation. a lot of time went into checking that the numerical improvements were real, that the performance was actually measurable, and that the distributed binaries were doing what they were supposed to do.
Release: https://github.com/necat101/Hierarchos-Native/releases/tag/v0.2.5
Source: https://github.com/necat101/Hierarchos-Native
thank you to everyone who's been following the project, testing things, reporting issues, or just keeping an eye on development. it genuinely means a lot! thank you so much everyone!! :3 also, sorry for the AI posts lately, I've been trying to save as much time as possible to work on the project itself due to live events getting tough! this one is completely human written! :3
r/llamacpp • u/thevikeffect • 2d ago
Qwen 3.8 Flash Next 177B runs on a 16GB GPU + 32GB RAM: built a full website from one prompt (10/10), real numbers inside
galleryI wanted to see if Qwen 3.8 Flash Next 177B could run on normal gaming hardware. Setup: RTX 4080 SUPER 16 GB, 32 GB DDR5, Windows 11. Model: ISTA-DASLab IQ3_XXS quant (75.8 GB), plain llama.cpp + OpenCode, fully offline.
It works because it's MoE: only 10 of 512 experts are active per token, so llama.cpp keeps the hot layers on the GPU and streams the cold experts from the SSD (mmap).
Speed:
--cpu-moe: 11.2 tok/s-ncmoe 42: 15.2 tok/s (+36%), 13.2 GB VRAM- Over a 2.5-hour coding run: 18.2 tok/s average, 22.6 best. RAM 31.4/31.6 GB the whole time, 0 crashes.
Quality: from ONE prompt it built a complete website (SVG animation, sticky nav, 3D tilt cards, counters, form validation, no libraries) and scored 10/10 on my checklist.
The funny part: when I asked it to "check its own work", it broke one animation and then said "nothing broken" twice. It reads the code but never sees the page.
Honestly, this model is impressive for something running on a home PC. Has anyone tried it with 64 GB RAM? I'd love to know how much faster it gets.
r/llamacpp • u/Business-Feedback635 • 3d ago
Qwen3.8-27B using llama.cpp vs Ollama, LM Studio and vLLM on one 3090 : fastest for one person and starts in 4 seconds, but it can fail a whole batch of long questions
I ran the same model (Qwen3.8-27B) on one RTX 3090 in llama.cpp v1.0, Ollama, LM Studio and vLLM, and sent each the same questions.
Where llama.cpp was best
- Fastest for one person, once you turn on MTP. Slightly ahead of LM Studio.
- It holds the most text.
- Starts in 4 seconds.
- Close behind vLLM for many users when set to handle 32 questions at a time (
-np 32).
Where llama.cpp was worst
- It can fail a whole batch. With
-np 32, all 32 questions share one pool of room for text. Eight long questions at once didn't fit, and llama.cpp failed all eight instead of making some wait. Ollama and vLLM made them wait. llama.cpp's default settings handled them fine. - Too-big settings can quietly slow it down. Asked for more room than the card had, it moved part of the model to the CPU without an error and got almost 4 times slower.
-ngl all --fit offmakes it refuse to start instead. - The speed trick is off by default. You have to turn on MTP yourself. LM Studio does it for you.
Tip: with -np 32, set -c for all the questions you expect at once, not for one.
r/llamacpp • u/Top-Eye-8104 • 3d ago
we made a gguf quant ladder for inkling 2 mini from 27.74 gb down to 6.88 gb