r/llamacpp • • 12d ago

Your old PS4 can now run a 9B AI, offline, on its own GPU. It talks, listens, and writes code. No cloud, no subscription, no Linux. Free and open source.

335 Upvotes

A stock PS4 has 8 GB of shared GDDR5 and a GCN GPU, but no compute API or ML library for homebrew. Garlic LLM drives the GPU directly (OpenCL C kernels for GCN, PM4 packets written by hand) and fits everything in about 4.5 GiB:

  • Most matrices in 4-bit, the MLP gate/up in 3-bit (about 3.5 bpw with scales).

  • 4-bit KV cache for a 16K context.

  • Speculative decoding with Qwen3.5’s own MTP head: 22 → 31–39 tok/s (up to 43 on code).

  • Parakeet TDT 0.6B for dictation and Chatterbox for speech on the same console (about 22 tok/s in voice mode, since TTS takes the memory MTP uses).


r/llamacpp • • 3d ago

256 ARM Cores + 1TB RAM

164 Upvotes

r/llamacpp • • Oct 01 '26

I got tired of guessing llama.cpp flags, so I built a tool that launches the model for real and measures every config — 4090 went from 60 to 80 avg tok/s on a 27B

143 Upvotes

I run a 4090 with a 27B Q4 and spent way too many afternoons changing one flag, restarting the server, generating a sentence, eyeballing it. The part that got me: almost every "optimal llama.cpp config" post online is someone's guess from a formula. Nobody boots the model and measures.

So I wrote a tuner that does the boring loop. You pick the model and the context length you actually care about, it does a coarse pass over the high-impact knobs (speculative decoding, KV cache quant, GPU offload layers) then a fine pass over batch/ubatch, and for every candidate it really starts llama.cpp, warms it up, runs 3 passes, takes the median. Configs that OOM or crash are just out, no theoretical estimate anywhere.

My numbers, same model / same quant / same context throughout:

hand-tunedtuned
peak tok/s80
avg tok/s60
100K ctx40

Long context is where it paid off most, which is the case hand-guessing is worst at — the right flags at 100K are not the right flags at 8K, and I'd been tuning against short prompts.

Biggest single win was speculative decoding, and it moved differently per hardware than I expected. KV cache quant was second. batch/ubatch mattered less than the posts online imply, though it changed once context got long.

Results get bound to (this machine, this model) so the next launch auto-loads them — that's the part I wanted most, since I run two boxes and kept re-deriving the same flags.

Open source, local-first, nothing phones home: https://github.com/htobty/ReadyLLM

Curious what the spread looks like for other people. Specifically: does speculative decoding give you the same size win on a 4090, or is that a 5090-only thing? And does anyone have data on where KV cache quant starts costing quality?


r/llamacpp • • 20d ago

DeepSeek V4.1-Flash (1017) at ~20 tok/s on a single 16 GB GPU + 64 GB RAM

82 Upvotes

DeepSeek V4.1-Flash (1017) at ~20 tok/s on a single 16 GB GPU + 64 GB RAM — work in progress, code free to use

Not finished. This is a research log with patches, not a polished engine: rough edges, some Windows-only parts, no support promises. Use the code and notes for anything you like — no credit needed.

Box: RTX 5070 Ti 16 GB in a PCIe 4.0 x16 slot, Ryzen 5 7600, 64 GB DDR5, Windows 11. Two NVMe: Gen5 2 TB (~13.5 GB/s) and Gen4 1 TB (~5 GB/s) holding a second copy of the expert files.

Model: DeepSeek-V4.1-Flash-1017, a ~375 GB build: routed experts at ~2.4 bits (~150 GiB), Engram tables 203 GB, dense part Q5_K. It doesn't fit in RAM + VRAM, so experts stream from NVMe.

Numbers with today's defaults:

decode, short context20.3 tok/s (17–20 in real agent turns at 2–27K context)
decode, fast preset23–24.7 tok/s (small measured quality cost)
decode at 256K / 512K context16–20 tok/s
reading agent turns (0.5–7.5K new tokens into a growing conversation)~418 tok/s
cold prompt 8.9K / document 256K / document 512K672 / 633 / 482 tok/s
quality0.09–0.11 nat/token behind the DeepSeek API on its own continuations (3 prompt sets; for scale, Q2 to Q4 is ~0.11); HumanEval 157/164 vs 158 for the API

On this PC with the same file: the original fork ~10 tok/s, Project Maya v1.1.21 3.9 tok/s (both measured on Oct 22).

What helped most:

  1. A three-step ladder for experts: ~23 per layer cached in VRAM, a pinned RAM tier (43–46 GiB), unbuffered NVMe reads, and a second NVMe with a copy of the expert files.

  2. Taking the CPU off the critical path: the GPU reads routing replies from pinned memory, one wake-up per token — host overhead went from ~7 ms to ~1 ms per token.

  3. Prefetching heavy experts that would come from disk, 2 layers ahead, with a cheap "lens" (layer L+2's router applied to layer L's input).

  4. A measured lossy rule: an expert in neither VRAM nor RAM with less than 14% of the routing weight is not waited for (costs at most 0.006 nat/token on our API sets).

  5. Prefill: experts in waves through a shared pool; encoder-only prefill for positions the decoder never reads (exact); DeepSeek's own YoCo truncation from DeepInfer (decoder on the last 140 prompt positions) — +13% on agent turns, +60% on a cold 8.9K prompt, within error on our API sets.

  6. Sparse attention in decode with a q8 KV cache: decode stays at 16–20 tok/s from short context to 512K.

  7. A quant mix from public GGUFs: prometheusAIR's IQ2_XS gate/up + Q2_K down, and ISTA-DASLab's lighter Q5_K dense part (3 GB less VRAM, so more expert slots).

What didn't work:

  • Reading the next layer's experts ahead during prefill: the RAM tier can't hold a prompt's working set, so read-ahead evicts what is still needed.

  • "Free" guesses in the bus's idle time: during decode there is none; each wrong staging costs ~0.2 ms.

  • A published non-uniform quant (GSQ-RCO) lost to a plain mix on our API sets, worst on Russian prompts — the calibration text matters.

