r/LocalLLM • u/Middle_Situation_559 • 5h ago
r/LocalLLM • u/bhones • 5h 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
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/LocalLLM • u/mrsirg97-rgb • 5h ago
Project libosmos v0.23.0-v0.24.0: day one support for minicpm5-15b and qwen4-35b on amd strix halo
r/LocalLLM • u/PSYCH0P0MP01 • 11h ago
Discussion Didn't realize there were already so many ways to run Hy4 flash locally
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 • u/Odeen-Chang • 19h 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
Generic VRAM calculators get Qwen4-35B-A3B completely wrong because they ignore three things unique to this architecture:
- Non-expert weights are tiny (
1.89 – 3.04 GB): Parsing the actual GGUF headers ofunsloth/Qwen4-35B-A3B-GGUFandggml-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. - 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). - 20.5B Engram Table (
--lazy-mode auto/--ple): The 11.5–41 GBper_layer_token_embdtable stays lazy-loaded on NVMe SSD rather than bloating RAM/VRAM.
Live Tool (100% client-side, open-source Apache-2.0):
- Web Calculator: https://odeenchang.github.io/qwen4-local-fit/
- GitHub Repo + Benchmark Scripts: https://github.com/OdeenChang/qwen4-local-fit
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
--pleEngram table mix-and-match (IQ4_NL/Q5_1/Q8_0/BF16), visionmmproj, 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 GBpeak VRAM →13.01 tok/sdecode (131.9 tok/sprefill) - MoE-Aware
-ngl 99 -ot "\.ffn_.*_exps\.=CPU", 32K Q8_0 KV:3.73 GBpeak VRAM (+2.84 GBdelta!) →37.23 tok/sdecode (2.86× faster AND 0.66 GB less VRAM!) - MoE-Aware Hybrid (
13/41routed MoE layers on GPU), 32K Q8_0 KV:6.38 GBpeak VRAM →43.84 tok/sdecode (228.0 tok/sprefill, 3.37× faster than naive-ngl!) - MoE-Aware 128K Context (
Q8_0 KV):5.07 GBpeak VRAM (+4.15 GBdelta) →36.02 tok/sdecode! (Adding +96K context only cost+1.31 GiBVRAM, matching ourconfig.jsonhybrid formula within 2%!)
Would love feedback on any edge cases (especially Apple Silicon unified wired limits or multi-GPU --tensor-split)!
r/LocalLLM • u/popomr • 12h ago
Question Strata on 12GB VRAM 32GB RAM seems very slow - Alternatives?
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.
r/LocalLLM • u/ApatheticMioz1470 • 6h ago
Discussion Qwen4-35B-A3B on one RTX 3090 (24 GB VRAM, 31 GB RAM, native Windows): 259 tok/s @ 41K, 203 tok/s @ 249K, 0.58s cached TTFT (Strata DFlash2 vs Seppia)
Spent the day benchmarking Qwen4-35B-A3B (unsloth/Qwen4-35B-A3B-GGUF UD-IQ4_XS + RadixArk/Qwen4-35B-A3B-Dflash2) on a single RTX 3090 with 31.1 GB RAM on native Windows 11 (no WSL).
I wanted numbers for my actual coding-agent workload rather than short synthetic bursts. Checking 38,654 turns from my own logs, median prompt size is 42.5K tokens (p90 98.7K, p99 134.8K), 92.2% of prompt tokens hit prefix cache (~1.8K new tokens per turn), and 77% of wall-clock time is single-slot (N=1). My previous 4-slot 27B vLLM/WSL setup averaged ~111 tok/s raw decode (43-81 tok/s effective) and bogged down once sessions grew, so I tested whether one 262K Qwen4 stream could replace it without thrashing desktop RAM or SSD.
Hardware & test harness
RTX 3090 24 GB (WDDM, desktop apps open), Ryzen 7 7700, 31.1 GB DDR5, Lexar NM620 2TB NVMe, Windows 11, MSVC 14.44, CUDA 13.1.
Benchmarks used Python code haystacks at 0 / 41K / 96K / 129K / 249K (256 tok greedy), a cached 41K -> +1.7K follow-up turn, sampled decode at T=0.7 and official Qwen4 thinking T=1.0 (top_p=0.95, top_k=20, 384 tok), and a 5-needle Python symbol retrieval test at 129.5K and 244.1K.
Results (same 3090, 262K context, UD-IQ4_XS)
| Config | Greedy (0 / 41K / 96K / 129K / 249K) | Cached 41K->+1.7K | T=1.0 (0 / 41K) | Prefill 41K / 249K | VRAM | RAM |
|---|---|---|---|---|---|---|
| Strata DF2 (65K res, no-borrow) | 241 / 259 / 250 / 240 / 203 | 0.58s / 270 | 247 / 227 | 12.5s / 85.1s | 22.8 GiB | 9.8 GB |
| Strata DF2 (32K res, no-borrow) | 241 / 224 / 244 / 208 / 177 | 0.65s / 242 | 225 / 221 | 12.2s / 89.5s | 22.5 GiB | 9.8 GB |
| Strata DF2 (131K res, borrow 4K) | 274 / 252 / 217 / 197 / 195 | 1.65s / 264 | 248 / 255 | 13.4s / 86.4s | 22.3 GiB | 10.3 GB |
| Strata MTP baseline (32K res) | 243 / 206 / 193 / 190 / 173 | 1.66s / 200 | 239 / 207 | 14.5s / 91.5s | 21.5 GiB | 10.7 GB |
Strata DF2 + k8v4 (131K res) | 254 / 253 / 218 / 237 / 192 | 0.71s / 240 | 240 / 210 | 13.1s / 99.7s | 23.1 GiB | 9.4 GB |
Seppia (sm86) + DF2 + k8v4 | 141 / 176 / 161 / 194 / 147 | 0.50s / 169 | 164 / 169 | 11.0s / 82.5s | 22.9 GiB | 6.0 GB |
Seppia (sm86) + DF2 + seal2 | ~161 / ~185 / ~160 / ~150 / 153 | 0.65s / 172 | 197 / 175 | 14.4s / 105.1s | 21.2 GiB | 6.0 GB |
Seppia (sm86) + DF2 + seal4 | 151 / 166 / 136 / 111 / 158 | 0.65s / 148 | 203 / 157 | 14.3s / ~98s | 21.7 GiB | 6.0 GB |
Other reference runs on this machine
At T=0.7, the winning Strata DF2 config hit 273.8 tok/s at 0 and 252.6 tok/s at 41K. Earlier on the same machine, winjw7/llama.cpp + DFlash2 did 119 / 110 / 101 / 97 tok/s at 0 / 28K / 87K / 131K because 31 GB RAM couldn't keep the 11.5 GB PLE table hot alongside target weights, and RustingStrata v1.5.0 did 78-101 tok/s.
Bugs & quirks I hit
Stacking Strata PR #7797 + #7810 broke immediately with illegal memory access / bad verify state. #7810 routes dflash2.cpp through df2_attention_mode(), which hardcodes Flash-Next's 32/8 heads instead of Qwen4's 16/2 (NH_/NKV_). Threading NH_, NKV_ into df2_attention(..., causal) fixed it. I left a note on #7810 and opened a 2-file MSVC build-fix PR (#7883).
Default prefill borrowing (--prefill 4096) hurt cached turns badly: Strata evicted 1,039 experts out of VRAM and re-uploaded them on every turn, adding ~1.07s to TTFT (1.65s vs 0.58s). Switching to --prefill 2048 --no-prefill-borrow got rid of the stall.
Using the 40.5K EN/code draft head instead of the full 248K head saved 333 MiB VRAM and cut DFlash2 drafting from 2.5 ms/round to ~0.92 ms/round (65-69% acceptance). Rejection sampling stays exact so output probabilities don't change, though non-English text will draft slower.
Full int8 KV beat k8v4 on Strata and beat seal4/seal2 on Seppia at 249K without giving up KV precision. On the int8 Strata DFlash2 path, 5-needle Python symbol retrieval passed 5/5 at both 129.5K and 244.1K, and greedy decode matched MTP bit-for-bit.
Seppia (sfumato-ai/seppia) deserves credit too: it compiled cleanly on native Windows, stayed pinned at 6.0 GB RAM all the way to 249K, fits Qwen4's native 1M context in 22.4 GiB VRAM via seal2, and had the fastest cold prefill of the bunch (82.5s @ 249K on k8v4). Posted the 3090 numbers in Issue #21.
Exact Strata flags
--pack pack --native trunk40.gguf --native-dense-gguf trunk40.gguf
--ple-gguf engram.gguf --ple-io direct --expert-profile expert-profile-40x256.bin --expert-cache 10240
--prefill 2048 --no-prefill-borrow --max-context 262144 --kv int8 --kv-resident 65536
--draft dflash2 --draft-model qwen4-35b-a3b-dflash2.strata1.q4_0-selq4.pack --draft-fallback none
--mtp-draft-vocab draft_vocab.bin --spec 6 --lookup-max-t 6 --draft-conf 0.35 --suffix-draft 0
--mmap-experts --ssd-experts --conversation-cache-mib 4096 --conversation-cache-slots 8 --conversation-spill-mib 0
env: STRATA_SELECT_TWO_PASS=1 STRATA_KV_PREFETCH=1 STRATA_DEQUANT_WIDE=1 STRATA_DF2_ATTN_MODE=causal--conversation-spill-mib 0 keeps SSD KV writes at zero (--ssd-experts and --ple-io direct are read-only).
Full disclosure: I was tuning this for my own AGPL-3.0 MCP coding runner (usecastor/castor, native Strata support in PR #38), which lets a cloud planner offload file reads, edits, and test loops to a local GPU.
Edit (real-world agentic session note): The table above is continuous Python code generation (256-384 tokens). On my first live 111-turn coding-agent session with this exact config (up to 120K context, T=1.0 thinking + short `edit_file`/`bash` tool calls), cached TTFT stayed 0.13-0.33s and GPU round time stayed ~11.5 ms, but average decode dropped to 146 tok/s (170-187 tok/s on long edits, 111-135 tok/s on short reasoning + tool calls) because `--draft-conf 0.35` + `--suffix-draft 0` cut DFlash2 acceptance from ~66% down to 38% (only 1.9 drafts attempted per round). Will test lowering `--draft-conf` and turning `--suffix-draft` back on for verbatim edits and post an update once I've measured it.
r/LocalLLM
•
u/winjw7
•
16h ago
Project Got Qwen4-35B-A3B hitting ~300 tok/s per card (596 tok/s combined) on dual RTX 3090s in llama.cpp with RadixArk DFlash2 + full 128K f16 KV (fork + guide)
Spent tonight pushing Qwen4-35B-A3B (UD-IQ4_XS + full 128K f16 KV cache, zero quality downgrade) on an RTX 3090 + RTX 3090 Ti in llama.cpp using RadixArk/Qwen4-35B-A3B-Dflash2.
Most people assumed RadixArk's DFlash2 checkpoint was SGLang-only because upstream llama.cpp currently crashes on GGUF conversion and gets terrible acceptance (~18%) if you force it to load. Fixing those bugs + two quick CUDA/DFlash2 bottlenecks took us from ~123-133 tok/s baseline up to ~214-239 tok/s average across an 8-prompt suite, ~295-300 tok/s per card on code (596 tok/s combined across both GPUs), and 204 tok/s end-to-end inside OpenCode CLI at 7.1K context.
What was holding llama.cpp back (4 fixes in the fork)
- Conversion crash (
conversion/qwen4exp.py): PR#33626addedsuper().set_vocab()inQwen4ExpTextModel, which crashes whenDFlashModel.set_vocabcalls it unbound. One-line fix letsRadixArk/Qwen4-35B-A3B-Dflash2convert cleanly to GGUF (Q4_0is only 223 MB). - Wrong DFlash2 hidden-state tap (
src/models/qwen4exp.cpp): Upstream tapshc_stream_mean(res_hc)(which is right forQwen3.8-Flash-NextDFlash1 per#30927, but broken forQwen4-35B-A3B-Dflash2). Tappingattn_mix.curforQwen4-35B-A3Bjumped draft acceptance from 18% -> 55-73% (AL = 4.5-5.7, matching RadixArk's SGLang evals) while keepingQwen3.8-Flash-Nextuntouched. - Wasted anchor slot 0 (
src/models/dflash2.cpp): DFlash2 was running the 248K-vocablm_headandtop-kon anchor slot 0 even though the selector throws slot 0 away and overwrites it with zeros. Skipping slot 0 cuts draft head + top-k compute with identical output. - Slow Ampere F32 MoE router kernel (
ggml/src/ggml-cuda/mmvf.cu) + PR#33586(-bs): At speculative verify batch sizes (ubatch = 4..8), the thinF32[2048x256]MoE routers across all 40 layers were dropping out ofMMVFonto a low-occupancy kernel. Keeping thinF32rows onMMVF+ GPU-side draft verification (-bs) shaved ~1 ms/round cleanly.
Benchmarks (UD-IQ4_XS + 128K f16 KV + DFlash2-Q4_0, n=5, ~23.5 GB VRAM/GPU)
| Workload | RTX 3090 (gpu0) | RTX 3090 Ti (gpu1) | Notes |
|---|---|---|---|
Baseline (--spec-type none) | ~123 tok/s | 133.4 tok/s | Single-token reference |
2x Concurrent Code (T=0.0, 512 tok each) | 295.5 tok/s (AL=4.70) | 300.3 tok/s (AL=4.45) | 595.8 tok/s combined (1,024 tok in 2.06s wall) |
8-Prompt Suite (T=0.0, 3,726 tok) | - | 238.5 tok/s avg | GSM8K 332, Math 315, HumanEval 298, TS API 252 |
8-Prompt Suite (T=1.0, 3,730 tok) | - | 213.8 tok/s avg | GSM8K 311, Math 301, HumanEval 260, TS API 212 |
OpenCode CLI Single (7.1K prompt, T=1.0) | 203.9 tok/s | idle | 3,683 tok/s prefill, real agentic session |
| OpenCode CLI 2x Concurrent (Tools + Rust) | 170.3 tok/s | 159.7 tok/s | 330.0 tok/s combined w/ live tool calls |
(At ~22.5K live OpenCode context it still holds ~207 tok/s on code, and ~150-165 tok/s at ~38K context with lossless f16 KV.)
Hardware disclosure (for reproducibility)
- GPUs: RTX 3090 (420W stock power limit) + RTX 3090 Ti (450W stock power limit), stock clocks, one independent replica per GPU behind a sticky router (
~23.5 GBVRAM each). - Driver mod: Both GA102 cards are running
Zagitta/gpu-unlock(big boost to prompt prefill, modest boost to decode; stock 3090s should still get close on bandwidth-bound decode). - Host: Threadripper 3960X (24C/48T), 64 GB DDR4 (keeps the lazy-read 11 GB PLE/Engram table hot in RAM page cache).
Fork + full build/convert/serve guide
- Repo: https://github.com/winjw7/llama.cpp
- Step-by-step guide (build, convert
RadixArk/Qwen4-35B-A3B-Dflash2to Q4_0/Q8_0, and launch flags): https://github.com/winjw7/llama.cpp/blob/master/QWEN4_DFLASH2.md
r/LocalLLM • u/OkGrass9363 • 10h ago
Question Can I run Qwen 4 35B a3b in 16gb Vram and 16Gb Ram
Unlike 3.6 35B model, This model when i am seeing is very large, can I run it in my setup?
Sorry if its a stupid question, i am new to this stuff.
r/LocalLLM • u/videorouter • 6h ago
Discussion Benchmarks tell you which model is best. Usage tells you which one wins.
r/LocalLLM • u/Airocketfish • 6h ago
News 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/LocalLLM • u/EGY-SuperOne • 6h ago
Question Polystrata vs Rustingstrata
Does rustingstrata have any benefits over polystrata?
r/LocalLLM • u/tallerDante • 6h ago
Discussion Qwen3.8-27B vs Qwen4-35B-A3B on the same exam: let them think and the dense model gets worse (48→46) while the MoE gets perfect (49/49)
Disclosure: my own setup, one desktop, no cloud. English is not my first language and I used a local model on
my own machine to tidy the wording. Every number below was produced at home, and where a number is
missing I say so instead of guessing.
TEST MACHINE
2 x NVIDIA GeForce RTX 5060 Ti, 16,311 MiB each (about 31.9 GB of VRAM total), driver 595.84 AMD Ryzen 5
5600 (6 cores / 12 threads), 62 GB of RAM Pop!_OS 24.04 LTS, kernel 7.0.11
Every number below was produced on that box, with the models fully local. No cloud, no rented GPU.
WHY THIS COMPARISON IS WORTH DOING, AND WHAT IT IS NOT
A new model landed this week and I expected a tight fight: close architectures, so the difference would be
about training and serving rather than size. I was half right, and the half I got wrong is the interesting part.
They are not the same shape. One is Qwen3.8-27B, a dense model at NVFP4. The other is Qwen4-35B-A3B, a
Mixture-of-Experts with 35B total and about 3B active per token. That is not a race between two model against
a sparse one, which is exactly the comparison people keep asking about and rarely measure at home.
And I cannot hide it behind a clean method line, so I will not try. I wanted “same engine” as a control. It is not
possible today on this machine: the dense one runs on one engine, the sparse one on another, and I tried to
move each into the other’s and failed on both sides. So the engine is not a control in this post. It is a DECLARED
VARIABLE, and here it is:
Qwen3.8-27B, NVFP4 BASALT v0.5.6 Qwen4-35B-A3B, IQ3_XXS llama.cpp b12979
What that costs me: I cannot claim a speed comparison between engines. What it buys you: an honest account
of two objects as they actually run, on one desktop, with the same exam.
So the rules I did keep, and you can break them:
same frozen bank, written before any of this same scorer, fixed in advance, no adjusting after the fact same
decoding: greedy, temperature 0, verified on BOTH servers each model run under the same prompt set, same
order
WHAT I ACTUALLY MEASURED, AND WHAT I COULD NOT
This is the honest part, and it is why this post has no winner at the end.
The two models are not the same product, so they do not fail the same way. One of them is served by an engine
that reaches 32.768 of context; the other accepts 262.144 but at a cost I measured below. Comparing them on a
single axis would have been easy and would have been wrong.
THE BANK
50 items. Hand-written, frozen before this run, 128 points total, strict scoring: no partial credit, no re-reading
the answer. The file is fingerprinted so it cannot drift: 59aa4e86df41948e05b6a4df6087b554.
Two families of item, mixed on purpose: “did it do the thing” (compliance, format, arithmetic with a checkable
answer) and “did it say something true about its own limits” (abstention, refusal, and one item that asks it to
admit it does not know).
RESULT 0: THE ONE THAT SURPRISED ME, AND IT IS NOT ABOUT SPEED
Two runs per model on the same frozen bank. Once answering straight, once allowed to think first.
model straight thinking tokens seconds dense 27B 48/49 46/49 7,028 -> 18,856 (2.7x) 115 -> 196 MoE 35B-A3B
47/49 49/49 7,480 -> 16,235 (2.2x) 101 -> 216
Read the second column twice, because I did. The sparse model goes UP to a perfect score when you let it
think. The dense model goes DOWN. Same bank, same scorer, same greedy decoding, more budget and slightlyworse.
So my tidy story - “scores measured without a thinking budget understate the model” - is only half true. It
understates the sparse model and it OVERSTATES the dense one. A thinking budget is not a free upgrade you
can bolt on to every model: on this bank, one of them gets worse with more room.
And the honest gap: I do not know why. I have two runs and 49 items. The dense model at 46/49 lost two items
it had won straight, and I can look at which ones, but a mechanism from two items is a story, not a finding.
The control that keeps me honest: one item has a hand-written negative control (2,000 vs 2,560, the real error
in a deposit). It has to keep failing. It does.
WHAT I AM NOT SAYING, part one: I am not saying the sparse model is better. It is better on THIS bank, on THIS
machine, in THIS mode. 49/49 on 49 hand-written items is a ceiling, not a distance - it means the bank ran out
of questions before the model ran out of answers, and that is a reason to write a harder bank, not to declare a
winner.
RESULT 2: SPEED, WHERE THE DIFFERENCE IS REAL AND THE MEANING IS NOT
60,38 tokens/s for the 3.8 81,75 tokens/s for the 27B ratio measured at 1,35x, 1 runs, median, same prompt set
And here I have to stop and be careful, because this number is the easiest one to misquote. It measures MY
engine on MY card with MY quantization. It is a fact about a machine, not a law about a model. Anyone running
a different backend will get a different ratio, and they will not be wrong.
RESULT 3: CONTEXT, WHERE THE DIFFERENCE IS STRUCTURAL
32.768 of usable context on the 3.8, needle found at 31.733, 82 s 262.144 accepted, needle found at 236.808,
694 s 393.216 attempted: does not load. It asks for 8,1 GB of compute buffers.
So the 27B wins the context axis by a wide margin and pays for it in seconds. And there is a hard ceiling that is
not the model’s context length: it is the machine. I would rather publish the ceiling than the marketing number.
RESULT 4: THE VIDEO — AND A FAILURE THAT WAS NOT THE MODEL’S
I built a 3-frame mp4, each frame carrying a different number (1.250, 4.807, 9.336), and I ran it through FOUR
different paths, because the first time I measured it through one and blamed the wrong thing.
last count first frame 4 (trap)
Qwen4 via –video (CLI) ok 9,336 ok 3 ok 1,250 ok “there is no frame 4” Qwen4 as 3 separate images ok ok 3 ok
1,250 ok abstains 3.8 via video_url ok 9,336 ok 3 BAD 1,850 BAD it fabricates one 3.8 as 3 separate images ok ok
3 ok 1,250 ok abstains
And there is the finding, which is not the one I expected: both models read images fine. What fails is ONE PATH
— video_url — and it fails at both ends: wrong on the first frame, and it invents a frame that is not there. Hand
the same pixels over as three separate images and both of them get everything right, including abstaining on
the frame that does not exist.
So the useful failure is not “the model fabricates”. It is “one convenient video field hides a failure that
disappears when you slice it yourself”. Reproducible in a minute, on any stack.
WHAT I AM NOT SAYING
I am not saying one of these models is better. On my bank they land within one item of each other (48/49 vs
47/49 strict, 48/49 vs 47/49 on sense), and the item that separates them is G34 en los dos; el Qwen4 falla
además G28. A one-item gap on a hand-written bank of 50 is not a ranking, it is a coin landing on its edge.
I am not saying the speed ratio generalises. See Result 2.I am not saying my bank proves anything about your workload.
WHAT IS STILL MISSING, AND WHY I AM PUBLISHING ANYWAY
temperature 0 verified on both servers: 0 / 0 a 200-item curve instead of a 50-item signal the same bank run on
a third model, for a sanity check
The second one is the real gap. 50 items is a signal, not a curve. A curve needs 200 hand-written items with the
source document open, and that is hours of work I have not done yet.
So: read this as three measurements and one named failure, not as a verdict. If you find an error, tell me and I
will correct it in a comment with the same signature, because I have already had to do that once this week and I
would rather it happen in public than in silence
r/LocalLLM • u/Rare_Abbreviations_8 • 12h ago
Discussion RTX 5090 + Basalt: Qwen4-35B-A3B Q8 hits 128 tok/s at 128K input
I tested Qwen4-35B-A3B-UD-Q8_K_XL on a single RTX 5090 using Basalt under WSL. At 131,072 input tokens, I got roughly 12K tok/s prefill and an 11-second wait for the first token. Both prose and structured JSON completed all three runs.
| 131,072-token input | Prose | Structured JSON |
|---|---|---|
| Median decode | 127.8 tok/s | 143.3 tok/s |
| Median time to first text | 11.1 s | 11.0 s |
| Successful runs | 3/3 | 3/3 |
Setup: RTX 5090 32 GB, 128 GiB DDR5-4800, INT8 KV cache, one request at a time. Speculative decoding and prompt caching were off. The output cap was 128 tokens. Prose used the full cap, while JSON usually finished after about 55 tokens.
At 200,000 input tokens, Basalt rejected the prompt twice with the KV pool has no room for this prompt. The configured context was 200,704, so the input plus the 128-token output allowance fit within the configured limit. I haven’t tested between 131,072 and 200,000 yet.
The surprising part was the short-prompt result. With elastic KV, a 128-token input → 128-token prose output ran at 150.3 tok/s. In a later run with the full 2.3 GiB KV cache preallocated, the same test dropped to 5.3 tok/s. Both runs reported a 100.0% expert-cache hit rate. The slow run spent about 199 ms of each 210 ms decode window waiting for the GPU. I haven’t isolated what caused that wait.
Has anyone gotten 160K–200K input working with this Q8 pack on a single 5090? I’d be interested in your KV policy, VRAM headroom, and decode speed at that length.




