r/llamacpp • u/Standard_Alloy • 19m ago
r/llamacpp • u/Alone_Conflict4103 • 41m ago
I tried xe-serve, a native Level Zero engine for Intel Arc, on my B70 home server. Here's how it compares to llama.cpp SYCL
r/llamacpp • u/nsacon • 7h ago
Running Qwen4-35B-A3B on an AMD Strix Halo with llama.cpp
r/llamacpp • u/Distinct-Pie2389 • 7h ago
0.02690, 93.33% (UD-Q6_K_XL); 0.06587, 89.72% (UD-IQ4_XS), against our own BF16 base (Qwen4-35B-A3B)
I measured yesterday 12/04 and today 12/05
BF16 base built with llama-perplexity --kl-divergence-base from Unsloth's BF16 GGUF (wikitext-2, 100 chunks of 512, base PPL 7.5364, sha256 ca42cdb0a114c9192e6f854279725ed74be09ea43d91fbdcf082574b2d70f641)
I haven’t measured UD-Q8_K_XL. I saw earlier someone had worse results with Q8 XL vs Q8_0
Any experience from Q8_K_XL vs Q8_0 before I start this next run?
Reference: unsloth docs
Everything is in the repo as well - Halocline
r/llamacpp • u/bhones • 14h ago
14 drop-in ROCm/HIP patches for llama.cpp on AMD RDNA 2 (RX 6900 XT / gfx1030): Wave32 FlashAttention, v_dot8_u32_u4, Qwen3.5 fusions, and benchmarks vs. Mesa RADV
My main local GPU is a consumer 16 GiB Radeon RX 6900 XT (gfx1030, Navi 21). Until now I kept most AMD routes on Mesa RADV (Vulkan0) because stock upstream llama.cpp (ee46715 on ROCm 7.2) lost to RADV on 18 out of 18 single-token decode (tg128) tests by -6% to -14%.
When I audited libggml-hip.so and ran rocprofv3 traces, five big bottlenecks popped out:
- Upstream routed RDNA 2 MMVQ onto a single-warp fallback (
nwarps = 1), capping Wave32 residency at16/32waves per CU. 3,470of7,632compiled HSACO kernels (45.5%) were spilling to private scratch (273in FlashAttention and1,299in MMQ/MMQ-few alone).- Small-batch quantized-KV FlashAttention (
B = 1..8) was converting KV tiles through FP16 staging buffers, thrashing Infinity Cache. nsm = 40(WGPs) instead of80physical CUs left40–80%of CUs idle aroundpp=64.- Unfused
Qwen3.5hybridGated-DeltaNet/SSM_CONVops and standalonequantize_q8_1launches burned31%of wall time in AQL dispatch gaps.
What's in the Patch Stack (14 atomic MIT patches, ggml/src/ggml-cuda/ only)
Everything is strictly gated to RDNA 2 (gfx1030, zero core/model/server edits, non-RDNA2 HIP/CUDA/Vulkan/CPU untouched):
- Multi-warp Wave32 MMVQ & DPP: Decoupled
MMVQ_PARAMETERS_RDNA2(2–4 warps) + native Wave32v_permlanex16_b32/v_pk_max_f16. - Zero-scratch Wave32
flash_attn_ext_rdna2: Eliminated all273/273FA spills; stages rawQ8_0/Q4_0/Q4_1/F16KV directly in LDS (0 BFP16 staging) and uses losslessv_dot8_u32_u4forQ4_0/Q4_1KV (-32.2%FA active time vsq8_0atd=16384). - Zero-spill MMQ + bit-parallel IQ + 80-CU guard: Eliminated all
1,299MMQ/MMQ-few spills, addedv_xad_u32+v_perm_b32IQ2/IQ3sign unpackers (helpful for fitting27B+16Kctx inside16 GiB), and keptJ=32whenJ=64would under-fill80CUs. Qwen3.5GDN/SSM fusions + inlineQ8_1epilogues: Thinmmvfrouting (pp=16..64+10.1%..+34.7%), fusedGDNgate/beta +SSM_CONV -> SiLU -> Q/K L2 norm, and inlineQ8_1quantization insideRMSNorm/GLU(-75.2%decodequantize_q8_1dispatches,-34.6%AQL gaps,-309to-752 MiBpeak server VRAM).
Selected Benchmarks (RX 6900 XT, ROCm 7.2, llama-bench -r 3 -fa 1)
Format: Stock HIP -> Patched HIP (vs Stock HIP | vs Mesa RADV)
| Workload | KV | 9B UD-Q4_K_XL | 9B UD-IQ3_XXS | 27B UD-IQ3_XXS |
|---|---|---|---|---|
tg=128 (d=0) | q8_0 | 65.92 -> 70.25 (+6.6% | 0.962x) | 83.91 -> 94.11 (+12.2% | 0.982x) | 30.69 -> 32.81 (+6.9% | 0.982x) |
tg=128 (d=16384) | q4_0 | 62.99 -> 68.05 (+8.0% | 1.006x) | 80.51 -> 88.77 (+10.2% | 1.019x) | 29.16 -> 30.81 (+5.7% | 0.993x) |
pp=4 (d=8192) | q8_0 | 192.10 -> 229.13 (+19.3% | 1.684x) | 220.06 -> 281.68 (+28.0% | 2.147x) | 78.75 -> 104.92 (+33.2% | 1.596x) |
pp=8 (d=8192) | q8_0 | 283.26 -> 347.39 (+22.6% | 1.824x) | 310.91 -> 459.77 (+47.9% | 2.227x) | 105.65 -> 161.14 (+52.5% | 1.795x) |
pp=8 (d=16384) | q4_0 | 270.75 -> 340.85 (+25.9% | 1.511x) | 305.74 -> 442.56 (+44.8% | 2.177x) | 101.62 -> 152.38 (+49.9% | 1.788x) |
pp=512 (d=0) | q8_0 | 1634.35 -> 1656.87 (+1.4% | 1.031x) | 1951.65 -> 2004.62 (+2.7% | 1.401x) | 585.44 -> 604.19 (+3.2% | 1.427x) |
On single-request llama-server (draft-mtp, cache_prompt: false):
27B UD-IQ3_XXS(n=3,short_temp0770/256):43.71 -> 56.92 tg tok/s(1.302xvs stock HIP,1.276xvs RADV; wall6.03s -> 4.67s,+29.0%).27B UD-IQ3_XXS(n=3,ctx4k_greedy6,775/192):44.25 -> 55.56 tg tok/s(1.256xvs stock HIP; wall16.92s -> 15.62svs RADV21.57s,1.38xfaster than RADV).9B UD-IQ3_XXS(n=2,ctx4k_greedy6,775/192):105.70 -> 123.66 tg tok/s(1.170xvs stock HIP; wall5.78s -> 5.36svs RADV7.17s).
Honest Caveats & What Didn't Work
- Failed ablations kept out: Non-temporal
MALLweight loads (-10%to-22%decode),Gate+Upfusion aboveB = 1(-30%to-37%pp=8), andv_dot8inside MMVQ/MMQ (-13%to-17.5%pp=16..32becausev_dot8shares the same 1 op/cycle SIMD32 rate asv_dot4on RDNA 2 and only wins whenO(1)prologue packing amortizes over long KV tiles). - Greedy divergence (
DIFF!):test-backend-ops(7/7) passed 100% and 6-chunk WikiText-2 KLD hitMean KLD = 0.000000, but multi-warp reduction reordering still nudges borderline greedy tokens and can swing draft acceptance on individual single-shot runs (one9B IQ3_XXSshort greedy row dipped to0.984x tgon a-10.6pp acceptance swing). - Pure
q8_0decode vs RADV: Patched HIP ties or beats RADV on9B q4_0decode (1.000x–1.019x), while pureq8_0tg128still sits1–4%behind RADV (0.953x–0.989x) — traded against HIP's1.34x–2.28xverify and1.03x–1.44xprefill lead. - Hardware tested: Physically validated on an RX 6900 XT (
gfx1030).gfx1031(6700 XT) /gfx1032(6600 XT) share the same Wave32 /v_dot4/v_dot8ISA, so feedback from anyone testing on those cards would be awesome. - MIT Repo (14 patches, spill auditor, fail-closed A/B harness,
AGENT_ADOPT_PROMPT.md): https://github.com/s1mply-parad0x1cal/llama-cpp-navi21-optimizations - Full write-up (ad-free, with ablations and comparison to
llama-navi21-furnace/llama-cpp-rdna-boosts): https://nocthoughts.com/2026/12/04/navi21-gfx1030-rocm-hip-optimizations-for-llama-cpp.html
r/llamacpp • u/Ddma1994 • 15h ago
Qwen4-35B-A3B on a 12GB/30GB laptop: 128K ctx @ ~51 tok/s decode, 256K works, 512K with q4 KV, 1M OOMs
galleryr/llamacpp • u/ShadoByBB • 15h ago
Qwen4 35B A3B (37 GB) on a 16 GB laptop GPU: 27.8 → 77.5 tok/s with an expert cache and MTP drafts off
r/llamacpp • u/Haunting-Basket3449 • 15h ago
Qwen4-35B-A3B on an 8 GB laptop 5070: the 12 GB expert-cache recipe backfires, plain defaults win (48 tok/s)
Saw the post getting about 90 tok/s on a 12 GB 5070 with -cmoe --moe-cache-mib 7168 and MTP, so I tried the same idea on my laptop. Short version: on 8 GB it doesn't carry over. Plain llama.cpp with no placement flags was the fastest thing I tried.
Setup
Lenovo laptop, Core Ultra 9 275HX, RTX 5070 Laptop 8 GB, 32 GB RAM, Windows 11
llama.cpp b12973 (CUDA), Unsloth UD-IQ4_XS and UD-Q4_K_M, plus Unsloth's Q8_0 MTP file for the draft runs
-c 40960 -fa on -ctk q8_0 -ctv q8_0 on everything, plus whatever's listed in the table
Each setup gets a fresh server, then 3 runs of a 1,500-token coding answer (temp 1.0, top-p 0.95, top-k 20, thinking on). Median shown. Prompt speed is one 12.7K-token prompt.
Results (tg = generation tok/s, pp = prompt tok/s)
Setup IQ4_XS tg IQ4_XS pp Q4_K_M tg Q4_K_M pp
No placement flags 47.8 384 42.2 309
No placement flags + MTP draft 2 46.2 344 44.0 303
-cmoe, 2 GB cache 35.4 387 28.5 308
-cmoe, 4 GB cache 47.3 347 7.9 41
-cmoe, 5 GB cache 7.7 45 7.1 40
-cmoe, 3 GB cache + MTP draft 1 29.7 210 19.9 181
-cmoe, 4 GB cache + MTP draft 1 14.6 210 6.3 37
-cmoe, 4 GB cache + MTP draft 2 10.3 241 5.5 38
What I take from it
There's a cliff at about 7.8 GB used on the card. Anything that goes past it drops to 5 to 8 tok/s, and prompt speed falls off too. IQ4_XS with a 4 GB cache sat just under the line (47 tok/s), Q4_K_M with the same cache went just over (8 tok/s). My guess is the Windows driver spilling into shared system memory instead of throwing an out-of-memory error. I haven't tried turning sysmem fallback off in the NVIDIA control panel yet, so treat that as a guess.
The cache only pays off when it's big enough to hold the hot experts, and on 8 GB there isn't room for that once the KV cache and the rest of the model are loaded. 2 GB was clearly slower than just leaving it alone.
MTP did nothing for me with no placement flags. Draft 2 accepted about half the drafted tokens, draft 1 about 70 to 90%, and the speed didn't move. Add MTP to the cache setups and it gets much worse, I think because the 2 GB draft model pushes the card over the edge. Earlier the same day I got 54 tok/s with MTP draft 2 on a different prompt and couldn't reproduce it here, so I wouldn't count on MTP on this card either way.
Q4_K_M is about 12% slower than IQ4_XS on generation. I'm running it anyway because on a set of harder coding tasks it held up better over long agent loops (4/5 vs 1/5). That's one run each though, so I'm redoing that properly, with 8-bit and full precision for comparison, before I post anything about quality.
If you're on 8 GB: load it with no placement flags and let llama.cpp sort it out. 48 tok/s from a 35B MoE on a laptop is pretty good for a coding model.
Caveats: one machine, 3 runs per setup, one kind of prompt. Happy to try other flag combos if anyone's got one that works on 8 GB cards.
r/llamacpp • u/Wally-Gator-1 • 19h ago
Qwen 4 35B-A3B - Dual RTX 3060 (24GB) - 70 t/s at 200K+ Context (Procedure & Parameters)
I hope my setup note will help others configure their Qwen 4 35B-A3B on older consumer grade systems (Ryzen 5 + DDR4 + RTX3060).
r/llamacpp • u/CostaTattooz • 22h ago
Built my own (pretty strict) benchmark for local models and ran everything I had on a 3090. Qwen3.8 Flash Next IQ3_S kinda smoked everything
reddit.comr/llamacpp • u/TheLocalLab • 23h ago
Ternary Bonsai 2.5 27B on 8GB VRAM - Local AI With Vision (llama.cpp Windows Setup)
Ternary Bonsai 2.5 27B is a new open model from PrismML: a full 27-billion-parameter model where every weight is just minus one, zero or plus one. That shrinks the file from 53.8 GB to about 6 GB, so it fits on an 8 GB gaming card, and it can read pictures too. On my RTX 5060 Laptop GPU (8 GB) it answered at about 26 tokens a second.
Model (GGUF files, PrismML): https://huggingface.co/prism-ml/Ternary-Bonsai-2.5-27B-GGUF/tree/main
r/llamacpp • u/noahdowah • 1d ago
Hey r/StrixHalo — Qwen4-35B-A3B PaoAI STRIX (Q4..Q8 + shared PLE + vision) + Engine 2.1.0 is live with 1M context unlocked
r/llamacpp • u/SouvikSaha07 • 1d ago
Qwen3-4B-Thinking fried my 8GB RAM Laptop
I am new to local AI. I wanted a small model to reason with maths logic. I mostly need to reason with puzzles, combinatorics and light algorithms. So Gemini recommend me Qwen3-4B-Thinking-Q4_K_M.gguf
I ran this with llama.cpp with these settings:
--load-mode mmap -ngl 99 -t 4 -c 16384 -np 1 -fa on -ctk q8_0 -ctv q8_0 --temp 0.6 --top-k 20 --min-p 0 --presence-penalty 1.5 --port 8080
My system is: Ryzen 5500u, Amd Radeon integrated GPU, 8GB RAM, Linux Mint
I run Qwen2.5-Coder-3B-Instruct-Q4_K_M smoothly for some latex code on my system.
Idk why the Thinking model bottled on my system. Can I run the thinking model safely somehow? Or should I try other models. I preferred thinking because I need accurate solutions, approach or hints to solve complex problems.
N.B. I configured llama.cpp to run the models on both my cpu and igpu and I verified it works fine.
r/llamacpp • u/apetitfr • 1d ago
Qwen4 35b is out. Has anyone run it with LlamAmpere?
reddit.comr/llamacpp • u/New_Pomegranate_5594 • 1d ago
16 GB RDNA 2 (gfx1030) HIP fork: bounded attention workspace and automatic SSD prefix restore for the static persona/system prompt/skills/123-tool block, leading to 4–8 s completions on RX 6800 XT
Disclosure: I maintain this MIT native-runtime fork, based on BeeLlama v0.5.1/llama.cpp. The Windows HIP Runtime ships the runtime, six presets and a small launcher/client.
Across six model presets, this implementation restored 28,445–35,459 prefix tokens, evaluated 39–503 new prompt tokens, completed accepted requests in 4.04–7.78 seconds on an RX 6800 XT, and enables a 8.5x-23x speedup for agentic setups.
The attached graphic contains the per-model token rates, KV formats and resource measurements.
This is custom server-side work in a BeeLlama/llama.cpp fork. It adds automatic prefix persistence and restoration around ordinary OpenAI Chat Completions requests:
- Cache boundaries come from the server’s actual chat formatting and tokenization.
- Model, projector, runtime and configuration identities bind saved state.
- Restoration validates the actual matching prefix.
- Dense-cache edits can retain a supported aligned common prefix; hybrid caches require safe checkpoints.
- State publication uses integrity checks, owned-file locking and atomic replacement.
The launcher generates the local policy automatically. Clients need no private cache annotations or manual slot-save commands. Installation and model paths can be on any accessible Windows drive.
Results first. The prefix is the persona system prompt, the skills index and all 123 tool definitions. It is a static block of roughly 28k–35k tokens that gets built once and restored from SSD. After a restore, only your actual prompt is processed (39–503 tokens here), and then the reply is generated. Across six accepted cases, 28,445–35,459 cached tokens were restored and 98.28–99.89% of the input was reused. Requests took 4.04–7.78 seconds, against 66.41–123.37 seconds for the one-time initial capture. One example: Huihui Qwythos Q4_K with q4_0/q3_1 caches restored 28,704 tokens, processed 500 new ones and generated 159 in 5.97 s.
With SSD Cache:
| Model | New tokens prefilled | Prefill | Generated tokens | Decode |
|---|---|---|---|---|
| Huihui Qwythos | 500 | 298.61 | 159 | 69.85 |
| PINQWEN | 466 | 301.23 | 139 | 72.79 |
| Qwen2.5 Instruct | 46 | 287.84 | 14 | 30.04 |
| Qwythos standard | 464 | 301.43 | 83 | 69.58 |
| Qwythos Heretic | 503 | 318.20 | 308 | 73.67 |
| GLM Q4_K_S | 39 | 214.85 | 10 | 21.55 |
Initial build (one-time prefix creation):
| Model | Tokens prefilled | Prefill | Generated tokens | Decode |
|---|---|---|---|---|
| Huihui Qwythos | 29,161 | 429.29 | 94 | 69.83 |
| PINQWEN | 29,162 | 439.45 | 104 | 72.64 |
| Qwen2.5 Instruct | 28,483 | 401.75 | 14 | 29.76 |
| Qwythos standard | 29,187 | 423.72 | 98 | 69.96 |
| Qwythos Heretic | 29,237 | 455.60 | 117 | 73.40 |
| GLM Q4_K_S | 35,490 | 299.87 | 12 | 21.39 |