Where we're stuck — ideas welcome:

  1. Predicting which experts a token needs 1–2 layers ahead. Perfect staging would give 27–29 tok/s; our lens gets 76% precision at ~14% recall.

  2. Overlapping compute with expert copies: copies take ~30 ms per token, compute ~19 ms, and they overlap by 3 ms.

  3. Short agent turns: ~5.6 s fixed cost per turn, a third of it waiting for expert loads.

  4. 1M context loads only at batch 512: the sparse prefill plan wants 11.7–15 GiB at larger batches.

Goal: long context up to 1M at a usable speed — not necessarily at the full 1M.

The bus is the wall: copying experts from RAM to the GPU over PCIe 4.0 takes ~30 ms of a ~49 ms token, which caps decode at ~32 tok/s on this box even with perfect overlap.

The CPU computes no experts: on this 6-core CPU a probe gave only +3–5%, so it was left out; it needs separate work. Project Maya's CPU expert kernels (MIT) could be a starting point.

Code: https://github.com/MasherDon/Siege-Ladder — patches over JigSawPT's llama.cpp fork, a script that assembles the weights from public Hugging Face repos (no weights redistributed), benchmark scripts and notes. Use it however you like; the patched llama.cpp files keep llama.cpp's MIT notice. Built on: JigSawPT (the V4.1 port with SSD streaming), llama.cpp / ggml, DeepSeek's DeepInfer (YoCo), Strata, Project Maya, antirez's ds4, and the prometheusAIR and ISTA-DASLab quants.


r/llamacpp • • Sep 19 '26

Qwen3.8 flash next, 27 tok/s — 32GB VRAM + 64GB RAM

79 Upvotes

I’ve been tuning Qwen3.8-Flash-Next 125B MoE on a workstation with only 32 GB VRAM + 64 GB RAM.

The result I found most interesting: in a real agent workload, decode stayed around 28 tok/s while context grew from 116K to 148K.

This is a llama.cpp fork based on upstream "9e7171624" with Qwen4Exp support plus a few local changes.

Hardware

  • Intel Core Ultra 5 225, 10 cores

  • 62 GiB DDR5-6200

  • RTX PRO 4500 Blackwell 32 GB, SM120

  • PCIe 4.0 NVMe

  • Ubuntu 24.04

  • CUDA 13.4.59

  • built for "sm_120a"

Model

Qwen3.8-Flash-Next, "UD-Q3_K_XL"

  • ~90 GB GGUF

  • 125B total / ~6B active per token

  • 48 layers

  • 512 experts, 10 routed + 1 shared

  • QSA indexer, 2048-token budget

  • additional 51B N-gram / PLE table: 26.8 GiB

  • MTP sidecar available but disabled

Placement

-dev CUDA0 -ngl all -ncmoe 32

Dense/GDN/QSA/router/shared stay on GPU.

Of the 48 routed-expert layers:

  • 16 on GPU

  • 32 on CPU

PLE is disk-backed:

-ot per_layer_token_embd=CPU --load-mode mmap --lazy-mode on

Other relevant settings:

-c 240000 -fa on -ctk f16 -ctv f16 -t 6 -tb 6 --fit on --fit-target 2048

Steady state is roughly:

  • 31.3 GiB VRAM

  • 43 GiB RSS

  • effectively no process swap on weights

Real workload numbers

19 minutes of agent traffic:

  • 35 requests

  • 23K generated tokens

  • context: 116K → 148K

Token-weighted decode:

27.9 tok/s

By context:

  • 115–125K: 27.7

  • 125–135K: 28.5

  • 135–148K: 27.5

So decode is essentially flat across another 32K of context.

Real prompt chunks prefill around 150 tok/s, peak 201.

Prefix cache hit rate is ~99%, with only ~370 new prompt tokens/request at 130K+ context.

CUDA graphs were reused 22,590 times for 23,053 generated tokens.

CPU usage is around 5.8 cores, so the CPU expert layers are doing real work.

PLE disk traffic was only 5 GB over 52 minutes, so once warm, the SSD is not the bottleneck.

What actually mattered

  1. Disk-backed PLE

The 26.8 GiB PLE table stays mmap-backed and only rows that are needed get faulted in.

Without this, the model does not fit comfortably in 64 GB RAM.

In practice the I/O cost has been surprisingly small.

2. Static hybrid expert placement

This was the biggest win.

At 8K context:

  • CPU-only: 42.6 pp / 6.3 tg

  • hybrid: 250 pp / 32.4 tg

Roughly 5.9× prefill and 5.1× decode.

3. Forced cuBLAS

GGML_CUDA_FORCE_CUBLAS=ON

The SM120 MMQ path crashes on this model with "illegal CUDA memory access".

cuBLAS is stable.

4. Sparse QSA decode

This uses block-level Top-K plus a persistent block-key cache, with "n_kv_max = top_k".

This appears to be the main reason decode does not collapse at 140K+ context.

The dense reference path can still be restored with:

LLAMA_QWEN4_SPARSE_QSA=0

5. K-only indexer cache

Upstream PR #28330 saves about 0.75 GiB VRAM at 128K.

That headroom is what lets me keep F16 KV and CUDA graphs enabled.

6. F16 KV beats Q8_0 here

At 49K prompt / 65K context:

  • F16: 496 pp / 38.1 tg

  • Q8_0: 499 pp / 33.4 tg

Q8_0 saves ~808 MiB but costs about 12% decode, so I kept F16.

7. Faster CPU expert kernels

The 32 CPU expert layers only work because the CPU path is reasonably optimized:

  • signed-VNNI Q8 "mul_mat": 1.36–1.39×

  • IQ4_NL/Q8_0 two-token expert kernel + compact routing: 1.43×

  • routing table: 20 MiB → 44 KiB

  • fused AVX2 hyperconnection ops: 3–7× per op

Things that did not work

"--lazy-mode on-direct" 1.3 tok/s decode vs 31.6 on the same build. Hard no.

