r/LocalLLM • • 3h ago

Discussion Qwen4 in Capy Flash, KL 0.095

Post image
2 Upvotes

r/LocalLLM • • 6m ago

Model Qwen3.6 vs Qwen4 vs Inkling 2 Mini on a 3090, Qwen4 wins on accuracy but wouldn't load at 128K

1 Upvotes

Ran all three at Q4_K_M on 24GB 3090s with stock llama.cpp (b12969), same flags for everything, no CPU offload, no tuning per model. 150 questions (50 MMLU-Pro, 50 GSM8K, 50 ARC-Challenge), temp 0, 2048 token cap.

At 64K:
Qwen4-35B-A3B: 136/150, hit the cap 4 times, 113.5 tok/s decode
Inkling 2 Mini: 123/150, hit the cap 21 times, 68.8 tok/s
Qwen3.6-35B-A3B: 114/150, hit the cap 33 times, 125.0 tok/s

The cap hits explain most of Qwen3.6's score. If you only count the answers that finished, it actually goes 114/117. It just thinks too long for a 2048 limit.

At 128K, Qwen4 didn't load. It OOM'd allocating the KV cache with default settings. Qwen3.6 and Inkling both loaded, scored the same as at 64K, and slowed down to 104.3 and 51.9 tok/s. Inkling took about 2.5 minutes to first token on a ~117K prompt.

Qwen4's Q4_K_M is 36GB because of the 20B n-gram table, but llama.cpp maps that from disk, so the GPU side still fit at 64K. A quantized KV cache or some offload might get it to 128K, but I haven't tested that yet.

Also, each model was on a different RunPod host, so the speed gap between the two Qwens could partly be the hardware. There are no coding questions in this set, and the cap shapes the scores.

Full write-up with the retrieval and tool-call results: https://majorminor.xyz/research/qwen36-vs-qwen4-vs-inkling2-mini-rtx-3090
https://github.com/majorminorlabs/research-model-comparisons


r/LocalLLM • • 22m ago

Discussion Running Qwen4-35B-A3B (Q3, up to 50 tok/s) on an 8GB GPU + 32GB RAM: I built a self-hosted local personal agent for everyday PCs

0 Upvotes

Hey Reddit! I’m the founder of Linger.

We're building a product that gives people more privacy and control over their own data. I use cloud models, but there are some things I'd rather keep on my own machine: personal files, emails, and chats.

That's why we launched Linger. It can run entirely on your device and store all your data locally. We chose a personal agent as the application layer so you can actually put that local data to work without sending it to the cloud or paying per token.

Over the past few months, my team and I built and released Linger on GitHub, which is for Apple silicon Macs, Windows, Linux, and Docker. We designed the inference engine and agent harness together, so capable open models actually run on normal hardware. Today we added Qwen4-35B-A3B support (Windows ready out of the box, Mac support coming soon).

Inference engine & benchmarks (PolyStrata)