What the fork changes.
- Bounded workspace: Temporary dequantization and attention-result merging for selected RDNA 2 cache routes and KVarN paths. The temporary window bounds workspace, not attention context.
- Automatic SSD prefix state: The native formatter derives setup and history boundaries from ordinary OpenAI Chat Completions requests. Snapshots carry identity and integrity checks.
- Prefix matching: Tool or template edits are handled by actual causal token-prefix matching. Recurrent or hybrid models need a safe saved checkpoint.
- Portability: v0.1.2 rebuilds the server DLL to remove the fixed-drive guard. HIP, common and core are unchanged. The full binary set is therefore not identical to the measured one.
The target is compatible 16 GB RDNA 2 / gfx1030 cards (RX 6800, 6800 XT, 6900 XT, 6950 XT). The only measured card is the RX 6800 XT, on Windows build 26300 with a Ryzen 7 7800X3D and 16 GB DDR5-5200.
Caveats.
- Different test conditions: Suffix and output lengths differ, so this isn't a controlled speedup or a comparison with stock BeeLlama.
- Missing control: I haven't measured SSD-disabled mode for the full setup.
- Prompt size: Allocation was 750,080 tokens, but real prompts were 28,483–35,498 tokens.
- Measurement setup: The cache cases used a private Msty integration. Its assets are excluded.
- Unrerun tests: I did not rerun any model tests for the changed server. The earlier tool accuracy used a tools-only prefix.
r/llamacpp • u/Airocketfish • 1d ago
Running Qwen4-35B-A3B-UD-IQ4_XS (30.5 GiB) Fully in 24 GB VRAM on a Single RTX 3090: 158.6 t/s with Inline 1L-MTP (and the Default K=3 Trap)
r/llamacpp • u/101___ • 1d ago
Qwen 4 35B :: 7900 XTX 24GB :: LamaSrv Users whats your TKS and Config
reddit.comr/llamacpp • u/Same-Possibility-789 • 1d ago
Running GLM-4.5V (106B MoE) Locally on M4 Pro 24GB
I’ve managed to get GLM-4.5V (106B MoE, roughly 12B active; IQ4_XS GGUF + Vision Projector) running locally on my MacBook Pro (24GB, 12-core CPU, 16-core GPU, 273 GB/s bandwidth, 4.3 GB/s SSD) using llama.cpp (Metal, CMake)! I set it up with 13 layers offloaded, a 2048-token context, SSD streaming (mmap), and the AnythingLLM frontend, with speeds of less than 1 tokens/sec.
I’m hoping to achieve great image analysis and long-context RAG quality through SSD streaming and expert caching, even with just 24GB of RAM.
Could anyone kindly suggest if there are some RAG optimisation tips for llama.cpp, confirm whether the built-in dynamic expert caching for MoE is available, and share any benchmarks or tips you might have? Cheers!
r/llamacpp • u/stankeer • 1d ago
Anyone run DeepSeek-V4.1-Flash-1017-GSQ-RCO? How can i stop deepseek overthinking/looping on long tasks?
reddit.comr/llamacpp • u/Wimi_Bussard • 1d ago
Is there a llama.app ROCm 10 version?
As the title suggests, I would like to use the llama.app desktop app for Win11. If you want to use ROCm you need to install the AMD HIP SDK for Windows - which is shipped with ROCm 7.2.
It tells you to go to here: https://rocm.docs.amd.com/projects/install-on-windows/en/latest/install/install.html
Isn't there a newer AMD HIP SDK for Windows shipped with ROCm 10?
r/llamacpp • u/Opening-Broccoli9190 • 1d ago
Qwen4-35B-A3B: DFlash2 support PR for llama.cpp, 2x speed on code tests up to 400 tps on 5090
r/llamacpp • u/bhones • 1d ago
NVIDIA Pascal (sm_61) CUDA Optimizations for llama.cpp
I’ve been seeing how much more I can get out of my GTX 1070 FE (8 GB), so I've worked with Gemini Carbon/Hydrogen to put together three llama.cpp CUDA patches for Pascal sm_61. The biggest change keeps the KV cache quantized through the attention kernel, avoiding a separate Q8-to-FP16 dequantization step in the profiled case.
I tested stock vs. patched at the same upstream commit (ee46715) with Qwen3.5-9B-MTP on the 1070 alone:
Two-token verification at 16K: ~39–40% higher throughput across three weight quants.
Regular decode at 8K with a Q4 KV cache: ~15–19% faster. Bulk prefill barely moved.
Best MTP server case: 25.94 → 29.79 tok/s during generation. Counting prefill and the rest of the request, that was 17.75 → 16.66 seconds. Some settings got slower, and greedy outputs diverged despite no measured change on the short perplexity check. I included those results and the failed kernel experiments in the repo. The 64K smoke test checked that the configuration fit in VRAM; it didn’t fill the window.
Built with CUDA Toolkit 12.9. Use a 12.x toolkit for this build; CUDA 13 dropped offline compilation for Pascal (https://docs.nvidia.com/cuda/archive/13.0.0/cuda-toolkit-release-notes/index.html#deprecated-architectures).
GitHub repo, patches, and A/B scripts (https://github.com/s1mply-parad0x1cal/llama-cpp-sm61-optimizations)
So far I’ve only measured this on my 1070. If anyone still runs a 1080 Ti, P4, or P40, I’d be curious whether the two-token gain holds on your card, and whether it makes a difference to full request times.
Proper attribution/credits in the github readme with explicit roles denoted.
pascallama.cpp vs llama-cpp-sm61-optimizations:
The cleanest summary is that the two patch sets touch almost completely orthogonal subsystems—pascallama.cpp is a minimal 2-file MMQ tile-config + loop-unroll tweak aimed at large-batch/prefill and dual-P40 MoE setups, whereas my repo introduces dedicated sm_61 kernels for quantized-KV FlashAttention and the B = 2..8 small-batch dead zone.
r/llamacpp • u/Front-Ambassador-984 • 1d ago
qwen 4 3b5 a3b ud_q4_k_m on rtx 4080 super and 64gb ram
r/llamacpp • u/kokleongSG • 1d ago
Unsloth Qwen 4 35B A3B Q4 quick demo run on 4 x RTX A3000 12GB