Persistent GPU hot-expert cache 15.6 GiB cache gave 21.6 tok/s decode vs 31.6 with static placement.

SM120 MMQ CUDA faults. Using cuBLAS.

MTP Disabled. The draft runs on CPU and the extra PCIe/RAM traffic outweighs the speculative-token gain on this machine.

Caveats

The sparse-QSA CUDA patch is still experimental and was explicitly marked unreviewed by its author.

I have not yet done full long-context correctness testing against the dense path.

These are also real workload numbers with warm caches, not a controlled benchmark suite, and there is no quality/PPL benchmark yet.

The individual speedups above come from different configurations, so they are not additive.

Question

At this point decode is basically flat through 148K context.

The current wall is VRAM: I only have about 604 MiB free at "-c 240000".

If you had another ~1 GiB to spend on this setup, would you use it to:

  • move more expert layers from CPU → GPU, or

  • keep it as KV / CUDA-graph / longer-context headroom?

Especially interested in results from similar hybrid MoE setups where the CPU expert path is already reasonably fast.


r/llamacpp • • 20d ago

Qwen3.8-Flash-Next (local) vs Claude

71 Upvotes

I am seriously impressed and want to share my experience.

Qwen3.8-Flash-Next (local) vs Claude in Claude Code: reviewing one real commit

I ran the same code review twice on one commit in my repo https://github.com/leok7v/ChatOKF (Swift, on-device LLM chat app, about 48 files changed, +1048/-102: a module move plus a new 783-line search harness).

Setup: Qwen3.8-Flash-Next UD-Q4_K_XL (unsloth) on llama-server, ROCm, AMD Strix Halo 128 GB, 262K context, MTP draft head, driven headless by Claude Code itself (claude -p pointed at the local server, read-only tools). The comparison reviewer was Claude (Opus) in Claude Code, which reviewed blind first and then judged Qwen's review against the code. Yes, Claude judging its own competitor is a bias; every finding below was checked against the source, and the main one with a small Swift repro.