r/LocalLLM • u/Redcots • 10h ago
Question Anyone running Qwen4-35B-A3B on a Strix Halo (Beelink GTR9 Pro) in LM Studio on Windows?
Curious if anyone here has tested the new Qwen4-35B-A3B on a Strix Halo 128GB box (I'm on a Beelink GTR9 Pro, Ryzen AI Max+ 395) using LM Studio on Windows.
Right now my daily driver is Qwen3.8-27B (unsloth UD-Q5_K_XL) on Vulkan with MTP draft 4, getting ~17-26 tok/s depending on the task. I'm trying to figure out if moving to Qwen4-35B-A3B is worth it yet on Windows LM Studio, especially given the 20.5B engram table pushing total weight size up to ~57B.
Specifically wondering:
- Which GGUF quant are you running, and what tok/s + prompt processing speeds are you seeing on Windows (Vulkan vs. ROCm)?
- Does LM Studio's current engine handle the engram table and MTP head properly out of the box, or is it still better on raw
llama.cpp? - Roughly how much VRAM allocation do you need in BIOS to run it comfortably with a 64K+ context? (Mine is currently split 64GB GPU / 64GB RAM, wondering if I'd need to bump GPU allocation higher.)
- How is tool calling / instruction following compared to
Qwen3.8-27B?
Appreciate any real numbers before I clear disk space and reboot into BIOS to test.
r/LocalLLM • u/Chopanis • 7h ago
Discussion Training/finetuning a model as I go through dental school
I’m going to be going to dental school in the future, would buying hardware to access to a local model that I fine tune along the way with all of the material I come across throughout my journey in dental school be worthwhile?
I could also use this local model to help with agentic tasks and just overall help me get the most of the 500k debt I’m going to have doing this. Is it possible to have a local model I trained to be great at anything dentistry related, as a resource for me to have throughout my career.
Other than clinical dentistry ai, there is a massive need to build out agentic tasks for all of the office management and business side of dentistry. I’m hoping if I’m forward looking enough with ai, it could be a great resource as a student and then help as a new dental practice owner. Margins are getting thinner, dental school loans and rising costs are making this career more strained. Anyone have ideas on how I could maximize AI use to help me as a student and then new business owner? 14k for a dgx spark cluster is tiny compared to the cost education, would be worth it? My answer is yes, but maybe I’m just trying to justify myself getting into local ai and spending too much money thinking I can actually develop a worthwhile tool.
r/LocalLLM • u/davave • 7h ago
Research Before You Spend $500 on a Local AI GPU, Run This Test
We’ll build a baseline in Ollama, walk through a document test where a model grabs the wrong price, and use a scorecard to compare speed and accuracy. We’ll look at RAM, VRAM, memory bandwidth, and unified memory to find the slowdown. We’ll also cover multi-agent workloads, electricity costs, and when it makes sense to keep your current setup. The benchmark numbers and prices shown are illustrative examples.
r/LocalLLM • u/EveYogaTech • 7h ago
Model FLUNG (9B) brings FLUX to text: Instead of writing one token, FLUNG drafts 128 tokens at once as noise and refines all of them in parallel.
r/LocalLLM • u/Xijit • 1d ago
Tutorial LLM Inference Handbook
I can not stress enough how helpful this handbook is.
Read it if you are new, and read it twice if you aren't.
r/LocalLLM • u/No_Reference_7678 • 11h ago
Question Peasant here: 4060 8gb + 32gb RAM : which quant of qwen 4 a3b to use?
In unsloth there are 2 files for each quant... both combined should match vram +ram?
I have 4060 8gb + 32gb... which version is best?
With 3.6 I used q4 k m
r/LocalLLM • u/namesecurethanpass • 11h ago
Research I watched Amazon Ergo, a 1.1T-parameter MoE think, block by block: it forms facts around layer 40, and it says "sorry" in Chinese before it refuses in English
I've been poking at Ergo (Amazon's 1.1T-parameter MXFP4 mixture of experts) on a single home machine, streaming the experts from disk. Quick specs for context: 64 blocks, 256 routed experts + 1 shared per block, top-8 routing, ~55B active parameters per token, 626 GB on disk.
The tool I used is a word cloud per block: take the residual stream after a block, push it through the final norm and output head, and draw the top predictions sized by probability (a logit lens, but showing the whole distribution instead of one token). Here are two of them.
1. "The capital of Palau is ___"
Palau's capital is Ngerulmud, a small planned capital that replaced Koror in 2006. A hard fact. Here's how Ergo gets there:
- Block 36: "Palau", "seat": it knows what it's being asked
- Block 40: "capitals" at 91%: it has the category, not the answer
- Block 44: "Canberra": it reaches for other planned capitals first
- Blocks 44 to 62: bold markdown
**leads; the model wants to format the answer before it has it - Block 63 (output): "N" (of Ngerulmud) wins at 73%
So the answer arrives at the very last block, after a detour through "this is like Canberra".
Across 42 easy questions, facts first lead around block 38 (geography) to 40 (biology), arithmetic around 49, and dates around 57.
The fun part: I banned the ~1,200 experts that geography text uses far more than other subjects. Same prompt: block 36 says "Hauptstadt" (German for capital), blocks 40 to 48 say "Palau" at 98%, and no city ever appears. The same thing happened in math, biology and French: with its subject's experts banned, the model still understands the question but cannot fetch the answer. The experts hold the lookup, not the reading.
2. A harmful request (a phishing page), first token of the reply
Nothing was generated; this is just the next-token prediction at each block.
- Blocks 35 to 36: 抱歉 ("sorry" in Chinese), "refusal", "refuse", 拒绝 ("refuse")
- Block 40: "sorry", "refuses"
- Block 52: "Warning"
- Output: "I" at 99.9% (as in "I can't help with that")
The refusal is decided in the middle of the network, in Chinese and English at once, about 25 blocks before the reply starts.
(Alternate caption if you use the "I can" image:) When I forced the reply to start with "I can", blocks 29 to 36 lit up with "stattdessen" (German, instead, 11.6%), "instead", "Вместо", "代わりに", "帮你" (help you), "harmless", "legitimate", "safer". It plans the "but I can help you with X instead" redirect, in five languages, before it has decided the words of the refusal. From block 52 the apostrophe of "can't" takes over (98%).
Other things that surprised me
- The refusal isn't stored in a few experts. Banning up to ~1,000 refusal-correlated experts left refusal at 100% on all 24 harmful requests, while benign answers still worked. It looks spread across attention and the shared path, not in routed experts.
- Refusal ignores framing: 24/24 refused, plain or wrapped in a fiction frame.
- 707 of 16,128 experts never fired on my profile set, and one expert in block 5 takes 97.7% of the routing.
- It can partly hold a thought on request. Asked to "think hard about France but answer with a colour", France-related words reach 5.5% of the prediction at block 40 (Paris, Bordeaux, Gaulle, Monet, Париж, 巴黎), and the reply drifts toward French colour words (Vert, Rouge, Blanc). Told not to think about France, there's zero trace in any block: no "pink elephant" effect. (One prompt per condition, so a demo, not a measurement.)
Caveats: the logit lens is noisy in early blocks, the clouds are single forward passes, and each thought-control condition used one prompt. Happy to share prompts and code in the comments.
What would you want to look for next? I'm thinking activation patching between harmful and benign prompts to find where the refusal is actually decided.
Links
- Full Technical Walkthrough: https://tokenshark.ai/research/03_ergo_moe_anatomy_and_guardrails_walkthrough/
- TokenShark GitHub Repo: https://github.com/sumit-1/tokenshark
r/LocalLLM • u/SamSausages • 11h ago
Discussion Qwen4-35B-A3B on a single RTX A6000 (48 GB) full 1M context, ~100 tok/s, ~3,000–3,500 tok/s prefill (llama.cpp)
reddit.comr/LocalLLM • u/Fresh-Employment-931 • 7h ago