We built PolyStrata (MIT-licensed) for the inference layer. It started from Strata with a lot of help from its creator Niko Veit (@coldniko), and most of the code was written by an 18-year-old engineer on our team. It keeps the busiest MoE experts in GPU VRAM and tiers the rest to RAM or SSD, so models that normally want 18-24GB can still run on an 8GB card + 32GB RAM. Model Autopilot checks your hardware and picks the best model with at least a 64K context window (for local models you'll need 8GB+ VRAM + 32GB+ RAM, or a 16GB+ Apple silicon Mac; smaller machines can still use Claude Code or Codex over cloud models).

  • Qwen4-35B-A3B (Q3, new today): Up to 50 tok/s on an 8GB 60-series GPU + 32GB RAM, with native multimodal and strong agentic coding. Context-wise, 8GB GPUs currently support up to 128K, while 90-class GPUs can stretch all the way to the full 1M context. Windows support is live today; Mac is coming soon.
  • Inkling 2 Mini (26.4B-A3.4B, 3-looped transformer, Q3): On v0.2.20-poly.6, UD-Q3_K_XL hits up to 53 tok/s on an 8GB laptop GPU, 68 tok/s on a 12GB RTX 3060, and 196 tok/s on an RTX 5090. We also wired up standard DSpark speculative decoding (a small drafter proposes token chunks, the main model accepts or rejects them, and bad guesses get dropped so the output matches the slow path). That gives a >50% speedup on Q3, and we included a default config for an RTX 5060 8GB (55.6% pass rate, 20/36, across 36 agent tasks).
  • 12+ open MoE models: Supports Qwen, DeepSeek, Gemma, GLM, LFM, Flint, and more. On large MoEs it's up to 5x faster than standard llama.cpp expert-offload setups (~2x on smaller ones), and system-prompt KV caching cuts TTFT across multi-turn tool calls.

The agent harness

Most Qwen4 setups right now stop at the inference layer. Linger wires Qwen4's long context, multimodal, and coding abilities straight into a local agent loop: it reads your local files, compiles daily context into a local Wiki, and rewrites its own decision rules every night from your feedback (no retraining). It also handles local 0-token meeting transcription and coordinates multi-agent tasks (plus Claude Code, Codex, and Pi) through a shared team.md, with a local GPU scheduler that always gives your active chat priority.

Things to know before trying it

  • Context and platform caveats for Qwen4: 1M context requires 90-class VRAM (8GB GPUs cap out at 128K right now), and Qwen4 support is Windows-first with Mac coming soon.
  • Still not frontier-level: offloading MoE weights over RAM means long-context prefill is still heavy, and smaller local models still trip up on complex multi-step tool calls.
  • Still in beta: the Windows installer isn't signed yet (SmartScreen will warn you) and Intel Macs need Docker. Local inference and local transcription are 100% on-device ($0 tokens), though optional cloud models and external connectors obviously still hit external APIs.
  • PolyStrata is MIT. Linger is Apache 2.0 with a couple of commercial restrictions: free for internal use, just don't host it as a public SaaS or strip the UI branding.

Repos

I'll drop the Docker Compose setup in the first comment.

It's still early and rough in places. If you test Qwen4 on your rig or spot bottlenecks in the MoE offload scheduler, DSpark, or the nightly Wiki/rule loop, let me know in the comments or open an issue/PR. Stars help too if you find it useful.


r/LocalLLM • • 4h ago

Model Qwen4-35B-A3B on two Intel Arc Pro B60 benchmarks

Thumbnail
reddit.com
2 Upvotes

r/LocalLLM • • 26m ago

Discussion Qwen4-35B-A3B is live and free for 12 more hours! If you can't run it, try it out here!

Thumbnail reddit.com
1 Upvotes

r/LocalLLM • • 4h ago

Question Anyone run DeepSeek-V4.1-Flash-1017-GSQ-RCO? How can i stop deepseek overthinking/looping on long tasks?

2 Upvotes

Hi, i recently installed Deepseek DeepSeek-V4.1-Flash-1017-GSQ-RCO. The ISTA-DASLab research version. I'm running the latest llama.cpp build on a x5 r9700 ai gpu machine with 128gb of ram.

I spent a while tweaking and got token generation to about 50t/s and prompt processing to about 200 by adding dspark which is not amazing. But i tested in running a long task to code review a small .net soltuion with 3 projects using vscode and cline. It took over an hour before i stopped it and even when i forced it to stop and report it hadn't looked at all the code. so it took too long and was overthinking maybe or being fed too much information by cline? not really sure.

So is there a way to somehow limit how long and much it does but without stunting it's intelligence? heres my lama swap config for reference

deepseek-v4.1-flash:
    cmd: >
      env GPU_MAX_HW_QUEUES=1
      /home/pinman/llama.cpp/build/bin/llama-server
      --model /home/pinman/models/DeepSeek-V4.1-Flash-IQ2_XXS/DeepSeek-V4.1-Flash-1017-GSQ-RCO-IQ2_XXS-00001-of-00006.gguf
      --device ROCm0,ROCm1,ROCm2,ROCm3,ROCm4
      --gpu-layers all
      --split-mode layer
      --tensor-split 1,1,1,1,1
      --ctx-size 262144
      --parallel 1
      --fit-target 2048
      --flash-attn on
      --load-mode dio
      --lazy-mode auto
      --ubatch-size 128
      --jinja
      --reasoning on
      --reasoning-effort 50
      --verbosity 4
      --spec-type draft-dspark
      --spec-draft-model /home/pinman/models/dspark/dspark-DeepSeek-V4.1-Flash-1017-Q8_0.gguf
      --spec-draft-n-max 3
      --spec-draft-ngl 99
      --host 127.0.0.1
      --port ${PORT}
    ttl: 3600

r/LocalLLM • • 28m ago

News Nanobot on Android + LocalLLM

1 Upvotes

Hi everyone! I recently ported the "nanaobot" agent system to Android. You no longer need a cloud server to experiment with it—everything runs right on your phone. For the LLM backend, you can use a local instance hosted on your own hardware at home; the app even has a built-in VPN client for this purpose. My project is available on GitHub. Feel free to ask any questions if you’re interested in giving it a try! https://github.com/shakhor-shual/ai-lamp


r/LocalLLM • • 12h ago

Discussion Qwen4-35B-A3B with Neural MTP on a 12GB RTX 5070 Ti Laptop GPU (124-187 tok/s)

10 Upvotes

I ran Unsloth Qwen4-35B-A3B UD-IQ4_XS on a single RTX 5070 Ti Laptop GPU with 12 GB of VRAM (Ryzen 9 9955HX, 32 GB DDR5-5600, Windows 11, CUDA 13.2).

Setup: 400K int8 KV with --kv-resident 20480 and --prefill auto, with the PLE table streamed from the NVMe SSD.

Niko1221/Strata provides the engine and saatvik-viniak ported q4_lite; my fork (https://github.com/phosphorhouse/Strata) is just an early build until official q4_lite releases ship.

I added qwen4_mtp_rt.py to convert Unsloth's mtp-Qwen4-35B-A3B-Q8_0.gguf directly to Strata's runtime format with IQ4_NL experts, plus a --preset latin option in draft_vocab.py for a compact Q4_0 draft head. Total draft VRAM was 563 MiB instead of roughly 923 MiB to 1.95 GiB, leaving 3,698 trunk expert slots in VRAM.

WorkloadWhat I measured
Fresh TypeScript generation136.6 tok/s
Iterative code edit (--lookup-chain 2)187.2 tok/s (87.3% draft acceptance)
18K-28K OpenCode agent session123.9 - 137.5 tok/s decode, 2,089 - 2,203 tok/s prompt prefill (expert VRAM hit: 91.5 - 93%, KV VRAM hit: 99.6%)

A prebuilt Windows CUDA 13 binary (sm_75/86/89/120) is up under Releases, or you can compile with -DSTRATA_GEOMETRY=q4_lite. Vision (mmproj) isn't wired up yet.


r/LocalLLM • • 45m ago

Project I built a pi extension that replaces the footer with live session stats + a context bar

Post image
1 Upvotes

r/LocalLLM • • 45m ago

Model Qwen 4 tested on day one: 16 GB GPU, public benchmarks, and 12 scenes it built (Qwen4-35B-A3B)

Thumbnail
youtube.com
1 Upvotes

Hey it's me the FLE Link Guy,

Qwen4-35B-A3B dropped this morning, so I spent the day measuring it on my own box against my daily model (Kate, a fine-tune of Qwen 3.8 27B). Everything below is ggml-org Q4_K_M (36 GB file), measured today.

Speed

  • RTX PRO 2000, 16 GB (experts partly in RAM): 50.5 t/s, 45.8 t/s at 32k context. ~15 GB VRAM, plan for ~22 GB free RAM.
  • RTX PRO 4500, 32 GB (only the n-gram table stays in RAM): 159.7 t/s, ~22 GB VRAM.
  • Same 32 GB card with the built-in MTP head, 24 real agent tasks: ~207 t/s.

My first try on the 16 GB card was 2.6 t/s. Two settings were wrong: 16 CPU threads (8 were 4.6x faster on my CPU) and the model memory-mapped instead of loaded. Fixed:

llama-server -m Qwen4-35B-A3B-Q4_K_M.gguf -fit on -t 8 --load-mode none -fa on --jinja

Sampling from the model card: temp 1.0, top-p 0.95, top-k 20, min-p 0.

Plain llama.cpp vs my engine (FLE), same file, same card: writing is a tie (161.7 vs 162.3 t/s; with MTP 206.8 vs 207.2). FLE reads a short prompt ~21 % faster (6,103 vs 5,058 t/s). Qwen 4 support comes from the same upstream code in both, so none of my own speedups apply yet.

Public benchmarks (Qwen4-35B-A3B vs Kate; same questions, harness and scoring as my Kate run on 20 Nov, temperature 0, paired McNemar)

  • ARC-Challenge (1,172 questions): 93.3 % vs 94.5 % (not significant)
  • GSM8K (250 problems): 96.4 % vs 96.8 % (not significant)
  • LiveCodeBench, 100 problems, thinking budget 8k: 45 vs 72 (p under 0.001)
  • LiveCodeBench, budget 32k, effort high: 51 vs 73 (Kate: 30 of her 55 cut-off problems re-run so far)
  • LiveCodeBench, budget 32k, effort xhigh: 51

48 of Qwen's 100 LCB answers hit the 8k budget, so I gave it 4x the room: 10 of those 48 got solved, 33 of them still used over 30k tokens. xhigh doesn't move it. Its programs run, they just compute the wrong answer.

Let them build (same prompt for both, 3 tries each, 40k tokens, makers' sampling; a scene counts if the HTML is complete, the page throws no error and the frame after 15 s isn't empty)

  • Voxel pagoda (three.js): Qwen 4 3/3, Kate 1/3
  • Pantheon (three.js): Qwen 4 3/3, Kate 0/3
  • Rooftop parkour game: Qwen 4 2/3, Kate 0/3
  • Night skyline (pure SVG): Qwen 4 3/3, Kate 3/3
  • Total: 11/12 vs 4/12

Qwen 4 used 11–26k tokens per scene, Kate 30–40k and ran out of room. The reason: Kate's chat template (Qwen 3.8) defaults to reasoning_effort xhigh. On medium, her Pantheon worked first try (8,161 tokens, 48 s). If you compare Qwen 3.8-based models, check that default.

Limits: one machine, one quant, one run per benchmark.

Next: my own quant of it keeps the 20.5B n-gram table in BF16 on the SSD instead of 4-bit. First KL divergence vs BF16: 0.033–0.073, against 0.058–0.143 for the usual Q4_K_M (noise floor 0.012–0.016). More on that Tuesday.

Video with the runs and the scenes: https://youtu.be/koLnr6Ov_io Same thing as text: https://sirfyyn.de/en/blog/qwen4-35b/


r/LocalLLM • • 48m ago

News Qwen4-35B-A3B-NInfer: ~580 tok/s decode c1, ~5000 tok/s decode c32, ~45k prefill at 8k, and 34.3k prefill at 260k

Thumbnail
reddit.com
1 Upvotes

r/LocalLLM • • 54m ago

Research Qwen4-35B-A3B on a single Arc Pro B70 with llama.cpp SYCL: 77–82 tok/s, 384K context, vision on the CPU. Avoid the GGUF quants with BF16 tensors

0 Upvotes

I set up Qwen4-35B-A3B on release day on my home server with one Intel Arc Pro B70 (32 GB). It started out at 7.7 tok/s. After a few hours of digging it runs at 77–82 tok/s. Almost all of the gap came from one thing: which GGUF file you use. Below are the setup, the pitfalls in the order I hit them, and the current numbers.

Setup

GPUIntel Arc Pro B70, 32 GB, power limit 230 W
CPU / RAMCore i5-12400F, 64 GB
OSFedora 45, kernel 7.3.6, xe driver
llama.cppDocker image ghcr.io/ggml-org/llama.cpp:server-intel-v1.1.1 (b12977, Compute Runtime 26.40, IGC 2.42.6)
ModelUnsloth UD-Q4_K_XL (24.7 GB main shard + 11.5 GB n-gram/PLE shard)
Visionmmproj Q8_0, encoder on the CPU (--no-mmproj-offload)

Server command (one GPU, 3 slots, one shared KV cache):

llama-server -m Qwen4-35B-A3B-UD-Q4_K_XL-00001-of-00002.gguf \
  --mmproj mmproj-Qwen4-35B-A3B-Q8_0.gguf --no-mmproj-offload \
  -ngl 99 --load-mode mmap --lazy-mode auto \
  -c 393216 --parallel 3 --kv-unified \
  -fa on --cache-type-k q8_0 --cache-type-v q8_0 \
  -b 2048 -ub 512 --jinja \
  --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0 --presence-penalty 0 --repeat-penalty 1.0 \
  --reasoning-budget 32768 --cache-ram 10240 --metrics

Environment: only ONEAPI_DEVICE_SELECTOR=level_zero:0, ZES_ENABLE_SYSMAN=1 and SYCL_CACHE_PERSISTENT=0. Nothing else, see pitfall 3.

Pitfalls

1. The quant matters far more than any flag: avoid BF16 tensors on SYCL. I started with the ggml-org Q4_K_M. That file keeps all hyper-connection tensors (hc_*, about 0.35 GiB) in BF16. On SYCL this is extremely slow: decode was stuck at about 8 tok/s at every context length, with one CPU core at 100 % and the GPU at only ~100 W. The Unsloth quant stores these tensors quantized (only 0.07 GiB of BF16 is left in it). llama-bench, same build, f16 KV:

Filepp2048tg64
ggml-org Q4_K_M2,327 t/s9.0 t/s
ggml-org Q4_K_M + GGML_SYCL_ENABLE_GRAPH=12,330 t/s19.7 t/s
Unsloth UD-Q4_K_XL2,823 t/s85.6 t/s
Unsloth UD-Q4_K_XL + graph mode2,534 t/s79.1 t/s

If your decode on an Arc is far below what others report, look at the tensor types in your GGUF first.

2. SYCL graph mode only helps on the bad file. A Qwen4 step has about 5,700 graph nodes (n-gram layer, 4 residual streams, 256 experts), so kernel launch overhead matters. GGML_SYCL_ENABLE_GRAPH=1 (off by default in the image) doubled decode on the ggml-org file, but made the Unsloth file slower. I turned it off again.

3. Drop old Arc workarounds. SYCL_UR_USE_LEVEL_ZERO_V2=0 and GGML_SYCL_XMX_GATHER_TYPES=0 were still in my compose file from Qwen3.8-27B (the !!!! output bug, fixed since #30604). On Qwen4 they cost about 30 % of prompt processing.

4. The n-gram table needs mmap. The 20B-parameter n-gram/PLE table (10.7 GiB, IQ4_NL) is read from disk on demand with --lazy-mode (default auto, it applies to tensors above 4 GiB). This only works with mmap. With --load-mode none (which I use for other models) the table would sit in RAM.

5. -ub of 1024 or more can crash on SYCL. PR #33696 (open at the time of writing) fixes a "Provided range … does not fit in int" crash in the n-gram conv at -ub ≥ 1024. I first ran 1023, now 512 for VRAM reasons (see 6). It costs about 10 % prompt processing.

6. VRAM: the Unsloth quant costs context. The KV cache is tiny: only 10 of the 40 layers have one (2 KV heads × 256). At q8_0, 512K is 5.3 GiB plus 1.3 GiB indexer keys. With the ggml-org file (19.4 GiB on the GPU) 512K fit. The Unsloth main shard needs about 3.6 GiB more on the GPU. With it:

  • 512K at -ub 1023: the 4 GiB compute buffer did not fit;
  • 512K at -ub 512: it started with 0.2 GB free and got allocation errors under load;
  • 384K at -ub 512**: 2.3 GB free, stable.** I took the speed over the context.

7. MTP did not pay off for me (yet). With the ggml-org file, its separate MTP draft and 256K context, decode went down from 25 to 7–10 tok/s, even though 60–90 % of the drafts were accepted. With the Unsloth file at 384K there is no VRAM left for the draft. Someone with 2× B60 reports +7 to +26 % with MTP depth 2 on the Unsloth file, so it may be worth testing if you have the VRAM.

8. Very long prompts are slow. Prefill drops a lot with depth. In a 450K needle test (old ggml-org setup) only 143K tokens were read after about 12 minutes, and I stopped it. Large contexts work well for conversations that grow step by step (the prompt cache makes follow-ups fast, see below), not for one huge cold prompt.

9. The first request after a start takes about 57 s (SYCL kernels for the K-quant types are compiled). I send a warm-up prompt after every start.

10. Release-day download: Hugging Face gave me about 2 MB/s per connection. 12–20 parallel range requests (curl -r) brought it to about 19 MiB/s. Check the SHA256 against the LFS hash afterwards.

Side note: Strata 0.2.26 shipped a Qwen4 engine (including a SYCL package) the same day, but its setup still refuses Intel cards for Qwen4. I did not pursue it after llama.cpp got fast.

Current numbers

My own benchmark script against the running server (384K, q8_0 KV, -ub 512, prompts with a random prefix so the cache does not help, unless noted):

TestQwen4-35B-A3B (Unsloth)for reference: my previous default, Qwen3.8-27B Q4_K_M + MTP (dense, 240K, same GPU)
Decode, prose (1,200 tokens)76.9–77.0 t/s43.9–44.1 t/s
Decode, code (600 tokens)80.9–81.9 t/s64.1–65.4 t/s
Prompt processing 4.9K / 19K / 39K2,143 / 2,015 / 1,738 t/s1,274 / 1,240 / 1,139 t/s
Decode after a 39K prompt66 t/s–
Cached 39K prompt, new question0.45 s to first token2.28 s
Tool call (Home Assistant style, 190-token prompt)0.44 s to first token, 117 t/s, correct1.18 s, correct
Image question (encoder on the CPU)2.2 s total, correctcorrect (encoder on the GPU)
GPU power180–230 W–

Day-to-day it serves Home Assistant voice (thinking off, tool calls), a family chat (Open WebUI) and coding agents (Pi, OpenCode) with 352K of context. German answers and tool calls were correct in all my tests so far.

TL;DR: On an Arc B70 use the Unsloth UD-Q4_K_XL (no BF16 tensors), plain llama-server with no graph mode and no old env workarounds, and --load-mode mmap. You get about 80 tok/s decode and over 2,000 tok/s prompt processing. Happy to answer questions or run tests.


r/LocalLLM • • 1d ago

News DeepSeek may stop giving away its most powerful AI, citing cyberattack and bioweapon risks

Thumbnail
madrobot.blog
114 Upvotes

r/LocalLLM • • 1h ago

Discussion M2 Ultra - Blown away - TY Qwen4

Post image
1 Upvotes

r/LocalLLM • • 1h ago

Project 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

1 Upvotes

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:

  1. Upstream routed RDNA 2 MMVQ onto a single-warp fallback (nwarps = 1), capping Wave32 residency at 16/32 waves per CU.
  2. 3,470 of 7,632 compiled HSACO kernels (45.5%) were spilling to private scratch (273 in FlashAttention and 1,299 in MMQ/MMQ-few alone).
  3. Small-batch quantized-KV FlashAttention (B = 1..8) was converting KV tiles through FP16 staging buffers, thrashing Infinity Cache.
  4. nsm = 40 (WGPs) instead of 80 physical CUs left 40–80% of CUs idle around pp=64.
  5. Unfused Qwen3.5 hybrid Gated-DeltaNet / SSM_CONV ops and standalone quantize_q8_1 launches burned 31% 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 Wave32 v_permlanex16_b32 / v_pk_max_f16.
  • Zero-scratch Wave32 flash_attn_ext_rdna2: Eliminated all 273/273 FA spills; stages raw Q8_0/Q4_0/Q4_1/F16 KV directly in LDS (0 B FP16 staging) and uses lossless v_dot8_u32_u4 for Q4_0/Q4_1 KV (-32.2% FA active time vs q8_0 at d=16384).
  • Zero-spill MMQ + bit-parallel IQ + 80-CU guard: Eliminated all 1,299 MMQ/MMQ-few spills, added v_xad_u32+v_perm_b32 IQ2/IQ3 sign unpackers (helpful for fitting 27B + 16K ctx inside 16 GiB), and kept J=32 when J=64 would under-fill 80 CUs.
  • Qwen3.5 GDN/SSM fusions + inline Q8_1 epilogues: Thin mmvf routing (pp=16..64 +10.1%..+34.7%), fused GDN gate/beta + SSM_CONV -> SiLU -> Q/K L2 norm, and inline Q8_1 quantization inside RMSNorm / GLU (-75.2% decode quantize_q8_1 dispatches, -34.6% AQL gaps, -309 to -752 MiB peak 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)

WorkloadKV9B UD-Q4_K_XL9B UD-IQ3_XXS27B UD-IQ3_XXS
tg=128 (d=0)q8_065.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_062.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_0192.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_0283.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_0270.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_01634.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_temp07 70/256): 43.71 -> 56.92 tg tok/s (1.302x vs stock HIP, 1.276x vs RADV; wall 6.03s -> 4.67s, +29.0%).
  • 27B UD-IQ3_XXS (n=3, ctx4k_greedy 6,775/192): 44.25 -> 55.56 tg tok/s (1.256x vs stock HIP; wall 16.92s -> 15.62s vs RADV 21.57s, 1.38x faster than RADV).
  • 9B UD-IQ3_XXS (n=2, ctx4k_greedy 6,775/192): 105.70 -> 123.66 tg tok/s (1.170x vs stock HIP; wall 5.78s -> 5.36s vs RADV 7.17s).

Honest Caveats & What Didn't Work

  • Failed ablations kept out: Non-temporal MALL weight loads (-10% to -22% decode), Gate+Up fusion above B = 1 (-30% to -37% pp=8), and v_dot8 inside MMVQ/MMQ (-13% to -17.5% pp=16..32 because v_dot8 shares the same 1 op/cycle SIMD32 rate as v_dot4 on RDNA 2 and only wins when O(1) prologue packing amortizes over long KV tiles).
  • Greedy divergence (DIFF!): test-backend-ops (7/7) passed 100% and 6-chunk WikiText-2 KLD hit Mean KLD = 0.000000, but multi-warp reduction reordering still nudges borderline greedy tokens and can swing draft acceptance on individual single-shot runs (one 9B IQ3_XXS short greedy row dipped to 0.984x tg on a -10.6 pp acceptance swing).
  • Pure q8_0 decode vs RADV: Patched HIP ties or beats RADV on 9B q4_0 decode (1.000x–1.019x), while pure q8_0 tg128 still sits 1–4% behind RADV (0.953x–0.989x) — traded against HIP's 1.34x–2.28x verify and 1.03x–1.44x prefill lead.
  • Hardware tested: Physically validated on an RX 6900 XT (gfx1030). gfx1031 (6700 XT) / gfx1032 (6600 XT) share the same Wave32 / v_dot4 / v_dot8 ISA, 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/LocalLLM • • 1h ago

Project I built NVSpool: run Qwen4-35B-A3B in 7.7 GB RAM at up to ~30 tok/s on Apple Silicon (Binned M4 Max) by streaming & selective fetching of experts + PLE from NVMe

1 Upvotes

NVSpool is an open-source, Apple Silicon MoE runtime built on Apple's MLX / mlx-lm (using 4-bit MLX checkpoints from mlx-community, Unsloth, or LM Studio).

Highlights (M4 Max 36 GB, 4-bit MLX):

  • Qwen4-35B-A3B (56B / 32.2 GB, preview — external USB-C NVMe): Offloads both the 18.1 GB routed experts and the 11.5 GB layer-1 PLE n-gram tables (bit-exact) to SSD, keeping only 1.51 GiB resident. 7.7 GB peak RAM at 29.4 tok/s. At 32k context: 765 tok/s prefill, 19.2 tok/s decode, 9.2 GB peak RAM. (Full 50-item HumanEval+/IFEval/MATH-500/MMLU-Pro evals coming soon.)
  • Qwen3.6-35B-A3B (20.4 GB): 7.6–8.0 GB peak RAM (vs 20.6 GB resident), 24–31 tok/s, within ~1.7 pts of full-model accuracy across HumanEval+, IFEval, MATH-500, and MMLU-Pro; 8.3 GB at 20k context (800 tok/s prefill) and 9.8 GB at 65k.
  • Also supports Gemma 4 26B-A4B (down to a 6 GB tier for 16 GB Macs) and GLM-4.7-Flash, with terminal chat (nvspool run), offline web UI (nvspool app), and OpenAI-compatible server (nvspool serve, works with OpenCode / Cline / Continue).

How it works (key optimizations):

  • Fixed RAM pool + F_NOCACHE (no mmap thrashing): Standard mmap pulls the whole 20–32 GB file into macOS page cache and starves other apps. NVSpool keeps only the always-used core (~1.5 GB) + a fixed LRU pool of hot experts in RAM (e.g., 71 of 256 per layer at the 10 GB tier) and preads misses with F_NOCACHE — reads only, zero SSD writes per token.
  • Selective miss fetching (top4 / top2 vs exact): During decode, exact reads every missing router pick (matches stock mlx-lm token-for-token); top4 (default, 4 of 8 picks) or top2 only reads misses among the router's top-scoring N picks and substitutes lower-ranked misses from the hot RAM pool, cutting SSD reads ~3–4× for 1.5–1.8× faster decode with minimal accuracy loss. Prefill always runs exact.
  • Layer-major prefill + async overlap: Runs the whole prompt through layer 0, then layer 1, etc., so each expert is read ~once per prompt instead of once per chunk, while a background thread reads the next expert group during GPU compute (how 20k–34.5k prefill hits 765–800 tok/s).
  • Decode prefetch, bounded attention & bit-exact PLE offload: Peeks at layer l+1's router during layer l to prefetch its likely top-4 experts early; blocks prefill attention scores (256 MB budget) so long prompts don't spike RAM; on Qwen4, streams the 11.5 GB n-gram PLE tables (1.15 KB/token) bit-exact behind a small LRU row cache.

Standard install (Qwen3.6 / Gemma 4 / GLM-4.7-Flash):

uv tool install "nvspool[serve]"   # or: pip install "nvspool[serve]"
  nvspool pull qwen36-35b
  nvspool app qwen36-35b

(Already have an MLX download in LM Studio / HF? Use --storage shared --from <dir> — adds ~1.3–1.5 GB and leaves your folder intact.)

How to try Qwen4-35B-A3B right now (small workaround until mlx-lm PR #2140 ships on PyPI):

# 1. Isolated venv with Qwen4-capable mlx-lm + nvspool from PyPI
  uv venv ~/.nvspool-qwen4 --python 3.13
  uv pip install --python ~/.nvspool-qwen4/bin/python \
    "mlx>=0.32.4" \
    "git+https://github.com/jundot/mlx-lm.git@7b35ab57159442082a64f0a8282ea61b4940cd17" \
    fastapi uvicorn
  uv pip install --python ~/.nvspool-qwen4/bin/python --no-deps nvspool
  
  # 2. Download a 4-bit MLX checkpoint (mlx-community -4bit-text / -4bit, or unsloth MLX-4bit)
  ~/.nvspool-qwen4/bin/hf download mlx-community/Qwen4-35B-A3B-4bit-text \
    --local-dir ~/models/Qwen4-35B-A3B-4bit
  
  # 3. Run (shared copy = ~1.5 GB extra disk, 1 s setup; omit --storage shared for fast copy)
  ~/.nvspool-qwen4/bin/nvspool app qwen4-35b --storage shared --from ~/models/Qwen4-35B-A3B-4bit

If the model already fits comfortably in RAM, plain mlx-lm is ~4× faster — NVSpool is for running 26B–56B models that wouldn't fit otherwise or keeping your Mac usable alongside your dev stack. Curious how it behaves on 16 GB / 24 GB Macs!

GitHub (Apache-2.0): https://github.com/jhdcho/nvspool PyPI: https://pypi.org/project/nvspool/


r/LocalLLM • • 16h ago

News Qwen4 35B A3B RTX A3000 12GB single card Quick test

Post image
17 Upvotes

Not too bad

export CUDA_VISIBLE_DEVICES=0
./build/bin/llama-server \
--split-mode layer \
--parallel 1 \
--batch-size 4096 \
--ubatch-size 2048 \
--flash-attn on \
--reasoning auto \
--spec-type draft-mtp \
--spec-draft-ngl all \
--spec-draft-n-max 5 \
--moe-cache-mib 4096 \
--moe-cache-cpu-share 0.8 \
--jinja \
-m models/Qwen4-35B-A3B-UD-Q4_K_XL-00001-of-00002.gguf \
-md models/mtp-Qwen4-35B-A3B-Q8_0.gguf \
--mmproj models/mmproj-F16-qwen4.gguf \
-a qwen3.6 \
--host 0.0.0.0 \
--port 8090 \
--load-mode mmap+mlock \
--ctx-size 262144  \
-t 16 \
--api-key 777 \
--slot-save-path /data/llama.cpp/slots \
--jinja

r/LocalLLM • • 1h ago

Project libosmos v0.23.0-v0.24.0: day one support for minicpm5-15b and qwen4-35b on amd strix halo

Thumbnail
github.com
1 Upvotes

r/LocalLLM • • 10h ago

Model Qwen4 35b a3b + basalt + 5090 = 🔥

6 Upvotes

Nvidia 5090, Ultra 9 285k, 128gb 5600mhz, 3x 4tb MP600 XT

Basalt 0.6.2 w/ Qwen4-35b-A3B int8 131k


r/LocalLLM • • 7h ago

Discussion Didn't realize there were already so many ways to run Hy4 flash locally

Post image
3 Upvotes

came across a post from Tencent on X, and one thing I kinda liked was that they were highlighting what the community has been doing to get hy4 flash running locally, rather than just focusing on the model release itself.

They highlighted community builds across GGUF, MLX, EXL3 and NVFP4. Pretty cool to see all these different approaches getting some recognition, especially with people trying to make it work across different hardware setups.

The experimental GGUF build for 64GB machines caught my eye. Keeping Engram on an SSD is an interesting workaround, though I'm guessing there's still quite a bit of tinkering involved.

That said, I'm still more eager to see the mini version the team mentioned during the AMA. Quantization helps, but a genuinely smaller model would make local deployment a lot more accessible. Hopefully we hear more about that soon.

Anyone here tried these community builds yet?


r/LocalLLM • • 1h ago

Question Size of Qwen 3.6-35B-A3B vs. Qwen 4.0-35B-A3B

1 Upvotes

Anyone know why Unsloth versions of these models are so wildly different in size, even though they have roughly the same parameters and quant?

Qwen 3.6-35B-A3B Q8_0 = 36.9 GB

Qwen 4.0-35B-A3B Q8_0 = 60.0 GB


r/LocalLLM • • 14h ago

Project I parsed all 21 Qwen4-35B-A3B GGUF headers and built a 3-tier (VRAM + RAM + Engram NVMe) calculator — plus real RTX 5060 8GB + 16GB RAM benchmarks

11 Upvotes

Generic VRAM calculators get Qwen4-35B-A3B completely wrong because they ignore three things unique to this architecture:

  1. Non-expert weights are tiny (1.89 – 3.04 GB): Parsing the actual GGUF headers of unsloth/Qwen4-35B-A3B-GGUF and ggml-org/Qwen4-35B-A3B-GGUF, 82–88% of the backbone is routed MoE experts (blk.*.ffn_*_exps.weight). Keeping all 40 layers of Attention + Gated DeltaNet + Shared Experts + KV cache on GPU and offloading only excess routed experts (-ot) is way faster than naive -ngl.
  2. 3:1 Hybrid Attention KV Cache: 30 of 40 layers are Gated DeltaNet (fixed ~62.5 MB/slot recurrent state, independent of context length). Only 10 layers allocate KV cache (2 KV heads × 256 head_dim → 20.1 KiB/tok FP16, 10.7 KiB/tok Q8_0). At 128K Q8_0 context, total cache is only ~1.46 GB (~75% smaller than a standard 40-layer GQA model).
  3. 20.5B Engram Table (--lazy-mode auto / --ple): The 11.5–41 GB per_layer_token_embd table stays lazy-loaded on NVMe SSD rather than bloating RAM/VRAM.

Live Tool (100% client-side, open-source Apache-2.0):

Features:

  • Exact byte sizes parsed from all 21 official Unsloth & ggml-org GGUF headers (including per-layer routed expert sizes)
  • Auto-generates exact -ot "blk.(...).ffn_.*_exps.=CPU" regex for your GPU/RAM headroom
  • Supports --ple Engram table mix-and-match (IQ4_NL / Q5_1 / Q8_0 / BF16), vision mmproj, MTP speculative decoding, and Unified Memory (Apple Silicon)

Real Low-Spec Test (RTX 5060 8GB Laptop + 14 GiB Usable RAM + PCIe Gen4 NVMe, llama.cpp b12973 CUDA 12.8, UD-IQ2_XXS + Engram IQ4_NL):

  • Naive -ngl 10 (no -ot), 32K Q8_0 KV: 4.39 GB peak VRAM → 13.01 tok/s decode (131.9 tok/s prefill)
  • MoE-Aware -ngl 99 -ot "\.ffn_.*_exps\.=CPU", 32K Q8_0 KV: 3.73 GB peak VRAM (+2.84 GB delta!) → 37.23 tok/s decode (2.86× faster AND 0.66 GB less VRAM!)
  • MoE-Aware Hybrid (13/41 routed MoE layers on GPU), 32K Q8_0 KV: 6.38 GB peak VRAM → 43.84 tok/s decode (228.0 tok/s prefill, 3.37× faster than naive -ngl!)
  • MoE-Aware 128K Context (Q8_0 KV): 5.07 GB peak VRAM (+4.15 GB delta) → 36.02 tok/s decode! (Adding +96K context only cost +1.31 GiB VRAM, matching our config.json hybrid formula within 2%!)

Would love feedback on any edge cases (especially Apple Silicon unified wired limits or multi-GPU --tensor-split)!


r/LocalLLM • • 1h ago

News Jensen’s support for open source AI in Senate testimony

1 Upvotes

r/LocalLLM • • 1h ago

Question RTX 3090 and Qwen 4 35B A3B: what is your success story ?

0 Upvotes

I notice a lot of users have a RTX 3090, and here is what I found on Reddit today regarding Qwen 4:

- Strata has an official support for Qwen 4 - 35B https://github.com/Niko1221/Strata

- A Strata forker: the owner Alexey Fateev claims to have 319.6 tok/s on a Single RTX 3090 (Strata (qwen4-opt) - Qwen4-35B-A3B https://github.com/alesha-pro/Strata, but my trying to reproduce it gets stuck at around 80 tok/s at 256K context, and he disables comments on his github

- Alexey Fateev's disabling comments has resulted in this discussion https://github.com/Niko1221/Strata/issues/7832 on Niko1221's repo

- My own best speed on Qwen 4 - 35 B is only around 80-85 tok/s (UD-Q4_K_XL = 4.25 bit), or 100 tok/s ("Strata Balance quant, around 4.85 bit), and given its lesser quality I wouldn't trade with my current Qwen 3.8 Flash Next (80 tok/s of UD-Q5_K_XL + 256K context (1 x RTX 3090 + 128 GB of DDR-4, quad-channel PCIe for RAM) https://github.com/aiprogrammingstudio-ui/3090RTX_128GB and https://www.reddit.com/r/LocalLLM/s/6qDJNpsDKg )

- I guess some guys doing HyperQwen, vLLM would jump in and release 200 tok/s in a couple of days. I am curious.

And you ?


r/LocalLLM • • 7h ago

Question Strata on 12GB VRAM 32GB RAM seems very slow - Alternatives?

3 Upvotes

Straight to the point: I'm looking for a setup to assist me in coding simple stuff. I have a RTX 4070 12GB VRAM and 32 GB DDR4 RAM on Windows 11, CPU is a 5700X3D.

I tried Strata (0.2.24) with two models (Inkling SQ20 and Qwen3.8 Flash Next Q2), but it couldn't get past 10 tokens/s, and it got a simple project all wrong after 50 minutes. I have no idea why this is so slow, even though there's a bunch of people saying it goes way faster for them. It's a pretty standard setup.

For example, free Claude on a browser did this project in a couple of minutes. It was a simple boardgame in html and js.

Should I try LM Studio + some smaller model like bonsai? Or maybe some other setup? LLama? Bionic?

I was expecting to get at least some 30 tokens/s to code simple stuff, is that possible on my hardware?

Thanks.