Result: Qwen produced 8 findings, all real, zero false positives. It caught 2 things Claude missed (a test harness that does not follow the app's recall path, and a markdown ingest that takes the frontmatter "---" as a description). It missed 5 that Claude found, including the most important one: a stop-word filter that compares stemmed words with an unstemmed list, so "this" and "does" leak through as search terms. It also got two details wrong (the exact fallback behavior of a failable init, and column counts off by a few). Severity calibration and the "checked and fine" section were good. It read whole files and chased module boundaries like a careful human.

Cost: 53 turns, 41 minutes, context grew to about 110K tokens. Decode was about 21 t/s at 4K context and about 14 t/s at 128K; prefill 520 t/s falling to 230 t/s. MTP gives about 1.5x up to 64K and turns into a loss past about 100K.

Gotchas:

  1. Use --lazy-mode on. Otherwise the 27 GiB n-gram embedding table loads into RAM instead of staying mmapped.

  2. unsloth's MTP heads crash llama.cpp (GGML_ASSERT in set_input_k_idxs) because the MTP layer's compress ratio is 0 in the GGUF. Fix branch: https://github.com/leok7v/llama.cpp/tree/qwen4exp/mtp-dense-no-indexer

  3. Claude Code sends a system message mid-conversation and the Qwen chat template raises on it. Override the template so it renders as a system turn.

Verdict: a trustworthy first-pass reviewer you can run privately overnight, but verify its mechanisms before acting, and don't treat it as the final word on subtle logic. One commit, one run, so treat it as an anecdote, not a benchmark.


r/llamacpp • • Oct 10 '26

Qwen3.8-Flash-Next (125B) at ~100 tok/s on an M5 Ultra Mac Studio with llama.cpp

64 Upvotes

TL;DR: M5 Ultra Mac Studio, 256 GB. Plain llama.cpp decodes Qwen3.8-Flash-Next at 57 tok/s. Turning on the model's own MTP draft head with probabilistic drafting gets ~100 tok/s. Raising the ubatch to 4096 takes prompt processing from ~1,540 to ~2,150 tok/s. The full 262K context fits with ~100 GB of GPU memory to spare. The biggest gotcha had nothing to do with llama.cpp. Another app quietly loaded a second copy of the model, and both started swapping (12 tok/s).


Setup

  • Mac Studio, M5 Ultra (80-core GPU), 256 GB unified memory, macOS 27.0

  • llama.cpp b11538 (commit 79e2e74), built from source with the Metal backend

  • Qwen3.8-Flash-Next, the new qwen4exp architecture: 125B params with ~6B active per token. It also has a 51B n-gram embedding table, but that table is only looked up per token, never multiplied.

  • Weights: ggml-org/Qwen3.8-Flash-Next-GGUF, the IQ4_NL main model (95 GiB) plus mtp-Qwen3.8-Flash-Next-Q8_0.gguf (3.9 GiB, the MTP draft head)

Results

Generation speed. I ran 4 prompts (code, an explanation, a math problem, a rewrite) at 512 tokens each, with temp 1.0, top-p 0.95, top-k 20 and fixed seeds. Nothing else was using the GPU.

Configtok/sDraft acceptance
No speculative decoding57.0–
MTP, greedy drafting, n-max 387.00.51
MTP, greedy drafting, n-max 680.60.33
MTP, probabilistic drafting, n-max 498.50.53
MTP, probabilistic drafting, n-max 5100.20.49
MTP, probabilistic drafting, n-max 694.00.42

The n-max 4 and 5 probabilistic rows are averaged over 3 seeds. On the final server config, individual prompts ranged from 84 to 133 tok/s.

Prompt processing (llama-bench, 4096-token prompt):

--ubatch-sizetok/s
512 (default)1,539
10241,914
20482,076
40962,150

What I did

1. Build llama.cpp from source

New architectures land in llama.cpp master well before the packaged builds catch up. First check that the architecture name is in the source:

git clone --depth 1 https://github.com/ggml-org/llama.cpp && cd llama.cpp
grep -n qwen4exp src/llama-arch.cpp        # no hit = your build can't load the model
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DLLAMA_BUILD_TESTS=OFF \
      -DLLAMA_BUILD_NUMBER=11538           # see the shallow-clone gotcha below
cmake --build build -j

Metal, Accelerate and -mcpu=native are on by default on macOS. On M5 chips, llama.cpp also automatically uses the matrix units inside each GPU core, through Metal 4's tensor API. Look for has tensor = true in the startup log. This is where Apple's "AI acceleration" actually comes from for LLMs.

2. Download (and verify) the weights

My connection is ~70 Mbps with ~380 ms latency, and hf download (Xet, high-performance mode) stalled. After 10 minutes nothing had been written to disk, and the 95 GiB shard was crawling at under 1 MB/s. Plain HTTPS with aria2c averaged 7.5 MiB/s and resumes after any interruption:

cd models/ggml-org-Qwen3.8-Flash-Next-GGUF
for f in Qwen3.8-Flash-Next-IQ4_NL-00001-of-00002.gguf Qwen3.8-Flash-Next-IQ4_NL-00002-of-00002.gguf mtp-Qwen3.8-Flash-Next-Q8_0.gguf; do
  aria2c -c -x 16 -s 16 -k 16M --file-allocation=none --max-tries=0 --retry-wait=5 \
    "https://huggingface.co/ggml-org/Qwen3.8-Flash-Next-GGUF/resolve/main/$f"
done
  • Verify the checksums yourself. aria2c doesn't, and mine hit a pile of 403 retries partway through. Each file's SHA-256 is the lfs.oid field in https://huggingface.co/api/models/<repo>/tree/main. Compare it against openssl dgst -sha256 file.gguf; that took 45 s for 95 GiB.

  • Keep the Mac awake. Mine sleeps after 1 minute idle. caffeinate -i -w $(pgrep -x aria2c) holds off sleep until the download exits.

3. Find out what actually limits generation speed

Run llama-server -v once and read the log:

  • One decode step is 6,931 graph nodes across only 2 graph splits, so nothing falls back to the CPU.

  • Each token reads ~5.5 GiB of weights. Most of that is the always-active attention/DeltaNet projections at Q8_0. The 10-of-512 experts are only ~1.2 GiB per token.

At 57 tok/s, that's ~17.5 ms per token and only ~335 GB/s of weight reads, far below what this GPU can stream. Decode is limited by per-step overhead, not memory bandwidth. That's exactly the situation speculative decoding fixes, because checking several drafted tokens costs about the same as producing one.

4. Turn on MTP (multi-token prediction)

Qwen3.8-Flash-Next ships a 1-layer MTP draft head, which ggml-org publishes as a separate GGUF.

--spec-type draft-mtp --model-draft mtp-Qwen3.8-Flash-Next-Q8_0.gguf \
--spec-draft-n-max 5 --spec-draft-sampling probabilistic
  • Use probabilistic drafting when you sample at temp > 0. With greedy drafting, a draft is only accepted when the sampled token happens to match the draft's top pick. Probabilistic mode verifies drafts by rejection sampling, which leaves the output distribution exactly the same as with no speculation.

  • Sweep --spec-draft-n-max for your own settings. Draft steps aren't free here: the head has its own 512-expert layer and reads the full 248K-vocab output layer every step. Too-long drafts lose (see the table).

5. Use a bigger ubatch for prompt processing

--batch-size 4096 --ubatch-size 4096 gives +40% prompt speed at 4K tokens. Check the memory cost by starting once with -v and reading the memory breakdown line.

6. Use the full context, because it's cheap

Only 12 of the 48 layers are full attention, so the 262K-token KV cache is only ~6 GiB at f16. At 262K context with MTP and ubatch 4096, GPU usage looks like this:

GPU memory useMiB
Weights97,311 (plus 27,466 for the n-gram table, kept CPU-side)
KV + indexer + recurrent state8,130
Compute buffers (main model)8,537
MTP head weights3,291
MTP head compute buffers6,056
Free (of a 228,065 MiB working set)~103,000

The model reloads in about 4 seconds once its files are in the page cache.

7. Final command

llama-server \
  --model Qwen3.8-Flash-Next-IQ4_NL-00001-of-00002.gguf \
  --spec-type draft-mtp \
  --model-draft mtp-Qwen3.8-Flash-Next-Q8_0.gguf \
  --spec-draft-n-max 5 \
  --spec-draft-sampling probabilistic \
  --gpu-layers all \
  --flash-attn on \
  --parallel 1 \
  --ctx-size 262144 \
  --batch-size 4096 --ubatch-size 4096 \
  --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0 \
  --host 127.0.0.1 --port 8080

This gives you an OpenAI-compatible API (/v1/chat/completions, /v1/responses) and the web UI at http://127.0.0.1:8080.


What didn't help

  • -bs (backend sampling): slightly slower, 84.3 vs 87.0 tok/s with greedy drafting at n-max 3.

  • --spec-draft-p-min 0.6 (stop drafting when the draft is unsure): 80.3 tok/s. My guess is that variable draft lengths keep changing the batch shape, so llama.cpp can't reuse its compiled graph.

  • Long greedy drafts: n-max 6 dropped to 80.6 tok/s.

  • Metal environment variables: concurrency and graph optimization are already on by default, and the encoder thread count is fixed.

  • The Neural Engine: llama.cpp has no ANE backend (see issue #10453). It also has less memory bandwidth than the GPU, so it can't speed up generation, and on M5 the GPU's own matrix units already do the matmul work.

  • Not tested: the Q4_0 MTP head (2.2 GB). It would make each draft step a bit cheaper, but probably at lower acceptance.

Gotchas that cost me hours

  1. Another app loaded the same model. I had Ollama installed with a 104 GB copy of this model, and an agent client kept sending it requests. That meant 230 GB of wired memory, a full swap file, and 12 tok/s. Even before it started swapping, sharing the GPU contaminated my first benchmarks: 41 tok/s "baseline" instead of 57. Before you measure anything, check ollama ps, the wired line in vm_stat, and sysctl vm.swapusage.

  2. min_p. The GGUF sets temp, top-p and top-k, but not min-p, so llama.cpp silently uses its default of 0.05. Qwen recommends 0. Pass --min-p 0 explicitly.

  3. Reasoning effort. The template defaults to xhigh, which means long thinking. --reasoning-effort medium or low gets answers out much sooner. The template only accepts xhigh|medium|low, so anything else (e.g. high) makes requests error out.

  4. A shallow clone breaks the web UI build. git clone --depth 1 makes the build number 1, so the build tries to fetch UI assets for a release b1 that doesn't exist. Set -DLLAMA_BUILD_NUMBER to the release your commit matches.

  5. Downloads: the Xet stall from step 2. On a slow, high-latency link, use aria2c.

Checklist for your own Mac

  • [ ] Latest llama.cpp from source, and the model's architecture name is in src/llama-arch.cpp

  • [ ] A 4-bit quant that fits with headroom. llama-server --list-devices shows your GPU working-set limit.

  • [ ] Checksums verified, and nothing else holding the model in memory (Ollama, LM Studio, a second server)

  • [ ] MTP on, with probabilistic drafting if temp > 0. Sweep n-max from 2 to 6.

  • [ ] --batch-size/--ubatch-size 4096 for long prompts. Confirm memory with -v.

  • [ ] Explicit sampling flags (especially --min-p) and a reasoning effort that fits the task

  • [ ] Benchmark with fixed seeds and compare token counts. Greedy-drafting MTP runs should produce exactly the same tokens as the no-MTP baseline, which makes them a clean comparison.

Less RAM? Unsloth publishes KL-divergence numbers for its quants of this model. Top-1 below means "picks the same next token as the full model":

QuantSizeTop-1
UD-IQ3_XXS82 GB85%
UD-Q3_K_XL90 GB88%
UD-IQ4_XS94 GB90%
UD-Q4_K_XL111 GB92%

Pick one whose size plus a few GB for context stays under your working-set limit. I haven't benchmarked those quants myself.

All numbers are from one machine, single user (--parallel 1), with short-to-medium contexts. Generation slows down as the context gets deep.


r/llamacpp • • 18d ago

DeepSeek V4.1 Flash on one 16 GB GPU, update: our weights are on Hugging Face, and long documents read about 2× faster

59 Upvotes

follow-up to my earlier post.

What this is. Siege-Ladder is a llama.cpp fork that runs DeepSeek V4.1 Flash 1017 on one home PC. That's a 552B MoE plus Engram, about 378 GB with ~2-bit experts. The PC: RTX 5070 Ti 16 GB, Ryzen 5 7600, 64 GB DDR5, one Gen5 NVMe. The model doesn't fit in memory, so the experts climb a ladder: VRAM → RAM → NVMe. It runs on Windows. This is research code with no support promises.

What changed:

  • Our weights are on Hugging Face: og.

    • The experts are GPTQ-quantized on our own calibration texts. The first and last four layers and the down projections get more bits. Engram stays at the official FP8.

    • Distance to the full model is 0.090 / 0.051 / 0.069 nat/token on three prompt sets. That is the extra NLL on the API's own continuations; smaller is better. HumanEval is 160/164.

    • Not the final version. Quality work continues, and better builds will replace it.

  • Long documents read about 2× faster. From 256K context, the prompt now runs layer by layer: each layer goes over the whole document before the next one. On og, 256K / 512K / 1M documents read at 1128 / 1043 / 888 tok/s. In October, the public cd build read 652 / 482 / 471.

  • Decode is about 19–21 tok/s at short context.

  • Maya, measured again on the same file: Project Maya v1.1.54 decodes 3.3 tok/s against our 18.6. On 2K / 8K / 30K prompts our engine is ×2.0 / ×1.7 / ×1.14 faster.

  • A drive surprise. The Engram files get billions of small reads. After a few weeks, their random reads on our Gen5 SSD fell from ~400K to ~40K IOPS, and the 512K document dropped to 685 tok/s. Rewriting the files restored it: 1051 tok/s.

Hardware notes:

  • A PCIe 5.0 card and slot should speed up both reading and decode with no code change. Copying experts over the bus is the biggest part of a decode token.

  • A second NVMe helps prompt reading a bit. It's optional.

  • Speed will also improve separately, by training the expert prediction.

Code, patches and measurements: https://github.com/MasherDon/Siege-Ladder


r/llamacpp • • Sep 25 '26

Qwen 3.8 27B Stops Prematurely

Post image
53 Upvotes

It seems its pretty easy to force Qwen 3.8 27B to finish prematurely with reason stop. It's just this prompt: Write a Python program that prints '<|im_end|>'. With that, Qwen stops in the reasoning step.

I'm using Llama.cpp (latest master) with Qwen 3.8 27B Q3XXS (Byteshape) and Q4KM (Unsloth).

Is there any way to avoid that without using --ignore-eos?


r/llamacpp • • Sep 18 '26

Is Qwen3.8-27B-UD-Q3_K_XL.gguf good enough for harness coding, am getting 80+ tok/s generation and 1200+ tok/s pp in llamacpp with unified memory on with 16GB VRAM (5080) as its the only quant that fits the whole model in VRAM

48 Upvotes

I am trying to get decent speeds with 27B and the best I got so far for my system (5080, 64GB DDR5, 285K) are with the UD Q3 quant (without the vision part and with MTP) using the below command; checking if anyone has actually used the Q3 quants for coding with opencode, pi, qwen-cli and getting good results.

GGML_CUDA_ENABLE_UNIFIED_MEMORY=1 llama-server --model /home/yk/AI/Models/lmstudio/models/unsloth/Qwen3.8-27B-GGUF/Q3/Qwen3.8-27B-UD-Q3_K_XL.gguf --ctx-size 160000 --flash-attn on --cache-type-k q8_0 --cache-type-v q8_0 --batch-size 2048 --ubatch-size 512 --threads 8 --threads-batch 8 --cpu-range 0-7 --cpu-range-batch 0-7 --cpu-strict 1 --cpu-strict-batch 1 --prio 0 --prio-batch 0 --load-mode none --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0 -np 1 --spec-type draft-mtp,ngram-mod --spec-draft-n-max 3 --spec-draft-p-min 0.7 --spec-draft-type-k q4_0 --spec-draft-type-v q4_0 --fit on --fit-target 128 --reasoning-effort medium


r/llamacpp • • 7d ago

I measured how easily a local 7B model reverse-engineers a binary, then built hardening that targets the LLM layer specifically

39 Upvotes

Most anti-reverse-engineering assumes a human in a disassembler. The threat I care about now is a local, unrestricted model driving those tools. So besides the classic stuff, the harness includes defenses aimed at the model: inflating the analysis surface so it burns context, decoy identifiers that mislead semantic guesses, and honeytokens that detect when a crack was AI-generated.

My own before/after is honest but small: one run, a 4-bit 7B on an 8 GB GPU. The unprotected build was cracked in 3 steps and about 1,300 tokens. The hardened one burned roughly 13x the tokens and still wasn't cracked. I'd really like people with bigger rigs to run it. It's one command: make slice-k-run MODEL=<your-model>, and it prints a scored before/after. or online modals

Most of the code was written with Claude agents under my direction. Happy to talk through any design choice.

and star it of course if u find it useful

Repo: https://github.com/seifheakal/blue-harness (AGPL-3.0)


r/llamacpp • • Sep 06 '26

CPU only, 64 GB DDR5: Qwen3.8-Flash-Next UD-Q3_K_XL

33 Upvotes

Humen (Me ;) TL;DR:

  • Optimized CPU-only llama.cpp inference for Qwen3.8-Flash-Next UD-Q3_K_XL;

  • System: Intel Core Ultra 225 with 64GB DDR5;

  • RAM pinning (N-GRAM SSD offload hard coded) + IQ4 routing boosted Prefill from 23.6 to 43.9 t/s (+86%), while AVX2 hyperconnection fusion + MTP (Draft 3) boosted Generation from 5.4 to 7.8 t/s (+44%), reaching 11.3 t/s on pi agent workloads.

LLM long story:

Hey everyone,

I’ve been experimenting with CPU-only inference for Qwen3.8-Flash-Next (UD-Q3_K_XL) with N-GRAM SSD offloading. With some iterative help from OpenAI’s GPT Astra to write and refactor low-level kernels and memory management, I managed to significantly boost both Prefill and Generation performance on a pure CPU setup.

Hardware Specs

  • CPU: Intel Core Ultra 225

  • RAM: 64 GB DDR5-6200 (4x16 GB); real speed random read ~70 GB/s

  • Storage: Fast NVMe SSD (used for N-GRAM offloading)

Key Optimizations & Benchmarks

Here is the breakdown of the changes made, why they helped, and their direct impact on inference speed:

OptimizationWhy it helpsPrefill SpeedGeneration Speed
Anonymous RAM Locking & SSD N-GRAMKeeps base model weights pinned in RAM, preventing OS paging/re-reading, while streaming N-GRAM on demand from SSD.23.61 → 38.27 t/s5.42 → 5.86 t/s
Q8-Matmul with Direct Signed-VNNIReduces instruction count and avoids unnecessary register spills.Isolated kernel 1.24–1.39× faster (no overall prefill gain in that run)5.86 → 6.09 t/s
IQ4 Expert Kernel (2 Tokens & Compact Routing)Reuses decoded weights, reduces routing overhead, and improves thread distribution across cores.35.82 → 43.89 t/s (+22.5%)No measurable change
Hyperconnection-Fusion (AVX2)Fuses Gate, Stream-Averaging, and Residual ops to reduce intermediate tensor allocation and synchronization barriers.Isolated kernel @ 512 tokens 3.18–3.65× fasterSingle token 4.19–4.52× faster (overall run boost pending final isolation)
MTP & Draft Length Reduction (5 → 3)Evaluates multiple tokens jointly. Shorter draft lengths reduce wasted compute cycles on rejected drafts.No clear prefill gain from MTPDraft 5 → 3: 6.20 → 7.78 t/s (+25.6%) Pi-Agent @ Draft 3: 11.30 t/s

Key Takeaways

  1. Prefill Bottlenecks: The biggest gains for Prefill speed came from RAM pinning (eliminating OS page faults) and IQ4 routing optimizations.

  2. Generation Bottlenecks: MTP tuned with a Draft Length of 3 yielded the highest throughput jump during token generation, reaching up to 11.30 t/s in specific agent workloads (Pi-Agent).


r/llamacpp • • 9d ago

llama.cpp v1.0 on an RTX 3090: up to 55% faster with speculative decoding

Thumbnail
homebrewserver.club
26 Upvotes

r/llamacpp • • Sep 25 '26

A llama.cpp fork with adaptive KV cache streaming: it keeps the KV cache in system RAM and streams pages to the GPU on demand, so a 27B model runs at full 256K context on a 16GB card without thrashing on Unified Memory

Post image
24 Upvotes

r/llamacpp • • Sep 23 '26

What tok/s are you getting from llama.cpp for Qwen 3.8 27B ?

22 Upvotes

Just wondering what tok/s you're getting with llama.cpp and what flags you're running with to get them?

I'm getting 50tok/s for Qwen 3.8 27b using the following:

llama.cpp Vulkan build

Q6 quant,

context: 131072

spec type: DFlash2

max drafts: 7

cache type K is Q8

cache type V is Q4

temp settings for thinking mode as specified by HF Qwen 3.8 page.

Especially looking to hear from Windows/AMD hardware users who are getting better tok/s (but Linux users welcome too, I may install UBuntu this week)

Edit:

my rig: 9070xt 16gb

R9700 ai pro 32gb

64gb ddr5 6000


r/llamacpp • • 9d ago

I noticed the 2 Hessian Refinement of MACaQ can be applied to any GGUF without any patches ... and tried it. 13% better quants

20 Upvotes

TLDR: Qwen3.8-27B UD_4_XL quant with 13.23% less KL divergence than unsloth (on my small testset, I just have a single 5090, feel free to test more). Technically it performs 4% better on my LiveCodeBench benchmark (but that would be a single data point, so it's not super-reliable). It is equally fast and using it in open-webui it "feels" better.

https://huggingface.co/christophedevriese/Qwen3.8-27B-Hessian-Refined-GGUF

I noticed from the MACaQ paper, which integrates changes proposed in Google/Deepmind papers, you can take the 3 components they use and just apply 1 and 2, and you just get >15% better KLD, 5% better performance on some benchmarks, while sacrificing absolutely nothing. Just switch the GGUF file. The numbers demonstrated here are the maximum that can be achieved in ~4 hours of optimizing on a single 5090, not the maximum that can be achieved. So it might be more than 15%, although I wouldn't necessarily hope for it.

This can be applied, without any patches to inference software, to text models, image models, even whisper ... the works. Switch GGUF file. Done/done.

The dream being that someone from unsloth looks at this and applies this to all their models (or just gives me access to a B300 machine for a day or two)

The tricks used by Huawei and a short discussion of the effect:

  1. Hessian-guided quantization choices: every layer is compressed differently, and the "damage" the compression does is measured. Then after seeing what damage is observed at a given level we find a combination of compressed layers that has the least damage while still achieving the same compression.

For users this one is totally free. No extra compute (in fact, a tiny bit less), no extra VRAM (again, 200 bytes less), no updates to llama.cpp, works literally anywhere UD_4_XL worked, just better.

2) Recovers some lost precision by another Hessian optimization changing the weights to compensate directly for accumulated errors over multiple layers based on sample data (taken from Wikipedia). I used a Google/Deepmind version of this process that had better results.

This too is totally free for users. It just changes the quant GGUF to be closer to the BF16 one. For users, just

3) random Hadamard transform + scaling: this is a trick from 3D geometry that makes all values nearly equal, and then uses an extra scaling factor to get them in optimal to better compression with quantization (yes, not technically 3D, but nD, with n=2048, but it applies in 2D and upwards). This also costs a little bit in inference performance (and requires rewriting your kernels which is quite a bit harder than I thought it was. Well, it isn't if you're ok with 20% slower inference, but you can get it down to like 0.8% with careful, days-long pondering of the problem and a lot of tries).

Also very nice, but the Google version of this one is also better, but that is not the real problem.

This transform also helps with compression (in fact it's kind of like what NVFP4 tries to do, just this is better) BUT requires an extra step at inference time (in fact requires 2 of them if you don't think through inference carefully, but you can "bake" one of the steps into the weights). This means that it requires patching llama.cpp and everywhere else you want the model to run (although thanks to how mlx works, you can make an mlx version that does not require updates to the inference software. But GGUF based inference software will require updates)


r/llamacpp • • 2d ago

llama.cpp Vulkan fork for AMD on Windows: ~60-75% faster generation than stock with Qwen3.8-27B on an RX 9070

19 Upvotes
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 • • Sep 20 '26

27b creative writing model with mtp released (gguf conversion coming, bf16 up now)

19 Upvotes

heads up for this crowd. we open sourced hemmingway-1 today, a 27b qwen3.8-27b finetune for creative writing. apache-2.0.

right now it's bf16 safetensors (54.7 gb, 12 shards) plus the mtp weights for speculative decoding. official gguf quants are next on our list, so lm studio and friends will have to wait a bit. if anyone wants to take a shot at converting the mtp layer in the meantime, that would honestly be great and we'll help.

weights: https://huggingface.co/Altworld/Hemmingway-1

eq-bench 4: 1330. it's a writing model, fiction and dialogue and texts. english first, base model level at math and code.

free hosted app while quants cook: https://hemmingway.io


r/llamacpp • • Aug 21 '26

Llama.cpp fork optimized for Volta GPUs (+40% performance in prompt processing)

15 Upvotes

Hi, I found that in the current used-GPU market, Volta GPUs can offer really good performance for the money. I personally own a V100. However, llama.cpp understandably isn't completely optimized for this older architecture anymore.

I also really like Qwen3.8 27B, but it was fairly slow on the V100, so I optimized llama.cpp for Volta and managed to get around 40% higher prompt-processing performance, mainly by changing the FlashAttention path, along with some other smaller optimizations. I used GPT-5.6 Sol as the coding model. I also fixed some cache issues and small bugs I found along the way.

The main benchmarks use 100k cached tokens + 1k new prompt tokens + 64 generated tokens:

ModelHardwareUpstream PPFork PPChangeUpstream TGFork TG
Qwen3.8 27BV100306.7433.1+41.2%23.2923.19
Qwen3.8 27BV100 + 3060 Ti317.7450.0+41.6%26.4826.65
Qwen3.5 122B A10BV100241.4280.8+16.3%21.2921.30
Qwen3.5 122B A10BV100 + 3060 Ti257.4283.5+10.2%19.8319.80
Laguna-S-2.1V100320.5312.3-2.5%23.2822.26
Laguna-S-2.1V100 + 3060 Ti319.5317.4-0.6%21.2420.81

I also tested GLM-5.2 with a shorter 10k cached + 1k new-token benchmark because building a real 100k cache was extremely slow:

HardwareMTPUpstream PPFork PPUpstream TGFork TG
V100off45.9145.944.574.78
V100on44.5144.346.236.25
V100 + 3060 Tioff46.0346.004.404.47
V100 + 3060 Tion44.6844.446.266.29

So the big improvement isn't universal; it seems mostly useful for Qwen-like model shapes, which is also what I expected from the changes.

Currently it's on my GitHub. I plan to create several smaller PRs for parts of the fork, but I don't want to rush it and overwhelm the llama.cpp developers with bad or overly large PRs.

I would love it if some of you could test it on your own hardware. It doesn't necessarily have to be Volta; I'm also interested in how it behaves on newer GPUs and other models.

https://github.com/mistrjirka/llama.cpp


r/llamacpp • • 13d ago

I tuned llama.cpp's Vulkan backend for the RX 7900 XTX: 220K context, DFlash2 that doesn't hang past 60K, 1.8-3x faster decode

Thumbnail
gallery
14 Upvotes

I've been running local LLMs on an RX 7900 XTX and wanted proper long-context performance for agentic coding (100K-200K tokens) on the Vulkan/RADV stack, so I forked llama.cpp and optimized it for RDNA3.

Repo: https://github.com/vansh-visariya/rx7900-xtx

It's the same llama.cpp (same GGUF files, same `llama-server`, same API and web UI). The changes are in the Vulkan kernels, the graph, and the speculative-decoding loop. Everything is on by default.

Results on one 7900 XTX (24 GB, stock 291 W, Mesa RADV)

Qwen3.8-27B UD-Q4_K_M + DFlash2 draft, q8_0 KV cache, flash attention:

ContextDecode (upstream, best of 2 setups)Decode (this fork)Prefill (upstream, best)Prefill (this fork)
16K48.8 t/s87.4 t/s808 t/s872 t/s
128K26.3 t/s69.1 t/s442 t/s657 t/s

- Up to 220K context on 24 GB (upstream fits ~192K with the same model + draft)

- DFlash2 works at long context. On upstream (both the commit I branched from and current master), it hits `vk::ErrorDeviceLost` once the prompt passes ~60K tokens, at the same position on every run. It doesn't on this fork.

- Full method, commands and raw numbers are in `docs/rdna3/BENCHMARKS.md`

What changed (56 commits on top of upstream)

- Decode: integer-dot mat-vecs for IQ2/IQ3/K-quants, GQA flash attention for verify batches, graph fusions, gated delta net state kept in place, Vulkan command buffers recorded once and replayed

- Prefill: 128x256 matmul tile for wide batches, double-buffered quantized matmuls, new prompt-batch flash attention kernel

- Spec decoding: lossless rejection-sampling verification, reduced-vocab draft head, GPU backend sampling"

Every optimization is documented, with the env var that switches it off, in `docs/rdna3/OPTIMIZATIONS.md`.

Limits

- Developed and tested only on a 7900 XTX. Other RDNA3 cards (7900 XT/GRE, 7800 XT, 7700 XT, 7600) should work since they share the WMMA instructions, but I haven't tested them.

- Tested with Qwen3.8-27B and Qwen3.5-4B. The model-specific work only applies to the Qwen3.5/3.8 family.

- Branches from upstream `f95b0d953`, not synced daily.

Where I'd love help

- Numbers from other RDNA3 cards (kernel tests need no model: `test-backend-ops -o MUL_MAT -b Vulkan0`)

- Testing other models/quants, and RDNA2/RDNA4 reports

- Review of the kernels, and help upstreaming pieces to llama.cpp

Build and run instructions are in the README. Issues and PRs are very welcome.


r/llamacpp • • Oct 12 '26

3060 build for Reporting

Thumbnail
gallery
13 Upvotes

Xeon v3 12 cores.
3060 zotac 12 gb white edition with better power control with two PCIe connector per card. A whopping 16 gb of memory. This will receive a twin to make it dual zotacs.

This is a ~$700 to $800 build with no GPU. Probably is about $300 to $400 with to best mb supporting ddr4, ddr5 is your voice I have two minis no offloading both have no difference in tgs. but the point, don’t offload to cpu or system memory.

I got this specific GPU because they are supposedly more stable and control heat. It’s been a power house running stock rankings that it runs out of stocks to track every 3 hours. 18k to process with 12 days of close and volume data. About 33 tgs.

I also have a dual 5060 and another dual 3060 systems. Much more analytics but impressively slow. With the Thin Stratum system I programmed it’s just a software setup, not much special on the ai server, proxy middleware and formatted with prompts to the AI server.

I suppose a good point here is multi systems are a strategy also if trying to ramp up services for clients like a steady flow of reporting on data and documents. I am not doing this for agentic coding. No way. This is RAG.


r/llamacpp • • Oct 10 '26

GLM-5.3-Flash (320B) on an M5 Ultra Mac Studio with llama.cpp: 61 tok/s, 262K context

Thumbnail
jvlewis.dev
12 Upvotes

r/llamacpp • • Sep 15 '26

I've got llamaccp running at full native speed on an e-gpu on Mac

12 Upvotes

I have a 5090 in an external enclosure I use for ai work. I chose the external to some day use on my Mac which has 128gb of ram and runs large models really well. It runs image generation pretty slow as the models aren't memory constrained on Nvidia gpu's and they are much faster than the Mac gpu. My dream was to run my 70b models on the Mac and image models on the 5090. Tiny gpu came out with drivers allowing connecting the drive but when I tried it last may it was super buggy and super slow. I decided to give it another go and it's now not super buggy but was still super slow. I decided to try and build my own drivers and shim to fix that. I am happy to say that it worked and I am now able to run Owen 3.8 27b at near native speeds as to what the box was running on my windows box. and actually faster than my windows box in sdxl and z-image turbo.

I imagine there is not much of a community for this capability but I thought I'd post it online to see if anyone even cares. I'll be posting the code on GitHub soon if people want to try it out. It is only tested on my current hardware of course as that is all I have to test it on.

I didn't realize I never came back and posted the link here you go https://github.com/Davinchy/macuda


r/llamacpp • • 2d 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

Thumbnail
homebrewserver.club
11 Upvotes

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 off makes 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 • • 10d ago

Running llama.cpp inside a VM with no GPU passthrough: 98% of native speed on an RTX 6000

11 Upvotes

VMAT is a way for virtual machines to share one GPU's compute without using passthrough or vGPU.

In the video I ran llama-bench once on the host and once inside a KVM guest, same GPU (RTX 6000), same models.

Qwen2.5 32B Q4_K_M: 41.52 tokens/s on the host, 40.73 in the VM (98%)

Qwen2.5 7B Q4_K_M: 169.50 tokens/s on the host, 166.47 in the VM (98%)

What's in the VM: VMAT's CUDA libraries, which send CUDA calls to the real GPU on the host. What it does not have is passthrough, NVIDIA drivers or a vGPU.

Happy to answer questions.

https://vmat.dev